A context-aware based long English text adaptive translation optimization method and system

CN122987971APending Publication Date: 2026-10-27SICHUAN TECH & BUSINESS COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611158215.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0008]本申请提供了一种基于上下文感知的英语长文本自适应翻译优化方法及系统,以解决现有技术中上下文断裂、领域适配性差、长距离语义捕获不足和翻译风格僵化的问题,从而提升英语长文本的翻译质量和适配性

Benefits of technology

[0019]相对上述背景技术,本申请提供的基于上下文感知的英语长文本自适应翻译优化方法及系统,能够通过多粒度上下文特征提取与融合解决上下文断裂问题,结合动态领域自适应与术语管理提升领域适配能力,采用滑动窗口+跨窗口注意力机制强化长距离语义依赖建模,同时融入个性化风格自适应实现翻译风格的灵活调整,最终实现英语长文本的高质量、高适配性翻译,系统则为该方法的落地提供硬件和软件支撑,保障方法的高效执行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122987971A_ABST
    Figure CN122987971A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of natural language processing and machine translation, and particularly relates to an English long text self-adaptive translation optimization method and system based on context perception, which comprises the following steps: performing multi-granularity context feature vector extraction and attention mechanism fusion on an English long text to obtain a global context perception vector; performing professional field and term set matching according to the global context perception vector, and obtaining a field perception context vector; generating an enhanced global context vector based on the field perception context vector; and generating a translation result of the English long text through personalized style self-adaptive translation by combining the enhanced global context vector with a user text style preference vector. The application can solve the problems of context fracture, poor field adaptability, insufficient long-distance semantic capture and rigid translation style in the prior art, thereby improving the translation quality and adaptability of the English long text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of natural language processing and machine translation technology, and in particular to a context-aware adaptive translation optimization method and system for long English texts. Background Technology

[0002] With the acceleration of globalization, the demand for cross-language translation of long texts (such as academic papers, technical documents, legal contracts, and literary works) in English, as an international language, is increasing. Existing machine translation methods, such as statistical machine translation and neural machine translation (NMT), have achieved good results in processing short sentences or texts with weak contextual dependencies.

[0003] However, existing technologies still have the following significant drawbacks when processing long English texts: 1. Contextual Discontinuity Problem: Traditional translation models usually translate sentences independently, ignoring the semantic coherence and logical connections between sentences and paragraphs. This can lead to problems such as unclear pronoun references, inconsistent terminology translations, and disordered text logic, making it impossible to achieve a coherent expression of the overall semantics of the text.

[0004] 2. Poor domain adaptability: The translation model performs inconsistently in terms of translation accuracy across different professional fields (e.g., medicine, law, computer science). When long texts involve multiple professional fields or technical terms, the translation model struggles to dynamically adjust its translation strategy, resulting in inconsistent translation of technical terms and even errors, failing to meet the translation accuracy requirements of the professional field.

[0005] 3. Insufficient ability to capture long-distance semantic dependencies: Although many existing translation models (e.g., the Transformer model) have introduced self-attention mechanisms, when dealing with long texts of thousands or even tens of thousands of words, their ability to capture long-distance semantic dependencies across paragraphs and pages is still limited due to limitations in computing resources and model structure. This can easily lead to the problem of "forgetting" key information from the preceding text, and makes it impossible to achieve effective semantic association between the preceding and following parts of a long text.

[0006] 4. Lack of personalization and interactivity: Existing translation models cannot adapt to user feedback or specific texts (e.g., formal, colloquial, literary), resulting in rigid translation outputs that fail to meet users' high standards for translation quality and stylistic consistency.

[0007] Therefore, how to enable machine translation to effectively integrate global contextual information, dynamically adapt to text domain and text style, and support long-distance semantic modeling is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0008] This application provides a context-aware adaptive translation optimization method and system for long English texts to address the problems of context fragmentation, poor domain adaptability, insufficient long-distance semantic capture, and rigid translation style in existing technologies, thereby improving the translation quality and adaptability of long English texts.

[0009] To solve the above-mentioned technical problems, this application provides the following technical solution: A context-aware adaptive translation optimization method for long English texts includes the following steps: Step S110: Extract multi-granularity context feature vectors from the long English text and fuse them using an attention mechanism to obtain a global context-aware vector; Step S120: Match the professional domain and terminology set based on the global context-aware vector and obtain a domain-aware context vector; Step S130: Generate an enhanced global context vector based on the domain-aware context vector. Step S140: Generate translation results for long English texts by combining enhanced global context vectors with user text style preference vectors for personalized style adaptive translation.

[0010] The context-aware adaptive translation optimization method for long English texts described above preferably includes the following sub-steps in step S110: Step S111: Divide the long English text layer by layer to obtain word sequences, sentence sequences, and paragraph sequences; Step S112: Encode the word sequences, sentence sequences, paragraph sequences, and the long English text layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and discourse vectors; Step S113: Fusion the multi-level word vectors, sentence vectors, paragraph vectors, and discourse vectors using an attention mechanism to obtain a global context-aware vector.

[0011] The context-aware adaptive translation optimization method for long English texts described above preferably includes the following sub-steps in step S120: Step S121: Determine the professional domain to which the long English text belongs and the domain confidence of the professional domain based on the global context-aware vector; Step S122: Determine the term set of the long English text based on the professional domain to which the long English text belongs and calculate the term fusion vector of all terms in the term set; Step S123: Combine the domain confidence and the term fusion vector to perform professional domain adaptive enhancement on the global context-aware vector to obtain the domain-aware context vector.

[0012] The context-aware adaptive translation optimization method for long English texts described above preferably includes the following sub-steps in step S130: Step S131: Divide the segment sequence of the long English text into sliding windows; Step S132: Encode the segment sequence of each window to obtain a window semantic vector, and calculate the attention weight of each window based on the window semantic vector and the domain-aware context vector; Step S133: Generate an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vector.

[0013] The context-aware adaptive translation optimization method for long English texts described above preferably includes the following sub-steps in step S140: Step S141: Extracting text style feature vectors based on enhanced global context vectors; Step S142: Fusing the text style feature vectors with user text style preference vectors to obtain a text style fusion vector; Step S143: Encoding the enhanced global context vectors into encoder feature vectors, and using the encoder feature vectors, text style fusion vectors, and the decoder's own sequence concatenation and dimensionality adjustment as decoder inputs to generate the translation result of the long English text.

