A language translation method, electronic device and storage medium
By using multiple translation models trained in different training processes to translate and process the source language text and fuse the target language text, the problems of over-translation, missed translation and word repetition in existing machine translation technologies are solved, and the accuracy of translation is improved degree and user experience.
Patent Information
- Application Number
- CN202210428126.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-04-22
AI Technical Summary
Existing machine translation technologies often have problems such as over-translation, missed translation and duplication of words during language translation, resulting in reduced accuracy and affecting user experience.
Through the training of multiple translation models through different training processes, the obtained source language text is translated and the target language text obtained by each translation model is fused to finally determine the translation result of the target language.
It improves the accuracy of machine translation, reduces over-translation, missed translation and word duplication, thereby improving user experience.
Smart Images

Figure CN114896990B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a language translation method, electronic equipment and storage medium. Background Art
[0002] With the rapid development of economic globalization and the Internet, machine translation technology plays an increasingly important role in promoting political, economic, and cultural exchanges. In the application of language translation, existing machine translation technology often leads to over-translation, omission, and word duplication in some sentences, which reduces the accuracy of machine translation and affects user experience. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a language translation method, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0004] According to a first aspect of the present invention, a language translation method is provided, the method comprising:
[0005] Obtain source language text;
[0006] Inputting the source language text into a plurality of translation models for translation processing respectively to obtain a plurality of target language texts corresponding to the source language text, wherein the plurality of translation models include a plurality of translation models trained through different training processes;
[0007] Multiple target language texts are fused and processed to determine the translation result in the target language.
[0008] Optionally, the multiple translation models trained through different training processes include: multiple translation models trained using different computing mechanisms, and / or multiple different translation models trained using training data from different fields.
[0009] Optionally, the fusion processing of multiple target language texts to determine the translation result in the target language includes:
[0010] Determine the number of texts that are consistent across multiple target language texts;
[0011] If the number of texts is less than or equal to the text threshold, text fusion is performed on the multiple target language texts to determine the translation result in the target language.
[0012] Optionally, the method further includes:
[0013] If the number of texts is greater than the text threshold, the corresponding target language text is used as the translation result of the target language.
[0014] Optionally, the text fusion of multiple target language texts to determine the translation result in the target language includes:
[0015] Performing scoring operations on multiple target language texts respectively to determine the text score of each target language text;
[0016] A target text score that meets the translation score condition is screened out from the multiple text scores, and a target language text corresponding to the target text score is used as a translation result in the target language.
[0017] Optionally, performing scoring operations on the multiple target language texts respectively to determine the text score of each target language text includes:
[0018] Performing word segmentation on multiple target language texts respectively to obtain multiple target word segments corresponding to each target language text;
[0019] Determine the combination probability of two adjacent target segmented words among the multiple target segmented words corresponding to each target language text;
[0020] The comprehensive probability corresponding to each target language text is determined according to the combined probability, and the text score of each target language text is determined according to each comprehensive probability.
[0021] Optionally, the text fusion of multiple target language texts to determine the translation result in the target language includes:
[0022] Performing a concatenation operation on a plurality of target language texts, and separating two adjacent target language texts at a concatenation position with a target symbol to obtain a concatenated text;
[0023] The concatenated text is semantically analyzed to generate a translation result in a target language.
[0024] Optionally, the performing semantic analysis on the concatenated text to generate a translation result in a target language includes:
[0025] Based on the concatenated text, generating a corresponding concatenated feature vector;
[0026] According to the semantic information of each target language text, feature analysis is performed on the concatenated feature vector to generate a translation result in the target language.
[0027] According to a second aspect of the present invention, there is further provided an electronic device, the electronic device comprising:
[0028] one or more processors;
[0029] Memory;
[0030] One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned language translation method.
[0031] According to a third aspect of the present invention, a computer-readable storage medium is provided, storing a computer program for use in conjunction with an electronic device, wherein the computer program can be executed by a processor to implement the above-mentioned language translation method.
[0032] In the scheme of the present invention, multiple translation models obtained through different training processes are used to translate the acquired source language text, and the target language text obtained by each translation model is fused to finally determine the translation result of the target language, thereby improving the accuracy of machine translation.
[0033] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] By reading the detailed description of the preferred embodiment below, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only used for the purpose of illustrating the preferred embodiment and are not considered to be limitations of the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings.
[0035] In the attached picture:
[0036] Figure 1 is a flow chart of the steps of a language translation method provided by an embodiment of the present invention;
[0037] Figure 2 is a flowchart of another language translation method provided by an embodiment of the present invention;
[0038] Figure 3 is a flowchart of the steps of another language translation method provided by an embodiment of the present invention;
[0039] Figure 4 The present invention provides a block diagram of a language translation device. DETAILED DESCRIPTION
[0040] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0041] Reference Figure 1 , shows a flow chart of the steps of a language translation method provided by an embodiment of the present invention, the method may include:
[0042] S101. Obtain source language text.
[0043] S102: Input the source language text into a plurality of translation models for translation processing to obtain a plurality of target language texts corresponding to the source language text, wherein the plurality of translation models include a plurality of translation models trained through different training processes.
[0044] S103: performing fusion processing on multiple target language texts to determine the translation result in the target language.
[0045] In an embodiment of the present invention, a source language text refers to a text to be translated displayed in a source language, and the text to be translated may be a sentence, a paragraph, or multiple paragraphs. A target language text refers to a text displayed in a target language. The translation model is used to translate the text to be translated in the source language to obtain a target language text. The semantic information of the source language text is consistent with the semantic information of the target language text, wherein the source language and the target language respectively include various languages, such as Chinese, English, Korean, German, etc., and at the same time, the source language and the corresponding target language are inconsistent. For example, the source language is Chinese, and the corresponding target language is English; the source language is Chinese, and the corresponding target language is Korean; the source language is English, and the corresponding target language is Chinese. The source language and the target language can be determined according to the actual application scenario, which is not limited here.
[0046] When the source language text is input into multiple translation models for translation processing, each translation model outputs a target language text corresponding to the source language text. In one example, the number of translation models is not less than 3. Those skilled in the art can determine the number of translation models according to the actual scenario requirements, which is not limited here. Since the training process between each two translation models is different, for example, different training processes often correspond to different initialization parameters and different hyperparameters. There may be differences in the multiple target language texts output by the multiple translation models obtained through different training processes. Thus, the obtained multiple target language texts can be fused to determine the translation result of the target language. Among them, the fusion processing refers to analyzing the difference information between each target language text, synthesizing the difference information, determining the text with a high degree of matching with the semantic information of the source language text, and using this text as the translation result of the target language. Through the multiple translation models obtained through different training processes, the obtained source language text is translated, and the target language text obtained by each translation model is fused, and the translation result of the target language is finally determined and displayed, thereby improving the accuracy of machine translation and helping to increase user stickiness.
[0047] Reference Figure 2 , shows a flow chart of steps of another language translation method provided by an embodiment of the present invention, the method may include:
[0048] S201. Obtain source language text.
[0049] S202: Input the source language text into a plurality of translation models for translation processing to obtain a plurality of target language texts corresponding to the source language text, wherein the plurality of translation models include a plurality of translation models trained through different training processes.
[0050] In an embodiment of the present invention, when the acquired source language text is respectively input into a plurality of translation models for translation processing, each translation model outputs a target language text corresponding to the source language text. In one example, since the training processes between each two translation models in the plurality of translation models are different, the plurality of target language texts output by the plurality of translation models may be different. Thus, the plurality of target language texts obtained can be fused to determine the translation result of the target language. The fusion process refers to analyzing the difference information between the target language texts, synthesizing the difference information, determining the text with a high degree of matching with the semantic information of the source language text, and using the text as the translation result of the target language. The plurality of translation models obtained by training through different training processes may include: a plurality of translation models trained by different computing mechanisms, and / or a plurality of different translation models trained by training data from different fields.
[0051] During the machine translation process, the greater the difference between multiple translation models, the higher the accuracy of the target language translation result determined after the fusion processing based on multiple target language texts. In one example, multiple translation models can use the same training data and are trained using different calculation mechanisms. Among them, the calculation mechanism refers to the basic model structure or variant model structure used to generate the translation model, and the variant model structure is obtained by changing the basic model structure. The basic model structure may include models such as CNN (Convolutional Neural Networks), RNN (Recurrent Neural Network), and Transformer. Among them, RNN also includes structures such as LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit). Transformer also includes a multihead-attention structure.
[0052] In another example, multiple translation models can be trained using the same calculation mechanism and training data from different fields, which may include news, sports, tourism, technology, and medical fields. Among them, the training data for training each translation model corresponds to multiple fields. In actual application, those skilled in the art can determine the training data for the corresponding translation model based on the translation application scenario. For example, the method is mainly applied to language translation in the field of tourism, and the place names corresponding to each region can be used as one of the training data to train the corresponding translation model, thereby improving the translation accuracy of the place names.
[0053] In another example, multiple translation models can be trained using different calculation mechanisms and training data from different fields. Thus, multiple target language texts corresponding to the source language texts output by multiple translation models can show the text differences under different calculation mechanisms, and further fuse the multiple target language texts, specifically analyze the difference information between the target language texts, and finally determine the text with a high degree of semantic matching with the source language text, and use this text as the translation result of the target language. This can improve the accuracy of machine translation and increase user stickiness.
[0054] The number of the translation models is N, such as 5 translation models, the source language is English, and the corresponding target language is Chinese. The source language text may be "There is a big tree in front of my house". After the 5 translation models translate the above source language text, in one example A, the multiple target language texts obtained are "There is a big tree in front of my house", "There is a big tree in front of my house", "There is a big tree in front of my house", "A big tree in front of my house", "There is a big tree in front of my house". In another example B, the multiple target language texts obtained are "In front of my house", "There is a tree in front of my house", "There is a big tree in front of my house", "There is a big tree in front of my house", "A big tree is in front of my house".
[0055] In an optional embodiment of the invention, the fusion processing of multiple target language texts to determine the translation result in the target language includes:
[0056] S203: Determine the number of texts with identical texts among the multiple target language texts.
[0057] S204: Determine whether the text quantity is less than or equal to a text threshold.
[0058] In an embodiment of the present invention, after determining a plurality of target language texts, the number of texts with consistent texts in the plurality of target language texts can be determined, that is, the number of texts with the same results after multiple translation models translate the source language text. A text threshold can be pre-set according to the number of translation models. Among them, the text threshold can be used to determine the degree of match between the semantics of the target language text corresponding to the number of texts and the semantics of the source language text. When the number of texts is greater than the text threshold, it can be determined that the semantic information of the target language text is completely consistent with the semantic information of the source language text. When the number of texts is less than or equal to the text threshold, it can be determined that the degree of match between the semantic information of the target language text and the semantic information of the source language text is low, and further text fusion of the plurality of target language texts is required.
[0059] In one example, when N is an odd number, the text threshold may be (N-1) / 2, for example, when there are 5 translation models, the corresponding text threshold is 2. When N is an even number, the text threshold may be N / 2, for example, when there are 6 translation models, the corresponding text threshold is 3. Thus, when determining the number of texts with consistent texts in multiple target language texts, the number of texts may be compared with the text threshold. During the comparison process, the largest number of texts may be compared with the text threshold. Thus, the subsequent steps are determined based on the comparison results. If the number of texts is less than or equal to the text threshold, step S205 is executed. If the number of texts is greater than the text threshold, step S207 is executed.
[0060] For example, according to the above example A, it can be determined that the number of texts with consistent texts in multiple target language texts is 3, which is greater than the corresponding text threshold 2. Therefore, it can be determined that the semantic information of the source language text "There is a big tree in front of myhouse" is completely consistent with the semantic information of the target language text "There is a big tree in front of my house". For another example, according to the above example B, it can be determined that the number of texts with consistent texts in multiple target language texts is 2, which is equal to the corresponding text threshold 2. Therefore, it can be determined that the semantic information of the source language text and the semantic information of the target language text have a low matching degree.
[0061] S205: Perform scoring operations on the multiple target language texts respectively to determine the text score of each target language text.
[0062] In the embodiment of the present invention, when it is determined that the semantic information of the source language text and the semantic information of the target language text have a low matching degree, multiple target language texts can be further fused to determine the translation result of the target language. Among them, text fusion can be understood as performing language structure analysis or semantic analysis on each target language text to determine the translation result of the target language.
[0063] In one example, a language structure of multiple target language texts can be structurally analyzed using a preset language model, wherein the language model is generated based on the language structure corresponding to the target language. For example, when the target language is Chinese, the corresponding language model is generated based on the language structure of Chinese.
[0064] For different language structures, the position of the same word in the same sentence is different. In one example, for Chinese, words with the part of speech of adverbial are usually placed before words with the part of speech of verb. For English, the place adverbial, time adverbial and manner adverbial that modify the verb are generally placed after the verb or at the end of the sentence. Therefore, each target language text can be input into a preset language model for structural analysis, so as to obtain the text score corresponding to each target language text. Among them, the text score is used to characterize the standardization of the language structure distribution of each target language text.
[0065] In an optional embodiment of the invention, step S205 may further include the following sub-steps:
[0066] The multiple target language texts are respectively segmented into words to obtain multiple target word segments corresponding to the target language texts.
[0067] The combination probability of two adjacent target segmented words among the multiple target segmented words corresponding to each target language text is determined.
[0068] The comprehensive probability corresponding to each target language text is determined according to the combined probability, and the text score of each target language text is determined according to each comprehensive probability.
[0069] In an embodiment of the present invention, the language model is used to first perform word segmentation on multiple target language texts to obtain multiple target word segmentations corresponding to each target language text. In one example, word segmentation is performed on multiple target language texts in the above example B. The multiple target word segmentations corresponding to "in front of my house" are "I", "home", and "in front of the door". The multiple target word segmentations corresponding to "there is a tree in front of my house" are "home", "in front of the door", "there is", "a tree", and "tree". The multiple target word segmentations corresponding to "there is a big tree in front of my house" are "I", "home", "in front of the door", "there is", "a tree", and "a big tree". The multiple target word segmentations corresponding to "a big tree in front of my house" are "a tree", "a big tree", "in", "I", "home", and "in front of the door".
[0070] Then determine the combination probability of two adjacent target participles in the multiple target participles obtained by word division. In the language model, the target participle located in the previous position of the two adjacent target participles is used as the first target participle, and the target participle located in the latter position is used as the second target participle. By presetting the combination probability, the rationality of the corresponding adjacent relationship between the first target participle and the second target participle is quantified. For example, based on the frequency of the first target participle followed by the second target participle in the training data of the language model, the corresponding combination probability is determined. Thus, through the language model, the other target participles except those located in the last position in the multiple target participles can be matched respectively, and the corresponding combination probability can be determined, and each combination probability can be multiplied in turn to obtain the comprehensive probability corresponding to each target language text, and each comprehensive probability is weighted, and the weighted comprehensive probability is used as the text score of the target language text.
[0071] For example, for the target language text "my home front" obtained by the first translation model, the corresponding multiple target segmented words are "I", "home", and "front of the door". When the first target segmented word is "I" and the second target segmented word is "home", the probability of matching the combination is 0.005; when the first target segmented word is "home" and the second target segmented word is "front of the door", the probability of matching the combination is 0.08. The corresponding comprehensive probability is 4×10 -4 . The above performs three matching operations.
[0072] For the target language text "There is a tree in front of my house" obtained by the second translation model, the corresponding target segmentation words "home", "front of the house", "there is", "a tree", and "tree" are 0.08 when the first target segmentation word is "home" and the second target segmentation word is "front of the house"; 0.02 when the first target segmentation word is "front of the house" and the second target segmentation word is "there is", the probability of matching is 0.05 when the first target segmentation word is "there is" and the second target segmentation word is "a tree", the probability of matching is 0.1. The corresponding comprehensive probability is 8×10 -6 . The above performs 4 matching operations.
[0073] For the target language text "There is a big tree in front of my house" obtained by the third translation model, the corresponding target segmentation words are "I", "home", "front of the door", "there is", "a tree", and "a big tree". When the first target segmentation word is "I" and the second target segmentation word is "home", the probability of matching the combination is 0.005; when the first target segmentation word is "home" and the second target segmentation word is "front of the door", the probability of matching the combination is 0.08; when the first target segmentation word is "front of the door" and the second target segmentation word is "there is", the probability of matching the combination is 0.02; when the first target segmentation word is "there is" and the second target segmentation word is "a tree", the probability of matching the combination is 0.05; when the first target segmentation word is "a tree" and the second target segmentation word is "a big tree", the probability of matching the combination is 0.2. The corresponding comprehensive probability is 8×10 -8 , 5 matching operations are performed above.
[0074] The combined probabilities of the target language text "There is a big tree in front of my house" obtained by the fourth translation model are consistent with the combined probabilities of the target language text obtained by the third translation model. The corresponding comprehensive probability is 8×10 -8, The above also performs 5 matching operations.
[0075] For the target language text "A big tree in front of my house" obtained by the fifth translation model, there are multiple target segmentations "one", "big tree", "in", "I", "home", and "in front of the door". When the first target segmentation is "one", and the second target segmentation is "big tree", the probability of matching the combination is 0.2; when the first target segmentation is "big tree" and the second target segmentation is "in", the probability of matching the combination is 0.0001; when the first target segmentation is "in" and the second target segmentation is "I", the probability of matching the combination is 0.003; when the first target segmentation is "I" and the second target segmentation is "home", the probability of matching the combination is 0.005; when the first target segmentation is "home" and the second target segmentation is "in front of the door", the probability of matching the combination is 0.08. The corresponding comprehensive probability is 2.4×10-11 . The above performs 5 matching operations.
[0076] Taking into account the possibility of missing or over-translating, when weighting the comprehensive probability, the corresponding weight value is determined by the number of times each target language text performs matching operations based on the language model. In one example, the weight value of each comprehensive probability corresponding to the maximum number of matching operations is determined to be 1. The weight values of the comprehensive probabilities obtained by matching operations other than the above cases are all determined to be 0. Therefore, the text scores corresponding to the target language texts "In front of my house" and "There is a tree in front of my house" are both 0; the text score corresponding to the target language text "There is a big tree in front of my house" is 8×10 -8 ; The text score of the target language text "A big tree is in front of my house" is 2.4×10 -11 .
[0077] S206: Filter out a target text score that meets the translation score condition from the multiple text scores, and use the target language text corresponding to the target text score as the translation result in the target language.
[0078] In the embodiment of the present invention, after obtaining the text scores corresponding to the multiple target language texts, the standardization of the language structure distribution of the corresponding target language texts can be determined according to the text scores. Among them, the translation score condition can be pre-set to filter out the target language text that best matches the language structure distribution of the target language as the translation result of the target language. For example, the translation score condition can be the maximum text score. This text score is used as the target text score. For example, the target text score is 8×10 -8 Thus, the target language text "There is a big tree in front of my house" corresponding to the target text score can be used as the Chinese translation result and output for display.
[0079] S207: Using the corresponding target language text as the translation result in the target language.
[0080] In the embodiment of the present invention, when it is determined that the semantic information of the target language text is completely consistent with the semantic information of the source language text, the corresponding target language text can be used as the translation result of the target language and displayed. For example, based on the above example A, the Chinese target language text "There is a big tree in front of my house" is used as the translation result of the English source language text "There is a big tree in front of my house", output and displayed.
[0081] In summary, an embodiment of the present invention provides another language translation method, which translates the acquired source language text through multiple translation models obtained through different training processes, and fuses the target language text obtained by each translation model, and finally determines the translation result of the target language, thereby improving the accuracy of machine translation.
[0082] Reference Figure 3 , shows a flow chart of steps of another language translation method provided by an embodiment of the present invention, the method may include:
[0083] S301: Obtain source language text.
[0084] S302: Input the source language text into a plurality of translation models for translation processing to obtain a plurality of target language texts corresponding to the source language text, wherein the plurality of translation models include a plurality of translation models trained through different training processes.
[0085] Optionally, the multiple translation models trained through different training processes include: multiple translation models trained using different computing mechanisms, and / or multiple different translation models trained using training data from different fields.
[0086] S303: Determine the number of texts with identical texts among the multiple target language texts.
[0087] S304: Determine whether the text quantity is less than or equal to a text threshold.
[0088] In the embodiment of the present invention, the description of steps S301 to S303 refers to the description of steps 201 to 203.
[0089] Different from this, if the amount of text is less than or equal to the text threshold, step S305 is executed; if the amount of text is greater than the text threshold, step S307 is executed.
[0090] S305 , executing a splicing operation of a plurality of target language texts, and separating two adjacent target language texts at a splicing point with a target symbol to obtain a spliced text.
[0091] S306: Perform semantic analysis on the concatenated text to generate a translation result in a target language.
[0092] In an embodiment of the present invention, the splicing operation refers to combining the target language texts in order to form a new whole. After executing the splicing operation of multiple target language texts, the target symbol is used to separate them at the splicing point, wherein the target symbol can be a special character. The separated text is determined as the spliced text. A comprehensive semantic analysis is performed on the multiple target language texts through a preset generative model. In one example, in the generative model, the feature vector corresponding to each word is predefined. For example, (0.0031, 0.0021, 0.0011) is used to represent the word "I", (0.0032, 0.0022, 0.0012) represents the word "home", (0.0033, 0.0023, 0.0013) represents the word "door", and (0.0034, 0.0024, 0.0014) represents the word " The feature vector corresponding to each character is determined by analogy. Thus, the obtained concatenated text can be used to generate a concatenated feature vector corresponding to the concatenated text through a generative model. For example, the concatenated feature vector can be a multidimensional row vector or a multidimensional column vector converted from each concatenated text.
[0093] After determining the concatenated feature vector, feature analysis can be performed based on the semantic information of each target language text, that is, the feature vector corresponding to each target language text. Among them, feature analysis refers to determining the difference features between each feature vector based on the analysis of each feature vector. So as to further determine whether there are problems such as missing translation and word duplication when translating the source language text. For example, if there is missing translation in the target language text, the corresponding semantic information is missing compared to the semantic information corresponding to other target language texts. For another example, if there is word duplication in the target language text, the corresponding semantic information is semantically repeated compared to the semantic information corresponding to other target language texts. Therefore, based on the above feature analysis, the difference features between each feature vector are comprehensively considered to determine the target feature vector that is completely consistent with the semantic information of the source language text, and finally the target text consistent with the target feature vector is output through the generative model, and this text is used as the translation result of the target language. For example, the output target text can be "There is a big tree in front of my house."
[0094] S307: Using the corresponding target language text as the translation result in the target language.
[0095] In the embodiment of the present invention, when it is determined that the semantic information of the target language text is completely consistent with the semantic information of the source language text, the corresponding target language text can be used as the translation result of the target language and displayed. For example, based on the above example A, the Chinese target language text "There is a big tree in front of my house" is used as the translation result of the English source language text "There is a big tree in front of my house", output and displayed.
[0096] In summary, an embodiment of the present invention provides another language translation method, which translates the acquired source language text through multiple translation models obtained through different training processes, and fuses the target language text obtained by each translation model, and finally determines the translation result of the target language, thereby improving the accuracy of machine translation.
[0097] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0098] Reference Figure 4 , shows a language translation device provided by an embodiment of the present invention, the device may include:
[0099] The text acquisition module 401 is used to acquire the source language text.
[0100] The translation processing module 402 is used to input the source language text into multiple translation models for translation processing to obtain multiple target language texts corresponding to the source language text, wherein the multiple translation models include multiple translation models trained through different training processes.
[0101] The fusion module 403 is used to perform fusion processing on multiple target language texts to determine the translation result in the target language.
[0102] In an optional embodiment of the invention, the multiple translation models trained through different training processes include: multiple translation models trained using different computing mechanisms, and / or multiple different translation models trained using training data from different fields.
[0103] In an optional embodiment of the invention, the fusion module may include:
[0104] The text quantity determination submodule is used to determine the number of texts with consistent texts in multiple target language texts.
[0105] The text fusion submodule is used to perform text fusion on multiple target language texts to determine the translation result in the target language if the number of texts is less than or equal to the text threshold.
[0106] In an optional embodiment of the invention, the apparatus may further include a result determination module, wherein the result determination module is configured to:
[0107] If the number of texts is greater than the text threshold, the corresponding target language text is used as the translation result of the target language.
[0108] In an optional embodiment of the invention, the text fusion submodule may further include:
[0109] The text scoring unit is used to perform scoring operations on multiple target language texts respectively to determine the text score of each target language text.
[0110] The result determination unit is used to filter out a target text score that meets the translation score condition from multiple text scores, and use the target language text corresponding to the target text score as the translation result of the target language.
[0111] In an optional embodiment of the invention, the text scoring unit is further used for:
[0112] The multiple target language texts are respectively segmented into words to obtain multiple target word segments corresponding to the target language texts.
[0113] The combination probability of two adjacent target segmented words among the multiple target segmented words corresponding to each target language text is determined.
[0114] The comprehensive probability corresponding to each target language text is determined according to the combined probability, and the text score of each target language text is determined according to each comprehensive probability.
[0115] In an optional embodiment of the invention, the text fusion submodule may further include:
[0116] The text concatenation unit is used to perform a concatenation operation on a plurality of target language texts and separate the concatenation of two adjacent target language texts with a target symbol to obtain a concatenated text.
[0117] The semantic analysis unit is used to perform semantic analysis on the concatenated text to generate a translation result in a target language.
[0118] In an optional embodiment of the invention, the semantic analysis unit is further used for:
[0119] Based on the concatenated text, a corresponding concatenated feature vector is generated.
[0120] According to the semantic information of each target language text, feature analysis is performed on the concatenated feature vector to generate a translation result in the target language.
[0121] In summary, an embodiment of the present invention provides a language translation device, which uses multiple translation models obtained through different training processes to translate the acquired source language text, and fuses the target language text obtained by each translation model, and finally determines the translation result of the target language, thereby improving the accuracy of machine translation.
[0122] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0123] It is easy for a person skilled in the art to think that any combination of the above embodiments is feasible, so any combination of the above embodiments is an implementation scheme of the present invention. However, due to space limitations, this specification will not describe them in detail here.
[0124] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0125] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0126] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0127] An electronic device, comprising:
[0128] one or more processors;
[0129] Memory;
[0130] One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method described in the above embodiment.
[0131] A computer-readable storage medium stores a computer program used in combination with an electronic device, wherein the computer program can be executed by a processor to implement the method described in the above embodiment.
[0132] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0133] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0136] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0137] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0138] The above is a detailed introduction to a language translation method and a language translation device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A language translation method, characterized in that: The method comprises: Obtain source language text; Inputting the source language text into a plurality of translation models for translation processing respectively to obtain a plurality of target language texts corresponding to the source language text, wherein the plurality of translation models include a plurality of translation models trained through different training processes; Merge multiple target language texts to determine the translation results in the target language; The step of fusing the multiple target language texts to determine the translation result in the target language includes: Determine the number of texts that are consistent across multiple target language texts; If the number of texts is less than or equal to the text threshold, text fusion is performed on the multiple target language texts to determine the translation result in the target language; The text fusion of multiple target language texts to determine the translation result of the target language includes: Performing scoring operations on multiple target language texts respectively to determine the text score of each target language text; Filtering out a target text score that meets the translation score condition from the multiple text scores, and using the target language text corresponding to the target text score as the translation result of the target language; The step of performing scoring operations on the plurality of target language texts respectively to determine the text score of each target language text includes: Performing word segmentation on multiple target language texts respectively to obtain multiple target word segments corresponding to each target language text; Determine the combination probability of two adjacent target segmented words among the multiple target segmented words corresponding to each target language text; The comprehensive probability corresponding to each target language text is determined according to the combined probability, and the text score of each target language text is determined according to each comprehensive probability.
2. The language translation method according to claim 1, characterized in that: The multiple translation models trained through different training processes include: multiple translation models trained using different computing mechanisms, and / or multiple different translation models trained using training data from different fields.
3. The language translation method according to claim 1, characterized in that: The method further comprises: If the number of texts is greater than the text threshold, the corresponding target language text is used as the translation result of the target language.
4. The language translation method according to claim 1, characterized in that: The text fusion of multiple target language texts to determine the translation result of the target language includes: Performing a concatenation operation on a plurality of target language texts, and separating two adjacent target language texts at a concatenation position with a target symbol to obtain a concatenated text; The concatenated text is semantically analyzed to generate a translation result in a target language.
5. The language translation method according to claim 4, characterized in that: The semantic analysis of the concatenated text to generate a translation result in the target language includes: Based on the concatenated text, generating a corresponding concatenated feature vector; According to the semantic information of each target language text, feature analysis is performed on the concatenated feature vector to generate a translation result in the target language.
6. An electronic device comprising: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program for use in conjunction with an electronic device, wherein the computer program can be executed by a processor to implement the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Model parameter searching method and device
CN109960814A