Method and device for translating vocabulary entries and storage medium
Through the target translation model based on the T5 language model, the problem of grammar and word order errors in complex language translation is solved, efficient and accurate translation results are achieved, and the demand for human resources is reduced.
Patent Information
- Application Number
- CN202411335834.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In the process of translating different languages, when the entries to be translated contain complex language prompt information and dynamic text, existing methods can easily lead to grammar errors and word order errors, resulting in low translation accuracy and requiring a large amount of human resources, making it difficult to effectively verify.
Using the T5 language model-based target translation model, through iterative training and correlation calculation, matching and adjusting model parameters, the accurate translation of translated entries is achieved, including pre-training of multiple target translation models to adapt to multiple languages and translation modes. And make multiple inputs and corrections of entries during the translation process.
It improves the efficiency and accuracy of translation, reduces human resources investment, and enhances the translation quality of translations for translated entries.
Smart Images

Figure CN119312819A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology and provides a method, device and storage medium for translating entries. Background Art
[0002] At present, in the process of translating the terms to be translated into different languages, the terms to be translated include not only conventional static texts, but also complex language prompt information and dynamic texts, such as the singular and plural forms of English words, the first and third person forms, the masculine and feminine of German, etc. In the above cases, the usual method of splicing the translated texts will cause grammatical errors and even word order errors. Sometimes it is difficult to conduct effective text verification. In order to obtain the final translation results, a lot of human resources are needed and the accuracy rate is not high. Summary of the invention
[0003] The embodiments of the present disclosure provide a method, device and storage medium for translating a term, so as to improve the efficiency and accuracy of translation.
[0004] The specific technical solutions provided by this disclosure are as follows:
[0005] In a first aspect, an embodiment of the present disclosure provides a method for translating a term, which is applied to a computing device, and the method includes:
[0006] Based on the translation request information, matching the target translation model associated with the target language and the translation mode for the term to be translated, wherein the translation request information indicates that the term to be translated is translated from the original language to the target language, the translation request information includes the translation mode, and the target translation model is pre-trained based on the T5 language model, the target language and the translation mode;
[0007] The term to be translated is input into the target translation model for learning to obtain the translated target term.
[0008] In some possible implementations provided by the present disclosure, the target translation model is trained in the following manner:
[0009] Input each first sample term in the sample training set into the T5 language model, and train the T5 language model in an iterative manner;
[0010] During each round of iteration, whether the convergence condition is met is determined based on the score information of this round, and when the convergence condition is met, the T5 language model training converges. The process of each round of iteration is as follows:
[0011] Using the T5 language model, translate a first sample term included in the sample training set into a second sample term, wherein the language corresponding to the first sample term is the same as the original language, the language corresponding to the second sample term is the same as the target language, and the first sample term and the second sample term match the translation pattern;
[0012] Using the T5 language model to calculate the relevance of the first sample term and the second sample term, and generating score information based on the result of the relevance calculation;
[0013] Adjust the model parameters of the T5 language model based on the score information.
[0014] In some possible implementations provided by the present disclosure, when the translation mode is a direct translation mode, the second sample term matches the text after the first sample term is translated into the target language, or, when the translation mode is a question-and-answer translation mode, the second sample term matches the text after the following answer term corresponding to the first sample term is translated into the target language.
[0015] In some possible implementations provided by the present disclosure, each first sample term in the sample training set is updated periodically;
[0016] If the updated first sample term is different from the first sample term, the T5 language model is retrained to obtain a target translation model.
[0017] In some possible implementations provided by the present disclosure, matching a target translation model associated with a target language and a translation mode for a term to be translated based on the translation request information includes:
[0018] Parse the translation request information to obtain the terms to be translated, the target language into which the terms to be translated are to be translated, and the translation mode;
[0019] In the pre-established association relationship between the language, mode and translation model, the translation model associated with the target language and translation mode is searched, and the searched translation model is determined as the target translation model matching the term to be translated.
[0020] In some possible implementations provided by the present disclosure, after the term to be translated is input into the target translation model for learning and the translated target term is obtained, the following steps are further included:
[0021] Input the term to be translated into the target translation model again for learning, and obtain the target candidate term after the second translation;
[0022] Based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated, it is determined whether to correct the target term.
[0023] In some possible implementations provided by the present disclosure, determining whether to correct the target term based on first score information between the target term and the term to be translated and second score information between the target candidate term and the term to be translated includes:
[0024] Using the target translation model to calculate the relevance between the target term and the term to be translated, to obtain first score information;
[0025] Using the target translation model, the relevance between the target candidate term and the term to be translated is calculated to obtain second score information;
[0026] If the first score information is less than the second score information, the target term is corrected to a target candidate term.
[0027] In a second aspect, the present disclosure also provides a device for translating a term, including:
[0028] A model matching unit, configured to match a target translation model associated with a target language and a translation mode for a term to be translated based on translation request information, wherein the translation request information indicates that the term to be translated is translated from an original language to a target language, the translation request information includes a translation mode, and the target translation model is pre-trained based on a T5 language model, the target language, and the translation mode;
[0029] The translation unit is used to input the term to be translated into the target translation model for learning to obtain the translated target term.
[0030] According to a third aspect, a computing device includes:
[0031] A memory for storing executable instructions;
[0032] A processor is used to read and execute executable instructions stored in a memory to implement any method as described in the first aspect.
[0033] In a fourth aspect, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor, the processor is enabled to execute any method described in the first aspect.
[0034] The beneficial effects of the present disclosure are as follows:
[0035] In summary, in an embodiment of the present disclosure, a method, device and storage medium for translating terms are provided. The method for translating terms is applied to a computing device, and the method includes: matching a target translation model associated with a target language and a translation mode for a term to be translated based on translation request information, wherein the translation request information indicates that the term to be translated is translated from an original language to a target language, the translation request information includes a translation mode, the target translation model is pre-trained based on a T5 language model, a target language and a translation mode, the term to be translated is input into the target translation model for learning, and a translated target term is obtained. The method of obtaining the target term using the target translation model improves the efficiency and accuracy of translating the term to be translated.
[0036] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0038] Figure 1 A schematic diagram of a system architecture for translating entries in an embodiment of the present disclosure;
[0039] Figure 2 A schematic diagram of a process of translating a term in an embodiment of the present disclosure;
[0040] Figure 3 A schematic diagram of a process for determining a target translation model in an embodiment of the present disclosure;
[0041] Figure 4 A schematic diagram of a process of translating a term to obtain a target term and correcting the target term in an embodiment of the present disclosure;
[0042] Figure 5 A schematic diagram of a flow chart of determining whether to correct a target entry according to a target entry and target candidate entries in an embodiment of the present disclosure;
[0043] Figure 6 A schematic diagram of the logical architecture of a device for translating a term in an embodiment of the present disclosure;
[0044] Figure 7 Schematic diagram of the physical architecture of a computing device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the technical solution of the present disclosure, rather than all the embodiments. Based on the embodiments recorded in the present disclosure document, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present disclosure.
[0046] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented using sequences other than those illustrated or described herein.
[0047] The preferred embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0048] See also Figure 1 As shown, in the embodiment of the present disclosure, the system includes at least one computing device. Figure 1 In the process, the computing device receives the translation request information, determines the target translation model according to the translation request information, and uses the target translation model to translate the term to be translated to obtain the translated target term.
[0049] In the embodiments of the present disclosure, a method for translating a term is implemented, which is mainly performed on the computing device side and is described in detail below.
[0050] See also Figure 2 As shown, in the embodiment of the present disclosure, a specific process of translating a term is as follows:
[0051] Step 201: Based on the translation request information, a target translation model associated with a target language and a translation mode is matched for a term to be translated, wherein the translation request information indicates that the term to be translated is translated from an original language to a target language, the translation request information includes a translation mode, and the target translation model is pre-trained based on a T5 language model, a target language and a translation mode.
[0052] Taking into account that the terms to be translated may be translated into any language during the implementation process, in order to translate the terms to be translated, a variety of target translation models are pre-trained in the embodiments of the present disclosure to adapt to the translation needs of the above-mentioned multiple languages, that is, a target translation model in the embodiments of the present disclosure is only suitable for translating the terms to be translated from one original language to another target language. When the original language of the terms to be translated or the target language to be translated changes, it is necessary to re-match another target translation model for the terms to be translated.
[0053] In addition, considering that common translation modes include direct translation mode (for example, please translate "business" into English) and question-and-answer translation mode (for example, please answer in English what time it is now), during the implementation process, it is also necessary to select corresponding target translation models for different translation modes. The reason is that in the process of obtaining the target translation models for the direct translation mode and the question-and-answer translation mode, the sample training sets used are different.
[0054] For example, in the disclosed embodiment, the target translation model is pre-trained based on the T5 language model, the target language and the translation mode. Here we first introduce that the target translation model is trained in the following way:
[0055] (1) Input each first sample term in the sample training set into the T5 language model, and train the T5 language model in an iterative manner.
[0056] The T5 language model is an open source language model for natural language processing, which can convert input text into another text, and the basis of the conversion is determined according to the usage scenario. During the training process, multiple first sample terms included in the sample training set are input into the T5 language model, so that the T5 language model is trained in an iterative manner.
[0057] During the specific implementation process, the encoder of the T5 language model will perform data cleaning and standardization on each of the first sample terms, as well as mark the original language represented by each of the first sample terms. Afterwards, the encoder of the T5 language model performs operations such as word segmentation, encoding, and feature extraction on the preprocessed first sample terms through the attention mechanism, thereby converting the first sample terms into word embedding vectors one by one.
[0058] In addition, it should be noted that each first sample term in the sample training set is updated periodically.
[0059] If the updated first sample term is different from the first sample term, the T5 language model is retrained to obtain a target translation model.
[0060] Since language itself has the characteristic of changing over time, in the embodiment of the present disclosure, in order to make the translated target terms more accurate, the above-mentioned T5 language model will be periodically retrained, that is, after a preset period is reached, each first sample term in the sample training set will be updated. If the updated first sample term is different from the original first sample term, the updated first sample term is used to retrain the T5 language model and obtain a new target translation model, thereby realizing the update of the target translation model, which can effectively strengthen the maintenance of the target translation model.
[0061] (2) During each round of iteration, whether the convergence condition is met is determined based on the score information of this round, and when the convergence condition is met, the T5 language model training converges. The process of each round of iteration is as follows:
[0062] (3) Using the T5 language model, the first sample term included in the sample training set is translated into a second sample term, wherein the language corresponding to the first sample term is the same as the original language, the language corresponding to the second sample term is the same as the target language, and the first sample term and the second sample term match the translation pattern.
[0063] During the training process, after converting the first sample term into a word embedding vector, the encoder of the T5 language model translates the above word embedding vector to obtain a second sample term. It should be noted that in order to enable the target translation model to translate the term to be translated from the original language to the target language, the language corresponding to the word embedding vector obtained after the conversion of the first sample term is the same as the original language, and accordingly, the language corresponding to the second sample term is the same as the target language.
[0064] In addition, the first sample terms and the second sample terms used in the training process are both matched with the translation pattern.
[0065] It should be noted that, when the translation mode is direct translation mode, the second sample term matches the text translated into the target language by the first sample term, or, when the translation mode is question-and-answer translation mode, the second sample term matches the text translated into the target language by the following reply term corresponding to the first sample term.
[0066] Exemplarily, when the translation mode is the direct translation mode, for example, please translate "business" into English, then the first sample entry is business, and the second sample entry is the text business translated into the target language; when the translation mode is the question-and-answer translation mode, for example, please answer in English what time it is now, then the first sample entry is what time it is now, and the second sample entry is the text Seven o'clock in the morning translated into the target language from the following reply entry corresponding to what time it is now (assuming it is 7:00 in the morning).
[0067] Obviously, when the translation mode is different, the target translation model will also be different, that is, when the target language is the same, the target translation model will also be different due to different translation modes.
[0068] In some embodiments, in order to simplify the training process of the model, the sample training sets of different translation modes can be unified, but the proportions of the first sample terms for different translation modes are different. For example, when the translation mode is a direct translation mode, the translation request information is copied, and the target language, translation mode and subsequent reply terms therein are classified and refined, and during the training process, the above-mentioned target language, translation mode and subsequent reply terms are set to proportions of 50%, 40% and 10%, respectively; when the translation mode is a question-and-answer translation mode, the target language, translation mode and subsequent reply terms therein are classified and refined from the above-mentioned copied translation request information, and during the training process, the above-mentioned target language, translation mode and subsequent reply terms are set to proportions of 30%, 20% and 50%, respectively, thereby obtaining different target translation models.
[0069] (4) Using the T5 language model, the relevance calculation is performed on the first sample term and the second sample term, and score information is generated based on the result of the relevance calculation.
[0070] After obtaining the second sample term using the T5 language model, the machine translation evaluation index (BLEU) tool in the T5 language model will be directly called for quality assessment, that is, the machine translation evaluation index tool will be used to calculate the correlation between the first sample term and the second sample term, and then generate score information based on the result of the correlation calculation.
[0071] (5) Adjust the model parameters of the T5 language model based on the score information.
[0072] If the score information is greater than the preset score, it can be considered that the model iteration quality is good. In this case, it can be determined that the convergence condition is met and the model parameters of the T5 language model are no longer adjusted; if the score information is less than the preset score, it is necessary to continue to adjust the model parameters of the T5 language model until it is determined that the T5 language model training converges. The above adjustment process can make the T5 model training more accurate.
[0073] After training multiple target translation models based on the T5 language model, target language, and translation mode, you can match the target translation model to the term to be translated based on the translation request information. For specific steps, see Figure 3 As shown:
[0074] Step 211: Parse the translation request information to obtain the terms to be translated, the target language into which the terms to be translated are to be translated, and the translation mode.
[0075] During the implementation, after receiving the translation request information sent by the front end or the client, the translation request information is parsed, and the terms to be translated, the target language to be translated into, and the translation mode are obtained according to the keywords included in the translation request information.
[0076] For example, when the translation request information is to translate "business" into English, the keyword double quotation marks included in the translation request information determine that the term to be translated is business, the translation mode is determined to be direct translation mode based on the keyword translation included in the translation request information, and the target language into which the term to be translated is to be translated is English based on the keyword English included in the translation request information.
[0077] For another example, when the translation request information is "Please answer in English what time is it now", the term to be translated is determined as "what time is it now" based on the keyword question word "what time" included in the translation request information, the translation mode is determined to be the question-and-answer translation mode based on the keyword "answer" included in the translation request information, and the target language into which the term to be translated is to be translated is determined to be English based on the keyword "English" included in the translation request information.
[0078] Step 2012: searching for a translation model associated with the target language and translation mode in the pre-established association relationship between the language, mode and translation model, and determining the found translation model as a target translation model that matches the term to be translated.
[0079] Taking into account the diversity of target languages and different translation modes, the target translation models will also be different. In the embodiment of the present disclosure, after different target translation models are obtained for different target languages and different translation modes, an association relationship between the target language, the translation mode and the target translation model will be established in advance, thereby obtaining an association relationship between the language, the mode and the translation model, that is, the association relationship between the above-mentioned different target languages, translation modes and the target translation models is included in the above-mentioned association relationship between the language, the mode and the translation model.
[0080] During the implementation process, after parsing the received translation request information and obtaining the term to be translated, the target language to which the term to be translated is to be translated, and the translation mode, the model associated with the target language and the translation mode is searched in the association relationship between the above-mentioned language, mode and translation model, that is, the language that is the same as the target language is searched in the above-mentioned association relationship, and the translation mode that is the same as the translation mode is continued to be searched under the model corresponding to the above-mentioned language, and the translation model found is determined as the target translation model that matches the term to be translated.
[0081] Step 202: Input the term to be translated into the target translation model for learning to obtain the translated target term.
[0082] After the target translation model is determined, the target translation model is used to learn the terms to be translated included in the translation request information, thereby obtaining the translated target terms.
[0083] For example, when the translation request information is to translate "business" into English, the target translation model is used to learn the business included in the translation request information, so that the target term after translation is obtained as business.
[0084] For another example, when the translation request information is "Please answer in English what time is it now", the target translation model is used to learn what time is it now included in the translation request information, so that the target term after translation is "Seven o'clock in the morning".
[0085] During the implementation process, in order to improve the accuracy of the target translation model, the term to be translated is input into the target translation model for learning. After obtaining the translated target term, refer to Figure 4 As shown, it also includes:
[0086] Step 203: input the term to be translated into the target translation model again for learning, and obtain the target candidate term after re-translation.
[0087] Taking into account the uncertainty of the target translation model in translating the terms to be translated, for example, the accuracy of the translated target terms is poor due to the long sentences of the terms to be translated, grammatical errors in the terms to be translated, defects in the target translation model, etc. In this case, during the implementation process, the terms to be translated are input into the target translation model again for learning. For example, when the sentence of the terms to be translated is too long, after the terms to be translated are input into the target translation model again, the encoder in the model will convert the above terms to be translated into different word embedding vectors. On this basis, after the encoder uses different word embedding vectors for learning, the re-translated target candidate terms obtained will also be different from the above target terms.
[0088] Step 204: Determine whether to correct the target term based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated.
[0089] During the implementation process, after obtaining the target term and the target candidate term, the machine translation evaluation index tool in the target translation model is used to calculate the correlation between the target term and the term to be translated, thereby obtaining first score information and second score information, that is, the accuracy of the target term and the target candidate term is measured by the above-mentioned first score information and second score information.
[0090] Then, based on the accuracy of the target term and the target candidate terms, it is determined whether to correct the target term.
[0091] The above-mentioned determination of whether to correct the target term based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated is as follows: Figure 5 As shown, including:
[0092] Step 2041: Use the target translation model to calculate the relevance between the target term and the term to be translated to obtain first score information.
[0093] In the specific implementation process, after obtaining the target term, the machine translation evaluation index tool in the target translation model is used to calculate the correlation between the target term and the term to be translated, so as to obtain the first score information, which represents the quality assessment score of the target translation model in translating the term to be translated into the target term.
[0094] Step 2042: Use the target translation model to calculate the relevance between the target candidate term and the term to be translated to obtain second score information.
[0095] During the specific implementation process, after obtaining the target candidate terms, the machine translation evaluation index tool in the target translation model is used to calculate the correlation between the target candidate terms and the terms to be translated, thereby obtaining second score information. The second score information represents the quality assessment score of the target translation model in translating the terms to be translated into the target candidate terms.
[0096] Step 2043: If the first score information is less than the second score information, the target term is corrected to a target candidate term.
[0097] After obtaining the first score information and the second score information, the first score information and the second score information are compared. If the first score information is greater than or equal to the second score information, it means that the accuracy of translating the term to be translated into the target term is higher. In this case, the target term is used as the final translation result corresponding to the translation request information; if the first score information is less than the second score information, it means that the accuracy of translating the term to be translated into the target candidate term is higher. In this case, the target term is corrected to the target candidate term, and the target candidate term is used as the final translation result corresponding to the translation request information.
[0098] Based on the same inventive concept, see Figure 6 As shown, in an embodiment of the present disclosure, a device for translating a term is provided, comprising:
[0099] A model matching unit 601 is used to match a target translation model associated with a target language and a translation mode for a term to be translated based on translation request information, wherein the translation request information indicates that the term to be translated is translated from an original language to a target language, the translation request information includes a translation mode, and the target translation model is pre-trained based on a T5 language model, a target language, and a translation mode;
[0100] The translation unit 602 is used to input the term to be translated into the target translation model for learning to obtain the translated target term.
[0101] In some possible implementations provided by the present disclosure, the target translation model is trained in the following manner:
[0102] Input each first sample term in the sample training set into the T5 language model, and train the T5 language model in an iterative manner;
[0103] During each round of iteration, whether the convergence condition is met is determined based on the score information of this round, and when the convergence condition is met, the T5 language model training converges. The process of each round of iteration is as follows:
[0104] Using the T5 language model, translate a first sample term included in the sample training set into a second sample term, wherein the language corresponding to the first sample term is the same as the original language, the language corresponding to the second sample term is the same as the target language, and the first sample term and the second sample term match the translation pattern;
[0105] Using the T5 language model to calculate the relevance of the first sample term and the second sample term, and generating score information based on the result of the relevance calculation;
[0106] Adjust the model parameters of the T5 language model based on the score information.
[0107] In some possible implementations provided by the present disclosure, when the translation mode is a direct translation mode, the second sample term matches the text after the first sample term is translated into the target language, or, when the translation mode is a question-and-answer translation mode, the second sample term matches the text after the following answer term corresponding to the first sample term is translated into the target language.
[0108] In some possible implementations provided by the present disclosure, each first sample term in the sample training set is updated periodically;
[0109] If the updated first sample term is different from the first sample term, the T5 language model is retrained to obtain a target translation model.
[0110] In some possible implementations provided by the present disclosure, based on the translation request information, the model matching unit 601 is used to match the target translation model associated with the target language and the translation mode for the term to be translated:
[0111] Parse the translation request information to obtain the terms to be translated, the target language into which the terms to be translated are to be translated, and the translation mode;
[0112] In the pre-established association relationship between the language, mode and translation model, the translation model associated with the target language and translation mode is searched, and the searched translation model is determined as the target translation model matching the term to be translated.
[0113] In some possible implementations provided by the present disclosure, after the term to be translated is input into the target translation model for learning and the translated target term is obtained, the following steps are further included:
[0114] Input the term to be translated into the target translation model again for learning, and obtain the target candidate term after the second translation;
[0115] Based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated, it is determined whether to correct the target term.
[0116] In some possible implementations provided by the present disclosure, determining whether to correct the target term based on first score information between the target term and the term to be translated and second score information between the target candidate term and the term to be translated includes:
[0117] Using the target translation model to calculate the relevance between the target term and the term to be translated, to obtain first score information;
[0118] Using the target translation model, the relevance between the target candidate term and the term to be translated is calculated to obtain second score information;
[0119] If the first score information is less than the second score information, the target term is corrected to a target candidate term.
[0120] Based on the same inventive concept, refer to Figure 7 As shown, an embodiment of the present disclosure provides a computing device, including: a memory 701, used to store executable instructions; a processor 702, used to read and execute the executable instructions stored in the memory, and execute any one of the methods of the first aspect above.
[0121] Based on the same inventive concept, an embodiment of the present disclosure provides a computer-readable storage medium. When instructions in the storage medium are executed by a processor, the processor is enabled to execute any method described in the first aspect above.
[0122] In summary, in an embodiment of the present disclosure, a method, device and storage medium for translating terms are provided. The method for translating terms is applied to a computing device, and the method includes: based on translation request information, matching a target translation model associated with a target language and a translation mode for a term to be translated, wherein the translation request information indicates that the term to be translated is translated from an original language to a target language, the translation request information includes a translation mode, the target translation model is pre-trained based on a T5 language model, a target language and a translation mode, the term to be translated is input into the target translation model for learning, and a translated target term is obtained. The above method of using the target translation model to obtain the target term improves the efficiency and accuracy of translating the term to be translated.
[0123] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program product systems. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product system 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.
[0124] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program product systems according to the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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.
[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0127] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A method for translating a term, characterized in that: Applied to a computing device, the method comprises: Based on the translation request information, matching a target translation model associated with a target language and a translation mode for a term to be translated, wherein the translation request information indicates that the term to be translated is translated from an original language to the target language, the translation request information includes a translation mode, and the target translation model is pre-trained based on a T5 language model, the target language, and the translation mode; The term to be translated is input into the target translation model for learning to obtain the translated target term.
2. The method according to claim 1, characterized in that The target translation model is trained in the following way: Inputting each first sample term in the sample training set into the T5 language model, and training the T5 language model in an iterative manner; During each round of iteration, it is determined whether the convergence condition is met according to the score information of this round, and when the convergence condition is met, it is determined that the T5 language model training converges, wherein each round of iteration process is as follows: Using the T5 language model, translate a first sample term included in the sample training set into a second sample term, wherein the language corresponding to the first sample term is the same as the original language, the language corresponding to the second sample term is the same as the target language, and the first sample term and the second sample term match the translation pattern; Using the T5 language model to perform relevance calculation on the first sample word and the second sample word, and generating the score information based on the result of the relevance calculation; The model parameters of the T5 language model are adjusted according to the score information.
3. The method according to claim 2, characterized in that When the translation mode is a direct translation mode, the second sample term matches the text of the first sample term translated into the target language, or, when the translation mode is a question-and-answer translation mode, the second sample term matches the text of the following answer term corresponding to the first sample term translated into the target language.
4. The method according to claim 2, characterized in that Each of the first sample terms in the sample training set is updated periodically; If the updated first sample term is different from the first sample term, the T5 language model is retrained to obtain a target translation model.
5. The method according to claim 1, characterized in that The step of matching the target translation model associated with the target language and the translation mode for the term to be translated based on the translation request information includes: Parsing the translation request information to obtain the term to be translated, the target language into which the term to be translated is to be translated, and the translation mode; In the pre-established association relationship between language, mode and translation model, a translation model associated with the target language and translation mode is searched, and the searched translation model is determined as the target translation model matching the term to be translated.
6. The method according to any one of claims 1 to 5, characterized in that: After inputting the term to be translated into the target translation model for learning and obtaining the translated target term, the method further includes: Inputting the to-be-translated terms into the target translation model again for learning, and obtaining the re-translated target candidate terms; Based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated, it is determined whether to correct the target term.
7. The method according to claim 6, characterized in that The determining whether to correct the target term based on the first score information between the target term and the term to be translated and the second score information between the target candidate term and the term to be translated comprises: Using the target translation model to calculate the relevance between the target term and the term to be translated to obtain the first score information; Using the target translation model to calculate the relevance between the target candidate term and the term to be translated, to obtain the second score information; If the first score information is smaller than the second score information, the target term is corrected to the target candidate term.
8. A device for translating a term, characterized in that: include: A model matching unit, configured to match a target translation model associated with a target language and a translation mode for a term to be translated based on translation request information, wherein the translation request information indicates that the term to be translated is translated from an original language to the target language, the translation request information includes a translation mode, and the target translation model is pre-trained based on a T5 language model, the target language, and the translation mode; The translation unit is used to input the term to be translated into the target translation model for learning to obtain the translated target term.
9. A computing device, characterized in that include: A memory for storing executable instructions; A processor, configured to read and execute the executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Translation method and device and device for translation
CN107870904A
Text translation method, device, equipment and computer readable storage medium
CN111178098A
Translation model training method and device and medium
CN113609873A
Continuous learning method and device of multi-language translation system, terminal and storage medium
CN115270820A
Generative model training method and device
CN118349849A
Cited By
Voice information processing method and device for intelligent glasses and intelligent glasses
CN120388567A