[0014] A context-aware adaptive translation optimization system for long English texts includes: a feature extraction and fusion module, a domain terminology matching and enhancement module, a context vector enhancement module, and a personalized style adaptive translation module. The feature extraction and fusion module extracts multi-granularity context feature vectors from the long English text and fuses them using an attention mechanism to obtain a global context-aware vector. The domain terminology matching and enhancement module matches the domain with a set of terms based on the global context-aware vector and obtains a domain-aware context vector. The context vector enhancement module generates an enhanced global context vector based on the domain-aware context vector. The personalized style adaptive translation module combines the enhanced global context vector with the user's text style preference vector to generate the translation result of the long English text using personalized style adaptive translation.

[0015] The context-aware adaptive translation optimization system for long English texts described above preferably includes a feature extraction and fusion module comprising: a text hierarchical partitioning submodule, a layer-by-layer encoding submodule, and a multi-level vector fusion submodule. Specifically, the text hierarchical partitioning submodule partitions the long English text layer by layer to obtain word sequences, sentence sequences, and paragraph sequences; the layer-by-layer encoding submodule encodes the word sequences, sentence sequences, paragraph sequences, and the long English text layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and discourse vectors; and the multi-level vector fusion submodule fuses the multi-level word vectors, sentence vectors, paragraph vectors, and discourse vectors using an attention mechanism to obtain a global context-aware vector.

[0016] The context-aware adaptive translation optimization system for long English texts described above preferably includes a domain terminology matching and enhancement module comprising: a domain matching submodule, a terminology set matching submodule, and an adaptive enhancement submodule. Specifically, the domain matching submodule determines the domain to which the long English text belongs and the domain confidence of that domain based on the global context-aware vector; the terminology set matching submodule determines the terminology set of the long English text based on its domain and calculates the terminology fusion vector for all terms in that terminology set; and the adaptive enhancement submodule combines the domain confidence and the terminology fusion vector to perform domain-specific adaptive enhancement on the global context-aware vector, resulting in a domain-aware context vector.

[0017] The context-aware adaptive translation optimization system for long English texts described above preferably includes a context vector enhancement module comprising: a sliding window partitioning submodule, an encoding and weight calculation submodule, and a long-distance semantic fusion module. The sliding window partitioning submodule partitions the segment sequence of the long English text into sliding windows. The encoding and weight calculation submodule encodes the segment sequence of each window to obtain a window semantic vector, and calculates the attention weight of each window based on the window semantic vector and the domain-aware context vector. The long-distance semantic fusion module generates an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vector.

[0018] The context-aware adaptive translation optimization system for long English texts described above preferably includes a personalized style adaptive translation module comprising: a text style extraction submodule, a text style fusion submodule, and an encoding, splicing, adjustment, and generation submodule. The text style extraction submodule extracts text style feature vectors based on an enhanced global context vector. The text style fusion submodule combines the text style feature vectors with the user's text style preference vector to obtain a text style fusion vector. The encoding, splicing, adjustment, and generation submodule encodes the enhanced global context vector into an encoder feature vector using its encoder. The encoder feature vector, the text style fusion vector, and the decoder's own sequence splicing and dimensional adjustment are used as the decoder input to generate the translation result of the long English text.

[0019] Compared to the aforementioned background technologies, the context-aware adaptive translation optimization method and system for long English texts provided in this application can solve the problem of context fragmentation through multi-granularity context feature extraction and fusion, improve domain adaptability by combining dynamic domain adaptation and terminology management, strengthen long-distance semantic dependency modeling by adopting a sliding window + cross-window attention mechanism, and integrate personalized style adaptation to achieve flexible adjustment of translation style. Ultimately, it achieves high-quality and highly adaptable translation of long English texts. The system provides hardware and software support for the implementation of this method, ensuring its efficient execution. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0021] Figure 1 This is a flowchart of the context-aware adaptive translation optimization method for long English texts provided in this application; Figure 2 This is a flowchart of the process for obtaining a global context-aware vector provided in this application; Figure 3 This is a flowchart of the process for obtaining a domain-aware context vector provided in this application; Figure 4 This is a flowchart of the enhanced global context vector provided in this application; Figure 5 This is a flowchart of the translation results of the adaptive translation generating long English text provided in this application; Figure 6 This application provides a flowchart of a context-aware adaptive translation optimization system for long English texts. Detailed Implementation

[0022] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0023] Example 1 like Figure 1 As shown, this application provides a context-aware adaptive translation optimization method for long English texts, including the following steps: Step S110: Extract multi-granularity contextual feature vectors and fuse them with an attention mechanism for long English texts to obtain a global context-aware vector; To address the issue of contextual fragmentation, this paper proposes a multi-level approach to segmenting and encoding long English texts at the word, sentence, paragraph, and discourse levels. By combining word vectors, sentence vectors, paragraph vectors, and discourse vectors with an attention mechanism, a global context-aware vector with semantic connections is constructed, thereby solving the problem of semantic disconnect between sentences and paragraphs from the ground up.

[0024] Among them, such as Figure 2 As shown, step S110 includes the following sub-steps: Step S111: Divide the long English text layer by layer to obtain word sequence, sentence sequence, and paragraph sequence; Based on the natural semantic boundaries of this long English text By dividing the text layer by layer, we obtain word sequences, sentence sequences, and paragraph sequences, with the word sequences containing long English texts. All the words and sentence sequences contained in the long English text All sentences in the sequence of paragraphs contain long English text. All paragraphs in.

[0025] Word sequence: , For long English texts The first word in the text, For long English texts The second word in the text, For long English texts The first in One word, For long English texts The first in One word, For long English texts Total number of words.

[0026] Sentence sequence: , For long English texts The first sentence in the text, For long English texts The second sentence in the text, For long English texts The first in One sentence. For long English texts The first in One sentence. For long English texts The total number of sentences; among them, , For the first The first word of the sentence, For the first The second word of the sentence. For the first The first sentence One word, For the first The number of words in each sentence.

[0027] Segment sequence: , For long English texts The first paragraph, For long English texts The second paragraph, For long English texts The first in One paragraph, For long English texts The first in One paragraph, For long English texts The total number of paragraphs; among which, , For the first The first sentence of the paragraph, For the first The second sentence of the paragraph, For the first The first paragraph One sentence. For the first The number of sentences in each paragraph.

[0028] Step S112: Encode the word sequence, sentence sequence, paragraph sequence, and long English text layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and text vectors; A pre-trained word embedding model is used to sequentially map discrete words in a word sequence into continuous low-dimensional word vectors; where, ; For pre-trained word embedding models, BERT-based pre-trained language models can be used; For the first Word vectors of words, , The dimension space representing the vector, Word vectors Dimensions.

