A shading framework system based on contextual connection
By using context connection means to mask the model framework system in the chapter-level neural machine translation model, masking processes the input and predicts masked words, which solves the problem of difficulty in using context information in the existing technology and significantly improves translation quality and consistency.
Patent Information
- Application Number
- CN202210071846.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-01-21
AI Technical Summary
Existing chapter-level neural machine translation models are difficult to fully utilize contextual information, resulting in poor translation quality. This is mainly because existing methods are implicit and passive and cannot effectively capture inter-sentence relationships.
This paper proposes a masking model framework system based on context connection means. It processes source language input and right-shifted target language input through masking, uses encoders and decoders to generate sentence representations, and trains the model by predicting masked words and target sentence loss functions, so that The model actively explores contextual information.
It significantly improves the model's efficiency in using contextual information and translation quality, can better capture inter-sentence relationships, and improves the consistency and cohesion of translation.
Smart Images

Figure CN114492317B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a context-cohesion-based masking framework system for improving the understanding of context by a paragraph-level neural machine translation model. Background Art
[0002] Machine translation (MT) is the process of automatically translating between natural languages with the help of computers. On the Internet, machine translation has been greatly developed. Statistical machine translation (SMT) and the more advanced neural machine translation (NMT) system have emerged.
[0003] However, machine translation is mainly based on strong independence and locality assumptions, that is, translating sentences independently while ignoring document-level interdependencies. Ignoring the interrelationships between discourse elements, which consist of juxtapositions and structured groups of sentences that hold together complex linguistic elements, results in translations that appear to be good but actually lack key properties of the text. For example, ignoring document context in translation hinders the transfer of intended meaning. For decades, pioneers of machine translation have advocated the use of context in the translation process. Due to the limitations of statistical machine translation and the concerns of the machine translation community about its computational efficiency and tractability, including document context in statistical machine translation has not produced significant improvements. With the improvement of computing power and the widespread application of neural networks in machine translation, discourse-level neural machine translation, which aims to consider inter-sentence dependencies, has received increasing attention.
[0004] Although the translations produced by the paragraph-level translation model are more consistent and cohesive than those produced by the sentence-level translation model, they are still not satisfactory. The reason for this problem is that the existing modeling methods are implicit and passive. They believe that the model can learn how to capture the relationship between sentences through data by itself. However, since the paragraph-level bilingual corpus is very limited compared to the sentence-level bilingual corpus, and the chapter-related information in a chapter is often very scarce, it is actually difficult for the model to learn how to solve the problem of paragraph phenomena only through data. For example, for a given document d, its source language sentence set is X = {x 1 , x 2 , ..., x |d|}, and translate these source language sentences into corresponding target language sentences Y = {y 1 ,y 2 , ..., y |d|}. Assuming that the translation is generated from left to right, the probability of document translation can be obtained using the chain method:
[0005]
[0006] Among them, x jrepresents the jth source language sentence, y j represents the jth target sentence, Y <j Indicates the target context, X -j Represents the source language side context;
[0007] Most of the existing paragraph-level neural machine translation models are dedicated to modeling the dependencies between sentences in a paragraph. According to the modeling methods, they are divided into two categories: one is the single encoder method, which fuses the context information by concatenating the context with the current sentence as input. For sentences that are too long, it is difficult for a single encoder to extract useful information, resulting in the omission of important information; the other is the multi-encoder method, which uses an additional context encoder to encode the context sentence separately, and finally uses the attention mechanism to fuse the context information into the translation process of the current sentence. Important context information may be omitted, resulting in low efficiency in the use of context. Therefore, both the multi-encoder and single-encoder methods have a common problem, that is, they cannot fully utilize the context information.
[0008] In addition to the two mainstream methods mentioned above, there are some other methods to model context information. The two-edit method hopes to use context information to perform a second edit on the text translated by the sentence-level machine translation model, thereby solving the chapter phenomenon problem that plagues sentence-level translation. Another method constructs the chapter into an undirected graph and uses a graph convolutional network to model the dependency information between contexts.
[0009] According to the source of context, existing modeling methods can be divided into three categories:
[0010] (1) The modeling method that only considers the context of the source language side has the following probability equation:
[0011]
[0012] Among them, X j±k represents the k sentences around the jth source language sentence and regards them as the context.
[0013] (2) The modeling method that only considers the context of the target end has the following probability equation:
[0014]
[0015] Among them, Y j-k represents the k sentences before the jth target sentence. Because of the autoregressive nature of language, it is impossible to see sentences that have not yet been generated, so only the sentences before the target sentence can be used as the target-side context.
[0016] (3) The modeling method that considers the context of both the source language end and the target end at the same time, its probability equation can be regarded as a fusion of the above two types, and its form is as follows:
[0017] Summary of the invention
[0018] The present invention aims to propose a shielding framework system based on contextual connection means, thereby realizing a shielding model framework system that can improve the efficiency of the model in using contextual information.
[0019] The present invention is achieved by adopting the following technical solutions:
[0020] A contextual cohesion masking model framework system, the framework system includes an input, an encoder and a decoder, a model loss function, a predictor, and a cohesion masking strategy; wherein:
[0021] The input includes two parts, namely, a masked source language input and a right-shifted target language input; the masked source language input is input to the encoder, and the encoder encodes the source language sentence to obtain a source language sentence representation H x The right-shifted target language sentence is input into the decoder, which includes the target language context sentence and the target language current sentence. The decoder generates the sentence representation of the target language sentence according to the source language sentence representation generated by the encoder and the right-shifted target language sentence decoding H y ;
[0022] The model loss function is a loss function for predicting masked words and a loss function for predicting target sentences; wherein:
[0023] Predict the masked word loss function: Based on the source language sentence H generated by the encoder x , use the source language word vector table to map it to the source language word table space, and then use the Softmax operation to calculate the generation probability of each word in the word table; use cross entropy to calculate the loss of predicting the masked word, the formula is as follows:
[0024]
[0025] Among them, M i represents the i-th word in the masked word set, P(M i |x`,c x ) represents the generation probability of the masked word;
[0026] Predict the target sentence loss function: Use the target language word vector table to map it to the target language word table space, and then use the Softmax operation to calculate the generation probability P(y i |y <i ,x`,c x , c y), use cross entropy to calculate the loss of predicted target sentence, the formula is as follows:
[0027]
[0028] Among them, y <i represents the generation history of the decoder, y i Represents the i-th word of the target sentence y;
[0029] The total loss function is as follows:
[0030] L=L NLL (y|x`,c x , c y )+λL mask (M|x`,c x )
[0031] Where λ represents a hyperparameter used to balance the contribution of the loss of predicting masked words;
[0032] The predictor consists of a linear layer and a Softmax operation. The linear layer predicts the masked token representation and maps it to the vocabulary space, and then performs a Softmax operation to normalize the new token representation. The predictor obtains the predicted probability P(M) of each word in the vocabulary corresponding to each masked word. i |x`,c x ), use the word with the highest prediction probability as the prediction result of the masked word;
[0033] The cohesion means masking strategy masks the words in the current sentence that have a cohesive relationship with the context, and uses the cohesion means masking strategy to process the masked current sentence:
[0034] Given a source language current sentence x and its context c x , and the word position of the cohesive means in the dataset D, for the dataset D, each piece of data e is a parallel sentence pair of the source language and the target language, each end consists of four sentences; the first three sentences are the context of the fourth sentence, and each sentence is used between <sep>To separate;
[0035] The word position in dataset D corresponds to the word position in the current sentence that is related to context c. x A word with a cohesive relationship, where the cohesive relationship includes at least repetition and co-reference; the masking rate r is used to control the proportion of masked information in the current sentence. First, the minimum number of masked words in the current sentence is calculated according to the masking rate r. If the number of word positions in D is greater than or equal to l, the cohesive masking strategy replaces all the words in the corresponding positions in the current sentence of the source language with special symbols. <m>, indicating that it is masked; if the number of words in D is less than l, l-|D| words will be randomly selected from the remaining unmasked words for masking, ensuring that the number of masked words is equal to l; the set of masked words is denoted as M, and the current sentence x after the masking operation is denoted as x`. Finally, x` is compared with c x Using special symbols <sep>Perform splicing as input to the encoder;
[0036] In the process of extracting lexical cohesion means, for the current sentence x in the source language, first traverse each word x in x i , through WordNet, we get x i All synonyms, near synonyms and hyponyms of the word; then traverse all words c in the context sentence x , if c x is x i If it is a synonym, near synonym, or hyponym, then record x i At position i in the current sentence of the source language; finally, a set of word positions is obtained, where each position corresponds to a word in the current sentence, and this word has a lexical cohesion relationship with a word in its context;
[0037] For grammatical cohesion means, CoreNLP tool is used for extraction; the sequence after directly concatenating the context and the current sentence is used to obtain all possible sets of coreference relationships using CoreNLP;
[0038] Finally, the lexical cohesion means word position set and the grammatical cohesion means word position set are merged, and the duplicate positions are removed to obtain the final cohesion means word position dataset D. The cohesion means word masking strategy is masked according to dataset D.
[0039] Compared with the prior art, the present invention can improve the efficiency of the paragraph-level neural machine translation model in understanding context, and can significantly improve the translation quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a system architecture diagram of a context-based connection shielding model framework of the present invention;
[0041] Figure 2 It is an example diagram of the masking strategy based on contextual cohesion means;
[0042] Figure 3 This is a comparison chart of different types of cohesion in Europarl and Opensubtitles. The horizontal axis represents different data sets and the vertical axis represents percentages. DETAILED DESCRIPTION
[0043] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0044] In order to improve the model's efficiency in using context information, the present invention proposes a masking model framework system based on contextual cohesion. The CoCoDM model differs from previous methods in that it masks the text-sensitive words in the current sentence that have a dependent connection with the context, and then lets the model predict these masked words, thereby forcing the model to actively explore the information related to the current sentence in the context.
[0045] like Figure 1 As shown in the figure, a framework system diagram of the present invention based on the contextual cohesion masking model (CoCoDM) is shown. The framework system uses the standard Transformer as its basic framework, including adding the first three sentences to the current sentences on the source language side and the target side, and <sep>) separation. A masking strategy is used in the encoder during training, while the decoder performs a standard translation task to predict the target tag. It should be noted that masking is not used during inference because the model trained using the proposed masking strategy is able to learn how to capture the context of translation. The model includes two parts of input, encoder and decoder. Among them, the two parts of input are divided into two parts: 1. The source language input after masking; 2. The target language input of the right shift. The encoder and decoder of the model are the same as those in the Transformer. The input of the encoder is the masked source language. The source language sentence is encoded by the encoder to obtain the source language sentence representation H x The input of the decoder is the right-shifted target language sentence, which contains the target language context sentence and the target language current sentence; the decoder generates the sentence representation H of the target language sentence based on the source language sentence representation generated by the encoder and the right-shifted target language sentence decoding. y The context sentence and the current sentence are also separated by special symbols. <sep>The concatenation is performed, and the right shift means moving the concatenated sentence one position to the right, thereby ignoring the rightmost word of the concatenated sentence and adding the sentence terminator to the leftmost end of the concatenated sentence. It should be noted that the length of the sentence after the right shift operation is the same as the length of the original sentence. The predictor consists of a linear layer and a Softmax operation. First, through the linear layer, the predictor maps the predicted masked token representation to the vocabulary space, that is, a vector with a dimension equal to the size of the vocabulary, and then performs a Softmax operation to normalize the new token representation to obtain the predicted probability of each word in the vocabulary. The predicted probability of each word in the vocabulary corresponding to each masked word is obtained through the predictor, and the word with the highest predicted probability is used as the prediction result of the masked word, and its probability is P(M i |x`,c x ), then we can calculate L based on these probabilities mask (M|x`,c x ). The main function of the predictor is to predict the encoder input. <m>Masked words, such as Figure 1 X_1, X_3 in . Doing so can help the encoder better capture the relationship between the current sentence X and its context C.
[0046] The masked source language input is composed of the source language context and the masked current sentence. The source language context sentence can be directly obtained from the data set, and the words in the current sentence that have a cohesive relationship with the context are masked, and the masked current sentence is processed using the cohesive means masking strategy. The specific process of the cohesive means masking strategy is as follows:
[0047] Given a source language current sentence x and its context c x , and the word position of the cohesive means in the dataset D. For the dataset D, each piece of data e is a parallel sentence pair of the source language and the target language, and each end consists of four sentences. The first three sentences are the context of the fourth sentence, and each sentence is separated by <sep>To separate.
[0048] The word position in dataset D corresponds to the word position in the current sentence that is related to context c. x A word with a cohesive relationship, such as repetition, co-reference, etc. The masking rate r is used to control the proportion of information masked in the current sentence. First, the minimum number of masked words in the current sentence is calculated based on the masking rate r; if the number of word positions in D is greater than or equal to l, the cohesive masking strategy replaces all words in the corresponding position in the current sentence of the source language with special symbols. <m>, indicating that it is masked. If the number of words in D is less than l, l-|D| words will be randomly selected from the remaining unmasked words to mask, ensuring that the number of masked words is equal to l. The set of masked words is denoted as M, and the current sentence x after the masking operation is denoted as x`. Finally, x` is compared with c x Using special symbols <sep>Concatenate them and use them as the input of the encoder.
[0049] In the data preprocessing operation, we first use the script provided by MOSE to segment and standardize the data. Then we use the BPE algorithm to build a vocabulary. The source language and the target language share a vocabulary with a vocabulary size of 32,000. For the extraction of cohesion means, WordNet is used to extract lexical cohesion means, and CoreNLP is used to extract grammatical cohesion means.
[0050] In the process of extracting lexical cohesion means, for the current sentence x in the source language, first traverse each word x in x i . Through WordNet, we get x i All synonyms, near synonyms and hyponyms of . Then traverse all words c in the context sentence x , if c x is x i If it is a synonym, near synonym, or hyponym, then record x i Position i in the current sentence of the source language. Finally, a set of word positions is obtained, where each position corresponds to a word in the current sentence that has a lexical cohesion relationship with a word in its context.
[0051] For grammatical cohesion means, CoreNLP tools are used for extraction. The sequence after directly concatenating the context and the current sentence is directly used to obtain a set of all possible co-reference relationships using CoreNLP. It should be noted that in the co-reference relationship set, some co-reference relationships may be co-reference relationships within the context or within the current sentence. These co-reference relationships need to be removed because what is needed is the co-reference relationship between the context and the current sentence. Then, from the filtered co-reference relationship set, the position of the word in the current sentence in each co-reference relationship is obtained. These positions constitute the word position set of grammatical cohesion means.
[0052] Finally, the lexical cohesion means word position set is merged with the grammatical cohesion means word position set, and the repeated positions are removed to obtain the final cohesion means word position set D. The cohesion means word masking strategy will be masked according to D.
[0053] The model loss consists of two parts: 1. The loss of predicting masked words; 2. The loss of predicting the target sentence.
[0054] Predict the masked word loss: Based on the source language sentence H generated by the encoder x , use the source language word vector table to map it to the source language word table space, and then use the Softmax operation to calculate the generation probability of each word in the word table. Only need to use cross entropy to calculate the loss of predicting masked words, the formula is as follows:
[0055]
[0056] Among them, M i represents the i-th word in the masked word set, P(M i |x`,c x ) represents the generation probability of the masked word;
[0057] Predict the target sentence loss: Use the target language word vector table to map it to the target language word table space, and then use the Softmax operation to calculate the generation probability P(y i |y <i ,x`,c x , c y ). Use cross entropy to calculate the loss of predicting the target sentence, the formula is as follows:
[0058]
[0059] Among them, y <i represents the generation history of the decoder, y i represents the i-th word of the target sentence y.
[0060] Finally, the loss of predicting the masked word and the loss of predicting the target sentence are combined to obtain the final loss function of the CoCoDM model:
[0061] L=L NLL (y|x`,c x , c y )+λL mask (M|x`,c x )
[0062] Where λ represents a hyperparameter used to balance the contribution of the loss of predicting masked words. Adam is used as the optimizer of the CoCoDM model with a learning rate of 0.0005. The size of the hidden dimension and feedforward layer in the CoCoDM model are set to 512 and 2048 respectively. The encoder and decoder have 6 layers. The dropout rate is 0.3. λ is set to 0.5. The maximum number of words in each batch is 4096. In the inference phase, the BeamSearch algorithm is used with a beam size of 4.
[0063] In addition, a cohesive device masking strategy is designed in the CoCoDM model for document-level NMT, which enables the model to actively capture discourse links between sentences for translation. Furthermore, experiments are conducted on two widely used datasets and a language comparison test set. The results of automatic and linguistic evaluations show that the proposed CoCoDM model can significantly improve translation quality compared to previous state-of-the-art document-level NMT models.
[0064] The effectiveness of the CoCoDM model is tested using two different language pairs of datasets, Europarl (English-German) and Opensubtitles (English-Russian), as well as a linguistic test set. Five baselines are used to compare with the CoCoDM model. The sentence-level baseline Sent is a standard Transformer trained on sentence-level parallel data. The remaining four baselines are all paragraph-level neural machine translation, including: 1) DocT, using an additional context encoder, 2) CADec, a secondary editing framework that uses contextual information to improve sentence-level translation, and 3) GDNMT, which builds a document graph and incorporates the graph into the Transformer architecture with graph convolution.
[0065] All test results are shown in Table 1. The model achieved the best BLEU scores in all tasks.
[0066] As shown in Table 1, the overall results of the Europarl and OpenSubtitles translation tasks (BLEU) and the comparison test set (accuracy) are shown.
[0067] Table 1
[0068]
[0069]
[0070] Δ(θ) represents the amount of parameter increase in the model based on Transformer. RMS represents a random masking strategy, which randomly masks words in the current sentence according to the masking rate. "lexical" and "grammatical" represent the lexical and grammatical cohesion means considered in CoCoDM, and "both" means that both lexical and grammatical cohesion means will be masked. "-random" means that only the cohesion means will be masked.
[0071] The proposed cohesion masking strategy outperforms the random masking strategy and the remaining sentence-level and paragraph-level baseline models on all tasks. This suggests that predicting cohesion can generate translations with paragraph-level cohesion more effectively than predicting other words. However, for Opensubtitles, the BLEU improvement over random masking is small. It is speculated that this is due to the scarcity of cohesive devices in the Opensubtitles dataset. Figure 3 The following table shows the percentages of different types of cohesion in Europarl and Opensubtitles. The horizontal axis represents different data sets and the vertical axis represents percentages.
[0072] according to Figure 3 The percentage of cohesive devices in the Opensubtitles dataset is smaller than that in the Europarl dataset. In contrast, the random masking method keeps a fixed masking ratio. Therefore, it can benefit from large data.
[0073] For the types of cohesive devices, it was found that each cohesive device improved the translation quality and the best performance was achieved by using both lexical and grammatical cohesive devices. It was found that the effectiveness of cohesive device masking was affected by the percentage of cohesive devices in the dataset. The higher the percentage of cohesive devices, the higher the BLEU improvement it achieved.
[0074] To further verify whether CoCoDM can improve the cohesion of translation, language evaluation experiments on Deixis and Lexical Cohesion were conducted using a language comparison test set.
[0075] Compared with the sentence-level model Sent and the document-level model CADec, GDNMT, the present invention achieves the best performance in Deixis and Lexical Cohesion by using all types of cohesion means. The results of different types of cohesion means show that specific types of cohesion devices can better solve the chapter phenomena related to these cohesion means. In other words, lexical cohesion devices can better solve Lexical Cohesion problems than grammatical cohesion devices, but the opposite is true for Deixis. This is because Deixis is more related to grammatical cohesion. For the masking strategy, although random masking can improve performance, the cohesion masking strategy is much better in enhancing the model's ability to capture discourse information. The proposed method is based on linguistic knowledge, so it can better help the model understand contextual information and extract contextual information that is useful for translation. This can be seen from the improvement in the results of the model in automated evaluation indicators and linguistic test sets.
[0076] The above experimental results show that CoCoDM can significantly improve the translation quality in BLEU and lexical and grammatical cohesion on a discourse-oriented comparative test set.
[0077] In addition to the performance improvement, CoCoDM is lighter than other paragraph-level neural machine translation models. CoCoDM is completely based on the Transformer model and does not introduce any additional parameters, so CoCoDM is faster in training and translation.
[0078] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.< / sep> < / m> < / sep> < / m> < / sep> < / sep> < / sep> < / m> < / sep>
Claims
1. A context-based shading model framework system, characterized in that: The framework system includes input, encoder and decoder, model loss function, predictor and connection means masking strategy; among them: The input includes two parts, namely, a masked source language input and a right-shifted target language input; the masked source language input is input to the encoder, and the encoder encodes the source language sentence to obtain a source language sentence representation H x The right-shifted target language sentence is input into the decoder, which includes the target language context sentence and the target language current sentence. The decoder generates the sentence representation of the target language sentence according to the source language sentence representation generated by the encoder and the right-shifted target language sentence decoding H y ; The model loss function is a loss function for predicting masked words and a loss function for predicting target sentences; wherein: Predict the masked word loss function: Based on the source language sentence H generated by the encoder x , use the source language word vector table to map it to the source language word table space, and then use the Softmax operation to calculate the generation probability of each word in the word table; use cross entropy to calculate the loss of predicting the masked word, the formula is as follows: Among them, M i represents the i-th word in the masked word set, P(M i |x`,c x ) represents the generation probability of the masked word; Predict the target sentence loss function: Use the target language word vector table to map it to the target language word table space, and then use the Softmax operation to calculate the generation probability P(y i |y <i ,x`,c x , c y ), use cross entropy to calculate the loss of predicted target sentence, the formula is as follows: Among them, y <i represents the generation history of the decoder, y i Represents the i-th word of the target sentence y; The total loss function is as follows: L=L NLL (y|x`,c x ,c y )+λL mask (M|x`,c x ) Where λ represents a hyperparameter used to balance the contribution of the loss of predicting masked words; The predictor consists of a linear layer and a Softmax operation. The linear layer predicts the masked token representation and maps it to the vocabulary space, and then performs a Softmax operation to normalize the new token representation. The predictor obtains the predicted probability P(M) of each word in the vocabulary corresponding to each masked word. i |x`,c x ), use the word with the highest prediction probability as the prediction result of the masked word; The cohesion means masking strategy masks the words in the current sentence that have a cohesive relationship with the context, and uses the cohesion means masking strategy to process the masked current sentence: Given a source language current sentence x and its context c x , and the word position of the cohesive means in the dataset D, for the dataset D, each piece of data e is a parallel sentence pair of the source language and the target language, each end consists of four sentences; the first three sentences are the context of the fourth sentence, and each sentence is used between <sep> To separate;< / sep> The word position in dataset D corresponds to the word position in the current sentence that is related to context c. x A word with a cohesive relationship, where the cohesive relationship includes at least repetition and co-reference; the masking rate r is used to control the proportion of masked information in the current sentence. First, the minimum number of masked words in the current sentence is calculated according to the masking rate r. If the number of word positions in D is greater than or equal to l, the cohesive masking strategy replaces all the words in the corresponding positions in the current sentence of the source language with special symbols. <m>, indicating that it is masked; if the number of words in D is less than l, l-|D| words will be randomly selected from the remaining unmasked words for masking, ensuring that the number of masked words is equal to l; the set of masked words is denoted as M, and the current sentence x after the masking operation is denoted as x`. Finally, x` is compared with c x Using special symbols <sep> Perform splicing as input to the encoder;< / sep> < / m> In the process of extracting lexical cohesion means, for the current sentence x in the source language, first traverse each word x in x i , through WordNet, we get x i All synonyms, near synonyms and hyponyms of the word; then traverse all words c in the context sentence x , if c x is x i If it is a synonym, near synonym, or hyponym, then record x i At position i in the current sentence of the source language; finally, a set of word positions is obtained, where each position corresponds to a word in the current sentence, and this word has a lexical cohesion relationship with a word in its context; For grammatical cohesion means, CoreNLP tool is used for extraction; the sequence after directly concatenating the context and the current sentence is used to obtain all possible sets of coreference relationships using CoreNLP; Finally, the lexical cohesion means word position set and the grammatical cohesion means word position set are merged, and the duplicate positions are removed to obtain the final cohesion means word position dataset D. The cohesion means word masking strategy is masked according to dataset D.
2. A context-based shading model framework system as claimed in claim 1, characterized in that: The context sentence and the current sentence are separated by special symbols <sep> To perform concatenation, right shift is to move the concatenated sentence one position to the right, thereby ignoring a word at the rightmost end of the concatenated sentence and adding a sentence terminator to the leftmost end of the concatenated sentence; the length of the sentence after the right shift operation is the same as the length of the original sentence.< / sep> 3. A context-based shading model framework system as claimed in claim 1, characterized in that: A cohesive device masking strategy is designed for document-level NMT, which enables the model to actively capture inter-sentence discourse links for translation.
4. A context-based shading model framework system as claimed in claim 1, characterized in that: From the filtered coreference relationship set, the position of the word in the current sentence in each coreference relationship is obtained to form a word position set of grammatical cohesion means.