[0029] A sentence-level encoding model is employed, sequentially encoding each sentence in the sentence sequence into a sentence vector. Specifically, taking the word sequence of a sentence as input, the model encodes the semantic relationships between words in the sentence's word sequence, outputting the sentence vector. ; For sentence-level coding model, Either a Bi-LSTM model or a Transformer model can be used. If a Bi-LSTM model is used, the bidirectional hidden layer outputs of the Bi-LSTM model are concatenated as the sentence vector. If the Transformer model is used, the overall semantic vector of the sentence after being encoded by the Transformer model is extracted as the sentence vector; For the first The sentence vector of each sentence. , Sentence vector Dimensions.

[0030] A segment-level coding model is adopted, which encodes each segment in the segment sequence into a segment vector. That is, taking the sentence sequence of a segment as input, the semantic relationships between sentences in the sentence sequence of the segment are encoded, and the segment vector of the segment is output. ; It is a segment-level coding model. A lightweight Transformer model (2 layers) can be used to capture the semantic relationships between sentences that are naturally defined by the boundaries of the sentence sequence of a paragraph; For the first The segment vector of each paragraph. , segment vector The dimension can make This simplifies dimension matching. The lightweight Transformer model (2 layers) refers to a simplified Transformer encoder structure containing only two encoding layers.

[0031] Using a document-level coding model, long English texts are encoded. All segment sequences are encoded as document vectors, i.e., based on long English texts. Taking all segment sequences as input, the algorithm encodes the global semantic logical relationships between all segment sequences, and outputs a document vector; where... ; For document-level coding models, A Transformer model with residual connections (3 layers) can be used to capture long-distance semantic relationships across paragraphs; For long English texts The text vector, , For document vectors The dimension can make This further simplifies dimension matching and allows for seamless fusion of semantic vectors at different levels through dimension standardization. This ensures both mathematical rationality and computational efficiency, as well as ease of engineering implementation. The Transformer model with residual connections (3 layers) refers to a Transformer encoder structure consisting of three encoding layers, with residual connections integrated into the core module of each layer.

[0032] Step S113: Attention mechanism is used to fuse multi-level word vectors, sentence vectors, paragraph vectors and passage vectors to obtain global context-aware vectors; A multi-level attention network model is adopted to assign relevance weights to context feature vectors such as word vectors, sentence vectors, paragraph vectors and passage vectors. After matching word vectors, sentence vectors, paragraph vectors and passage vectors with their corresponding relevance weights, attention mechanisms are used to fuse them to obtain global context-aware vectors.

[0033] The multi-level attention network model unifies the dimensions of all word vectors, sentence vectors, paragraph vectors, and passage vectors through its linear layers, and then aggregates all the dimension-unified feature vectors to form a multi-granularity context feature vector set; ; It is a set of multi-granularity context feature vectors; This is the first feature vector after dimension unification. This is the second feature vector after dimensional unification. For the first dimension after unification 1 eigenvector For the first dimension after unification 1 eigenvector; , For the subsequently calculated global context-aware vector The dimension can make All subsequent feature vectors, including term vectors, style template vectors, user style preference vectors, and text style feature vectors, will have a unified dimension of [dimensional value missing]. This ensures the mathematical rationality and dimensional matching of vector operations, thereby not only simplifying calculations, guaranteeing the rationality of algorithms, and reducing the cost of engineering implementation, but also forming a complete dimensional unification system. The total number of feature vectors after dimension unification. .

[0034] Multi-level attention network models compute multi-granularity contextual feature vector sets. Each feature vector in the long English text The attention score is then normalized to obtain the relevance weights of the feature vector. For example, multi-level attention network models can use additive attention (Bahdanau Attention) to calculate the attention score.

[0035] Furthermore, the formula for calculating the attention score is as follows: ; in, For the first eigenvectors Attention score; For attention weight vectors, for transpose; , All of these are attention-learnable parameters; for For long English texts The global representation vector can be derived from the document vector. Directly serving as, or composed of, all eigenvectors Aggregation yields; This is a bias term.

[0036] Furthermore, the formula for calculating the relevance weight is as follows: ; in, For the first eigenvectors The relevance weights reflect the long English text With feature vectors of different granularities Contextual relevance, ; It is an exponential function.

[0037] Then, the multi-level attention network model processes the multi-granularity context feature vector set. The global context-aware vector is obtained by weighted summation of all feature vectors and their corresponding relevance weights.

[0038] Furthermore, the formula for calculating the global context-aware vector is as follows: ; in, For global context-aware vectors, For long English texts Its unique characteristic is characterized by.

[0039] In this step, a global context-aware vector is constructed by hierarchical segmentation, hierarchical encoding, and hierarchical attention fusion to solve the problem of context fragmentation and provide complete semantic association information for subsequent translation.

[0040] Step S120: Match the professional domain with the terminology set based on the global context-aware vector, and obtain the domain-aware context vector; To address the issue of domain adaptability, this paper proposes a method that uses global context-aware vector-based domain classification, multi-domain terminology matching, and professional domain adaptive enhancement to solve the problem of inconsistent translation of professional terms and low accuracy in domain translation.

[0041] Among them, such as Figure 3 As shown, step S120 includes the following sub-steps: Step S121: Determine the professional field to which the long English text belongs and the field confidence of the professional field based on the global context-aware vector; Employing a domain classifier based on global context-aware vectors Calculate long English texts Compare the domain confidence scores with the domain confidence scores of each domain in the pre-defined domain set in the domain classifier, and select the domain with the highest domain confidence score as the long English text. The system identifies the domain of the text and outputs the domain name and its domain confidence score, thereby enabling the analysis of long English texts. Accurate identification of the relevant professional field. The domain classifier can be implemented using a fully connected layer and a Softmax activation function. This first uses a fully connected layer to process the global context-aware vector. Project the data into the domain feature space, and then use the Softmax activation function to calculate the domain confidence score for each domain.

[0042] The pre-defined set of professional domains in the domain classifier is ,in, As the first professional field, As the second professional field, For the first Each professional field For the first These are professional fields, such as medicine, law, and computer science. This represents the total number of professional fields.

[0043] Furthermore, the formula for calculating the domain confidence is as follows: ; Among them, used for Representing long English text The professional field to which it belongs For the first Domain confidence level for each professional field, and ; For the first Learnable weight vectors for each professional domain are used to measure the global context-aware vector. With professional fields The degree of matching, for transpose; For the first Bias terms for each professional field are used to adjust the baseline confidence level for that professional field.

[0044] Step S122: Determine the terminology set of the long English text based on the professional field to which it belongs, and calculate the terminology fusion vector of all terms in the terminology set;

[0045] Pre-built multi-domain terminology database ,in, For professional fields The corresponding set of terms, For professional fields The corresponding set of terms, For professional fields The corresponding set of terms, For professional fields The corresponding term set, and each term in each term set corresponds to a pre-trained term vector. Term vector Dimensions and global context-aware vectors The dimensions are unified to achieve vectorized representation of professional terms.

[0046] Based on long English texts The professional field From a pre-built multi-domain terminology database China has determined this professional field. Corresponding terminology set and based on the terminology set Calculate the term vector corresponding to each term in the long English text. The terminology fusion vector is used to achieve semantic fusion of professional terms.

[0047] The formula for calculating the term fusion vector is as follows: ; in, For long English texts The term fusion vector is used for Represents a definite set of terms. For a defined set of terms The number of terms in For a set of terms The Middle The term vector corresponding to each term.

[0048] Step S123: Combine the domain confidence and term fusion vector to perform professional domain adaptive enhancement on the global context-aware vector to obtain the domain-aware context vector; Combined with long English texts Domain confidence level of the relevant professional field With long English texts Terminology Fusion Vector global context-aware vector Perform domain-specific adaptive enhancement to obtain domain-aware context vectors. .

[0049] Furthermore, the formula for calculating the domain-aware context vector is as follows: ; in, For long English texts Domain-aware context vectors; For professional fields The terminology enhancement coefficient can be adaptively learned through model training to control the degree of influence of terms from different domains on the context vector, thereby achieving differentiated adaptation across different domains.

[0050] Step S130: Generate an enhanced global context vector based on the domain-aware context vector; To address the issue of insufficient long-range semantic capture capabilities, a domain-aware context vector-based approach is proposed. It adopts a sliding window + cross-window attention mechanism to break through the computational resource and structural limitations of traditional translation models, efficiently capture long-distance semantic relationships across paragraphs and pages, and solve the problem of long texts "forgetting" key information from the preceding text.

[0051] Among them, such as Figure 4 As shown, step S130 includes the following sub-steps: Step S131: Divide the segment sequence of the long English text into sliding window segments; Long English texts segment sequence By fixed window size ( ) and step size ( To ensure window overlap, the window set is divided into multiple overlapping windows. , For the segment sequence of the first window, For the segment sequence of the second window, For the first A sequence of segments in a window. For the first A sequence of segments in a window. The total number of windows, , This is for rounding up.

[0052] in, , For the first The starting paragraph of a window's segment sequence. For the first The second paragraph of the segment sequence of the window. For the first The end paragraph of the segment sequence of each window, through Determine the end paragraph of the window, ensuring that the paragraph sequence within the window does not exceed the length of the English text. Total number of paragraphs To enable long English text The block-based processing maintains the semantic relationships between windows.

[0053] Step S132: Encode the segment sequence of each window to obtain the window semantic vector, and calculate the attention weight of each window based on the window semantic vector and the domain-aware context vector; A lightweight Transformer model (2 layers) is used for the segment sequence of each window. segment vector Encoding yields the window semantic vector This enables semantic aggregation within each window, generating a window-level global semantic representation, which provides the foundation for subsequent cross-window attention computation. The translation model has a built-in cross-window attention network model, based on the window semantic vectors. Domain-aware context vectors Calculate the first Attention weights are assigned to each window to capture semantic relationships across windows.

[0054] Furthermore, the formula for calculating cross-window attention weights is as follows: ; in, For the first The attention weights of each window reflect the degree of semantic association between the current window and the domain-aware context, and , for The transpose of .

[0055] Step S133: Generate an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vectors. semantic vectors for all windows The attention weights of the corresponding windows are fused into a unified long-range semantic fusion vector, which is then combined with the domain-aware context vector. The final output is an enhanced global context vector. This enables the fusion of short-range domain semantics and long-range cross-window semantics.

[0056] Furthermore, the formula for calculating the enhanced global context vector is as follows: ; in For enhanced global context vectors, The fusion coefficients are obtained through adaptive learning during model training. The long-distance semantic fusion vector part uses... As a coefficient, it is used to enhance the contribution of long-distance semantic association across windows. This addresses the problem of insufficient long-range semantic capture capability in traditional models, achieving a reasonable balance between short-range domain semantics and long-range cross-window semantics.

[0057] Step S140: Generate translation results for long English texts by combining enhanced global context vectors with user text style preference vectors for personalized style adaptive translation; To address the lack of personalization and interactivity, an enhanced global context vector is used. By combining user style preferences and text style characteristics, the translation style can be adaptively adjusted, solving the problem of rigid translation output and meeting users' needs for different styles of translation.

[0058] Among them, such as Figure 5 As shown, step S140 includes the following sub-steps: Step S141: Extract text style feature vectors based on enhanced global context vectors; A predefined set of text styles , For the first text style, For the second text style, For the first A text style, For the first Text styles, such as: formal, colloquial, literary, and technical. Let be the total number of text styles, and let each text style correspond to a pre-trained style template vector. , .

[0059] Employing a text style feature extractor based on enhanced global context vectors Text style feature vectors were extracted. , Calculate text style feature vectors With each style template vector Based on the similarity (e.g., cosine similarity), select the style template vector with the highest similarity. As a long English text The text style it belongs to, thus enabling the processing of long English texts. Accurate extraction of its own text style.

[0060] Furthermore, the formula for extracting text style feature vectors is as follows: ; in, This is a text style feature vector; Learnable parameters extracted for text style. The bias term extracted for text style.

[0061] Step S142: Combine the text style feature vector with the user text style preference vector to obtain the text style fusion vector; Receive user text style preference input (e.g., user specifies "formalized translation"), and generate a user text style preference vector. Vector of user text style preferences Text style feature vector Fusion, generating text style fusion vectors This aims to integrate the text's own style with the user's preferred style, taking into account both the original style of the text and the user's personalized needs.

[0062] The formula for calculating the text style fusion vector is as follows: ; in, Vector fusion for text style When specifying text style for user preference coefficients Smaller values ​​(e.g., 0.2) are used to reinforce the dominant role of user preferences when no text style is specified. A value of 1 fully preserves the text's original style.

[0063] Step S143: Encode the enhanced global context vector into an encoder feature vector, and use the encoder feature vector, text style fusion vector and the decoder's own sequence concatenation and dimension adjustment as the decoder input to generate the translation result of the long English text; The encoder can employ a Transformer model with residual connections (3 layers), using the encoder to process the enhanced global context vector obtained from the previous text. (A full-dimensional feature vector integrating global semantics, domain-specific features, and long-distance semantic relationships across paragraphs of long English texts, covering all core information of long English texts except for "style") is used for global semantic encoding, outputting the encoder feature vector. The translator decoder is an improved Transformer decoder, extending its functionality. It not only includes the core layers of the Transformer decoder (masked self-attention, cross-attention, and feedforward network) but also adds an input feature fusion module. This module integrates the encoder feature vectors... Text style fusion vector and the corresponding layer's own sequence of the Transformer decoder The layers are stitched together and their dimensions are adjusted (layer normalization / linear projection) to serve as input to the corresponding layers of the Transformer decoder. This allows the input to the Transformer decoder to incorporate information from multiple sources, ultimately generating long English text through the Transformer decoder's self-attention and cross-attention layers. The translation results.

[0064] Furthermore, the formulas for splicing and dimension adjustment are as follows: ; in, For the concatenated and dimension-adjusted Transformer decoder, the first... Layer input; For vector concatenation operations, the high-dimensional concatenated vectors are first mapped to a different dimension using linear projection. Then, by normalizing the vector distribution through layer normalization, the dimension matching and numerical stability of the Transformer decoder input are ensured. For the Transformer decoder The layer's own sequence; This is the encoder feature vector.

[0065] Example 2 like Figure 6 As shown, this application provides a context-aware adaptive translation optimization system 600 for long English texts, including: a feature extraction and fusion module 610, a domain terminology matching and enhancement module 620, a context vector enhancement module 630, and a personalized style adaptive translation module 640.

[0066] The feature extraction and fusion module 610 performs multi-granularity context feature vector extraction and attention mechanism fusion on long English texts to obtain a global context-aware vector.

[0067] To address the issue of contextual fragmentation, the feature extraction and fusion module 610 divides and encodes long English texts at multiple levels, including words, sentences, paragraphs, and passages. Then, it combines word vectors, sentence vectors, paragraph vectors, and passage vectors with an attention mechanism to construct a semantically related global context-aware vector, thereby solving the problem of semantic disconnect between sentences and paragraphs from the bottom up.

[0068] The feature extraction and fusion module 610 includes: a text level division submodule 611, a layer-by-layer encoding submodule 612, and a multi-level vector fusion submodule 613.

[0069] The text hierarchy submodule 611 divides long English texts layer by layer to obtain word sequences, sentence sequences, and paragraph sequences.

[0070] Text hierarchy segmentation submodule 611 divides the long English text according to natural semantic boundaries. By dividing the text layer by layer, we obtain word sequences, sentence sequences, and paragraph sequences, with the word sequences containing long English texts. All the words and sentence sequences contained in the long English text All sentences in the sequence of paragraphs contain long English text. All paragraphs in.

[0071] Word sequence: , For long English texts The first word in the text, For long English texts The second word in the text, For long English texts The first in One word, For long English texts The first in One word, For long English texts Total number of words.

[0072] Sentence sequence: , For long English texts The first sentence in the text, For long English texts The second sentence in the text, For long English texts The first in One sentence. For long English texts The first in One sentence. For long English texts The total number of sentences; among them, , For the first The first word of the sentence, For the first The second word of the sentence. For the first The first sentence One word, For the first The number of words in each sentence.

[0073] Segment sequence: , For long English texts The first paragraph, For long English texts The second paragraph, For long English texts The first in One paragraph, For long English texts The first in One paragraph, For long English texts The total number of paragraphs; among which, , For the first The first sentence of the paragraph, For the first The second sentence of the paragraph, For the first The first paragraph One sentence. For the first The number of sentences in each paragraph.

[0074] The layer-by-layer encoding submodule 612 encodes word sequences, sentence sequences, paragraph sequences, and long English texts layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and text vectors.

[0075] The layer-by-layer encoding submodule 612 employs a pre-trained word embedding model to sequentially map discrete words in the word sequence into continuous low-dimensional word vectors; among which, ; For pre-trained word embedding models, BERT-based pre-trained language models can be used; For the first Word vectors of words, , The dimension space representing the vector, Word vectors Dimensions.

[0076] The layer-by-layer encoding submodule 612 employs a sentence-level encoding model, sequentially encoding each sentence in the sentence sequence into a sentence vector. That is, taking the word sequence of a sentence as input, it encodes the semantic relationships between words in the sentence's word sequence and outputs the sentence vector; where... ; For sentence-level coding model, Either a Bi-LSTM model or a Transformer model can be used. If a Bi-LSTM model is used, the bidirectional hidden layer outputs of the Bi-LSTM model are concatenated as the sentence vector. If the Transformer model is used, the overall semantic vector of the sentence after being encoded by the Transformer model is extracted as the sentence vector; For the first The sentence vector of each sentence. , Sentence vector Dimensions.

[0077] The layer-by-layer encoding submodule 612 adopts a segment-level encoding model, sequentially encoding each segment in the segment sequence into a segment vector. That is, taking the sentence sequence of a segment as input, it encodes the semantic relationships between sentences in the sentence sequence of the segment and outputs the segment vector of the segment; where, ; It is a segment-level coding model. A lightweight Transformer model (2 layers) can be used to capture the semantic relationships between sentences that are naturally defined by the boundaries of the sentence sequence of a paragraph; For the first The segment vector of each paragraph. , segment vector The dimension can make This simplifies dimension matching. The lightweight Transformer model (2 layers) refers to a simplified Transformer encoder structure containing only two encoding layers.

[0078] Layer-by-layer coding submodule 612 employs a document-level coding model to process long English texts. All segment sequences are encoded as document vectors, i.e., based on long English texts. Taking all segment sequences as input, the algorithm encodes the global semantic logical relationships between all segment sequences, and outputs a document vector; where... ; For document-level coding models, A Transformer model with residual connections (3 layers) can be used to capture long-distance semantic relationships across paragraphs; For long English texts The text vector, , For document vectors The dimension can make This further simplifies dimension matching and allows for seamless fusion of semantic vectors at different levels through dimension standardization. This ensures both mathematical rationality and computational efficiency, as well as ease of engineering implementation. The Transformer model with residual connections (3 layers) refers to a Transformer encoder structure consisting of three encoding layers, with residual connections integrated into the core module of each layer.

[0079] The multi-level vector fusion submodule 613 fuses multi-level word vectors, sentence vectors, paragraph vectors and passage vectors using an attention mechanism to obtain a global context-aware vector.

[0080] The multi-level vector fusion submodule 613 adopts a multi-level attention network model to assign relevance weights to context feature vectors such as word vectors, sentence vectors, paragraph vectors and passage vectors. After matching word vectors, sentence vectors, paragraph vectors and passage vectors with the corresponding relevance weights, attention mechanism is used to fuse them to obtain global context-aware vectors.

[0081] The multi-level attention network model unifies the dimensions of all word vectors, sentence vectors, paragraph vectors, and passage vectors through its linear layers, and then aggregates all the dimension-unified feature vectors to form a multi-granularity context feature vector set; ; It is a set of multi-granularity context feature vectors; This is the first feature vector after dimension unification. This is the second feature vector after dimensional unification. For the first dimension after unification 1 eigenvector For the first dimension after unification 1 eigenvector; , For the subsequently calculated global context-aware vector The dimension can make All subsequent feature vectors, including term vectors, style template vectors, user style preference vectors, and text style feature vectors, will have a unified dimension of [dimensional value missing]. This ensures the mathematical rationality and dimensional matching of vector operations, thereby not only simplifying calculations, guaranteeing the rationality of algorithms, and reducing the cost of engineering implementation, but also forming a complete dimensional unification system. The total number of feature vectors after dimension unification. .

[0082] Multi-level attention network models compute multi-granularity contextual feature vector sets. Each feature vector in the long English text The attention score is then normalized to obtain the relevance weights of the feature vector. For example, multi-level attention network models can use additive attention (Bahdanau Attention) to calculate the attention score.

[0083] Furthermore, the formula for calculating the attention score is as follows: ; in, For the first eigenvectors Attention score; For attention weight vectors, for transpose; , All of these are attention-learnable parameters; for For long English texts The global representation vector can be derived from the document vector. Directly serving as, or composed of, all eigenvectors Aggregation yields; This is a bias term.

[0084] Furthermore, the formula for calculating the relevance weight is as follows: ; in, For the first eigenvectors The relevance weights reflect the long English text With feature vectors of different granularities Contextual relevance, ; It is an exponential function.

[0085] Then, the multi-level attention network model processes the multi-granularity context feature vector set. The global context-aware vector is obtained by weighted summation of all feature vectors and their corresponding relevance weights.

[0086] Furthermore, the formula for calculating the global context-aware vector is as follows: ; in, For global context-aware vectors, For long English texts Its unique characteristic is characterized by.

[0087] In this step, a global context-aware vector is constructed by hierarchical segmentation, hierarchical encoding, and hierarchical attention fusion to solve the problem of context fragmentation and provide complete semantic association information for subsequent translation.

[0088] The domain terminology matching and enhancement module 620 performs domain-specific matching with terminology sets based on the global context-aware vector and obtains the domain-aware context vector.

[0089] To address the issue of domain adaptability, the domain terminology matching and enhancement module 620 solves the problem of inconsistent translation of professional terms and low accuracy of domain translation by using domain classification based on global context-aware vectors, multi-domain terminology database matching, and professional domain adaptive enhancement.

[0090] The domain terminology matching and enhancement module 620 includes: a domain matching submodule 621, a terminology set matching submodule 622, and an adaptive enhancement submodule 623.

[0091] The domain matching submodule 621 determines the domain of the long English text and the domain confidence of the domain based on the global context-aware vector.

[0092] Domain matching submodule 621 employs a domain classifier, based on global context-aware vectors. Calculate long English texts Compare the domain confidence scores with the domain confidence scores of each domain in the pre-defined domain set in the domain classifier, and select the domain with the highest domain confidence score as the long English text. The system identifies the domain of the text and outputs the domain name and its domain confidence score, thereby enabling the analysis of long English texts. Accurate identification of the relevant professional field. The domain classifier can be implemented using a fully connected layer and a Softmax activation function. This first uses a fully connected layer to process the global context-aware vector. Project the data into the domain feature space, and then use the Softmax activation function to calculate the domain confidence score for each domain.

[0093] The pre-defined set of professional domains in the domain classifier is ,in, As the first professional field, As the second professional field, For the first Each professional field For the first These are professional fields, such as medicine, law, and computer science. This represents the total number of professional fields.

[0094] Furthermore, the formula for calculating the domain confidence is as follows: ; Among them, used for Representing long English text The professional field to which it belongs For the first Domain confidence level for each professional field, and ; For the first Learnable weight vectors for each professional domain are used to measure the global context-aware vector. With professional fields The degree of matching, for transpose; For the first Bias terms for each professional field are used to adjust the baseline confidence level for that professional field.

[0095] The terminology set matching submodule 622 determines the terminology set of the long English text based on the professional field to which the long English text belongs and calculates the terminology fusion vector of all terms in the terminology set.

[0096] Pre-built multi-domain terminology database ,in, For professional fields The corresponding set of terms, For professional fields The corresponding set of terms, For professional fields The corresponding set of terms, For professional fields The corresponding term set, and each term in each term set corresponds to a pre-trained term vector. Term vector Dimensions and global context-aware vectors The dimensions are unified to achieve vectorized representation of professional terms.

[0097] Term set matching submodule 622 based on long English text The professional field From a pre-built multi-domain terminology database China has determined this professional field. Corresponding terminology set and based on the terminology set Calculate the term vector corresponding to each term in the long English text. The terminology fusion vector is used to achieve semantic fusion of professional terms.

[0098] The formula for calculating the term fusion vector is as follows: ; in, For long English texts The term fusion vector is used for Represents a definite set of terms. For a defined set of terms The number of terms in For a set of terms The Middle The term vector corresponding to each term.

[0099] The adaptive enhancement submodule 623 combines domain confidence and terminology fusion vector to perform professional domain adaptive enhancement on the global context-aware vector, resulting in a domain-aware context vector.

[0100] Adaptive Enhancement Submodule 623 Combines with Long English Text Domain confidence level of the relevant professional field With long English texts Terminology Fusion Vector global context-aware vector Perform domain-specific adaptive enhancement to obtain domain-aware context vectors. .

[0101] Furthermore, the formula for calculating the domain-aware context vector is as follows: ; in, For long English texts Domain-aware context vectors; For professional fields The terminology enhancement coefficient can be adaptively learned through model training to control the degree of influence of terms from different domains on the context vector, thereby achieving differentiated adaptation across different domains.

[0102] The context vector enhancement module 630 generates enhanced global context vectors based on domain-aware context vectors.

[0103] To address the issue of insufficient long-range semantic capture capabilities, the context vector enhancement module 630 is based on domain-aware context vectors. It adopts a sliding window + cross-window attention mechanism to break through the computational resource and structural limitations of traditional translation models, efficiently capture long-distance semantic relationships across paragraphs and pages, and solve the problem of long texts "forgetting" key information from the preceding text.

[0104] The context vector enhancement module 630 includes: a sliding window partitioning submodule 631, an encoding and weight calculation submodule 632, and a long-distance semantic fusion module 633.

[0105] The sliding window partitioning submodule 631 performs sliding window partitioning on the segment sequence of long English texts.

[0106] Sliding window divides the submodule 631 for long English text segment sequence By fixed window size ( ) and step size ( To ensure window overlap, the window set is divided into multiple overlapping windows. , For the segment sequence of the first window, For the segment sequence of the second window, For the first A sequence of segments in a window. For the first A sequence of segments in a window. The total number of windows, , This is for rounding up.

[0107] in, , For the first The starting paragraph of a window's segment sequence. For the first The second paragraph of the segment sequence of the window. For the first The end paragraph of the segment sequence of each window, through Determine the end paragraph of the window, ensuring that the paragraph sequence within the window does not exceed the length of the English text. Total number of paragraphs To enable long English text The block-based processing maintains the semantic relationships between windows.

[0108] The encoding and weight calculation submodule 632 encodes the segment sequence of each window to obtain the window semantic vector, and calculates the attention weight of each window based on the window semantic vector and the domain-aware context vector.

[0109] The encoding and weight calculation submodule 632 uses a lightweight Transformer model (2 layers) to process the segment sequence of each window. segment vector Encoding yields the window semantic vector This enables semantic aggregation within each window, generating a window-level global semantic representation, which provides the foundation for subsequent cross-window attention computation. The translation model has a built-in cross-window attention network model, based on the window semantic vectors. Domain-aware context vectors Calculate the first Attention weights are assigned to each window to capture semantic relationships across windows.

[0110] Furthermore, the formula for calculating cross-window attention weights is as follows: ; in, For the first The attention weights of each window reflect the degree of semantic association between the current window and the domain-aware context, and , for The transpose of .

[0111] The long-distance semantic fusion module 633 generates an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vector.

[0112] The long-range semantic fusion module 633 performs semantic vector analysis on all windows. The attention weights of the corresponding windows are fused into a unified long-range semantic fusion vector, which is then combined with the domain-aware context vector. The final output is an enhanced global context vector. This enables the fusion of short-range domain semantics and long-range cross-window semantics.

[0113] Furthermore, the formula for calculating the enhanced global context vector is as follows: ; in For enhanced global context vectors, The fusion coefficients are obtained through adaptive learning during model training. The long-distance semantic fusion vector part uses... As a coefficient, it is used to enhance the contribution of long-distance semantic association across windows. This addresses the problem of insufficient long-range semantic capture capability in traditional models, achieving a reasonable balance between short-range domain semantics and long-range cross-window semantics.

[0114] The Personalized Style Adaptive Translation Module 640 generates translations of long English texts by combining an enhanced global context vector with a user's text style preference vector.

[0115] To address the lack of personalization and interactivity, the personalized style adaptive translation module 640 is based on enhanced global context vectors. By combining user style preferences and text style characteristics, the translation style can be adaptively adjusted, solving the problem of rigid translation output and meeting users' needs for different styles of translation.

[0116] The personalized style adaptive translation module 640 includes: a text style extraction submodule 641, a text style fusion submodule 642, and an encoding splicing adjustment generation submodule 643.

[0117] The text style extraction submodule 641 extracts text style feature vectors based on enhanced global context vectors.

[0118] A predefined set of text styles , For the first text style, For the second text style, For the first A text style, For the first Text styles, such as: formal, colloquial, literary, and technical. Let be the total number of text styles, and let each text style correspond to a pre-trained style template vector. , .

[0119] The text style extraction submodule 641 employs a text style feature extractor based on enhanced global context vectors. Text style feature vectors were extracted. , Calculate text style feature vectors With each style template vector Based on the similarity (e.g., cosine similarity), select the style template vector with the highest similarity. As a long English text The text style it belongs to, thus enabling the processing of long English texts. Accurate extraction of its own text style.

[0120] Furthermore, the formula for extracting text style feature vectors is as follows: ; in, This is a text style feature vector; Learnable parameters extracted for text style. The bias term extracted for text style.

[0121] The text style fusion submodule 642 fuses the text style feature vector with the user's text style preference vector to obtain the text style fusion vector.

[0122] The text style fusion submodule 642 receives the user's text style preference input (e.g., the user specifies "formalized translation") and generates a vector of the user's text style preferences. Vector of user text style preferences Text style feature vector Fusion, generating text style fusion vectors This aims to integrate the text's own style with the user's preferred style, taking into account both the original style of the text and the user's personalized needs.

[0123] The formula for calculating the text style fusion vector is as follows: ; in, Vector fusion for text style When specifying text style for user preference coefficients Smaller values ​​(e.g., 0.2) are used to reinforce the dominant role of user preferences when no text style is specified. A value of 1 fully preserves the text's original style.

[0124] The encoding, splicing, adjustment, and generation submodule 643 encodes the enhanced global context vector into an encoder feature vector through its encoder. It then uses the encoder feature vector, the text style fusion vector, and the decoder's own sequence splicing and dimensional adjustment as the decoder input to generate the translation result of the long English text.

[0125] The encoding, concatenation, adjustment, and generation submodule 643 includes a decoder and a translation encoder. The encoder is the pre-semantic encoding unit of the encoding, concatenation, adjustment, and generation submodule 643. The encoder can employ a Transformer model (3 layers) with residual connections to process the enhanced global context vector obtained from the previous processing. (A full-dimensional feature vector integrating global semantics, domain-specific features, and long-distance semantic relationships across paragraphs of long English texts, covering all core information of long English texts except for "style") is used for global semantic encoding, outputting the encoder feature vector. The translation decoder is the core execution unit of the encoding, concatenation, adjustment, and generation submodule 643. It is an improved Transformer decoder, extending its functionality. It not only includes the core layers of the Transformer decoder (mask self-attention, cross-attention, and feedforward network) but also adds an input feature fusion module. This module integrates the encoder feature vectors... Text style fusion vector and the corresponding layer's own sequence of the Transformer decoder The layers are stitched together and their dimensions are adjusted (layer normalization / linear projection) to serve as the input for the corresponding layer of the ransformer decoder. This allows the input to the Transformer decoder to incorporate information from multiple sources, ultimately generating long English text through the Transformer decoder's self-attention and cross-attention layers. The translation results.

[0126] Furthermore, the formulas for splicing and dimension adjustment are as follows: ; in, For the concatenated and dimension-adjusted Transformer decoder, the first... Layer input; For vector concatenation operations, the high-dimensional concatenated vectors are first mapped to a different dimension using linear projection. Then, by normalizing the vector distribution through layer normalization, the dimension matching and numerical stability of the Transformer decoder input are ensured. For the Transformer decoder The layer's own sequence; This is the encoder feature vector.

[0127] This application constructs a global context-aware vector through multi-granularity hierarchical partitioning and multi-level attention fusion to solve the problem of context fragmentation, ensuring semantic coherence, terminology consistency, and logical clarity in the translation results. Relying on accurate domain identification, professional terminology database matching, and domain feature enhancement, it achieves dynamic adaptation to different professional domains, significantly improving the accuracy of translating long professional texts. Employing a sliding window + cross-window attention mechanism, it overcomes model limitations, efficiently captures long-distance semantic connections, and solves the problem of "forgotten" preceding information. By integrating the text's own style with user-personalized preferences, it achieves flexible customization of translation styles, solving the problem of rigid output and meeting diverse style requirements.

[0128] Meanwhile, this application simplifies calculations and reduces engineering implementation costs by unifying the feature vector dimension and using efficient models for each module, balancing translation quality and operational efficiency. It is applicable to the translation of various long English texts, including academic, technical, legal, and literary texts, and has strong practical application and engineering feasibility.

[0129] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0130] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A context-aware adaptive translation optimization method for long English texts, characterized in that, Includes the following steps: Step S110: Extract multi-granularity contextual feature vectors and fuse them with an attention mechanism for long English texts to obtain a global context-aware vector; Step S120: Match the professional domain with the terminology set based on the global context-aware vector, and obtain the domain-aware context vector; Step S130: Generate an enhanced global context vector based on the domain-aware context vector; Step S140: Generate translation results for long English texts by combining enhanced global context vectors with user text style preference vectors for personalized style adaptive translation.

2. The context-aware adaptive translation optimization method for long English texts according to claim 1, characterized in that, Step S110 includes the following sub-steps: Step S111: Divide the long English text layer by layer to obtain word sequence, sentence sequence, and paragraph sequence; Step S112: Encode the word sequence, sentence sequence, paragraph sequence, and long English text layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and text vectors; Step S113: Attention mechanism is used to fuse the multi-level word vectors, sentence vectors, paragraph vectors and passage vectors to obtain the global context-aware vector.

3. The context-aware adaptive translation optimization method for long English texts according to claim 1 or 2, characterized in that, Step S120 includes the following sub-steps: Step S121: Determine the professional field to which the long English text belongs and the field confidence of the professional field based on the global context-aware vector; Step S122: Determine the terminology set of the long English text based on the professional field to which it belongs, and calculate the terminology fusion vector of all terms in the terminology set; Step S123: Combine the domain confidence and terminology fusion vector to perform professional domain adaptive enhancement on the global context-aware vector to obtain the domain-aware context vector.

4. The context-aware adaptive translation optimization method for long English texts according to claim 2, characterized in that, Step S130 includes the following sub-steps: Step S131: Divide the segment sequence of the long English text into sliding window segments; Step S132: Encode the segment sequence of each window to obtain the window semantic vector, and calculate the attention weight of each window based on the window semantic vector and the domain-aware context vector; Step S133: Generate an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vectors.

5. The context-aware adaptive translation optimization method for long English texts according to claim 1 or 2, characterized in that, Step S140 includes the following sub-steps: Step S141: Extract text style feature vectors based on enhanced global context vectors; Step S142: Combine the text style feature vector with the user text style preference vector to obtain the text style fusion vector; Step S143: Encode the enhanced global context vector into an encoder feature vector, and use the encoder feature vector, text style fusion vector and decoder self-sequence concatenation and dimension adjustment as decoder input to generate the translation result of long English text.

6. A context-aware adaptive translation optimization system for long English texts, characterized in that, include: The module includes a feature extraction and fusion module, a domain terminology matching and enhancement module, a context vector enhancement module, and a personalized style adaptive translation module. Among them, the feature extraction and fusion module extracts multi-granularity contextual feature vectors from long English texts and fuses them using an attention mechanism to obtain a global context-aware vector; The domain terminology matching and enhancement module matches the professional domain with the terminology set based on the global context-aware vector and obtains the domain-aware context vector; The context vector enhancement module generates enhanced global context vectors based on domain-aware context vectors; The personalized style adaptive translation module uses an enhanced global context vector combined with a user's text style preference vector to generate translations of long English texts.

7. The context-aware adaptive translation optimization system for long English texts according to claim 6, characterized in that, The feature extraction and fusion module includes: a text hierarchy segmentation submodule, a layer-by-layer encoding submodule, and a multi-level vector fusion submodule; Among them, the text hierarchy segmentation submodule divides long English texts layer by layer to obtain word sequences, sentence sequences, and paragraph sequences; The layer-by-layer encoding submodule encodes word sequences, sentence sequences, paragraph sequences, and long English texts layer by layer to obtain word vectors, sentence vectors, paragraph vectors, and text vectors; The multi-level vector fusion submodule fuses word vectors, sentence vectors, paragraph vectors, and passage vectors at multiple levels using an attention mechanism to obtain a global context-aware vector.

8. The context-aware adaptive translation optimization system for long English texts according to claim 6 or 7, characterized in that, The domain terminology matching and enhancement module includes: a domain matching submodule, a terminology set matching submodule, and an adaptive enhancement submodule; Among them, the domain matching submodule determines the professional domain to which the long English text belongs and the domain confidence of the professional domain based on the global context-aware vector; The terminology set matching submodule determines the terminology set of the long English text based on the professional field to which the long English text belongs and calculates the terminology fusion vector of all terms in the terminology set; The adaptive enhancement submodule combines domain confidence and terminology fusion vector to perform professional domain adaptive enhancement on the global context-aware vector, resulting in a domain-aware context vector.

9. The context-aware adaptive translation optimization system for long English texts according to claim 7, characterized in that, The context vector enhancement module includes: a sliding window partitioning submodule, an encoding and weight calculation submodule, and a long-distance semantic fusion module; The sliding window partitioning submodule performs sliding window partitioning on the segment sequence of long English texts. The encoding and weight calculation submodule encodes the segment sequence of each window to obtain the window semantic vector, and calculates the attention weight of each window based on the window semantic vector and the domain-aware context vector. The long-range semantic fusion module generates an enhanced global context vector based on the semantic vectors of all windows, the attention weights of the corresponding windows, and the domain-aware context vector.

10. The context-aware adaptive translation optimization system for long English texts according to claim 6 or 7, characterized in that, The personalized style adaptive translation module includes: a text style extraction submodule, a text style fusion submodule, and an encoding splicing adjustment generation submodule; Among them, the text style extraction submodule extracts text style feature vectors based on the enhanced global context vector; The text style fusion submodule combines the text style feature vector with the user's text style preference vector to obtain the text style fusion vector; The encoding, splicing, adjustment, and generation submodule encodes the enhanced global context vector into an encoder feature vector through its encoder. It then uses the encoder feature vector, the text style fusion vector, and the decoder's own sequence splicing and dimensional adjustment as input to the decoder, thereby generating the translation result of the long English text.