Translation model training method and translation method

By constructing a standard database and training a translation model, the problems of low accuracy and efficiency in translating technical terms were solved, achieving high accuracy and efficiency in technical terminology translation and meeting the translation needs of high-concurrency and low-latency scenarios.

CN121835699APending Publication Date: 2026-04-10ALI HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies suffer from low accuracy and efficiency when translating technical terms, especially when dealing with multiple technical terms. Constrained decoding leads to an expansion of the search space and an increase in decoding time complexity, making it difficult to meet the needs of high-concurrency or low-latency scenarios.

Method used

A standard database containing source and translation word pairs is constructed. The text to be translated and its standard translation text are obtained. The source words in the text to be translated are replaced with standard translation words by training the model until the training stops, thereby improving the accuracy and efficiency of the translation model.

Benefits of technology

By constructing a standard database and training models, the accuracy and efficiency of the translation model in terms of professional terminology have been significantly improved, meeting the translation needs of high-concurrency and low-latency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121835699A_ABST
    Figure CN121835699A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a training method of a translation model and a translation method.The training method of the translation model comprises the steps that a standard database is constructed, the standard database comprises at least one standard vocabulary pair, and each standard vocabulary pair comprises a source vocabulary and a translation vocabulary corresponding to the source vocabulary; a to-be-translated text and a standard translated text corresponding to the to-be-translated text are obtained, and the to-be-translated text comprises at least one target source vocabulary; based on the standard database, determining target translation vocabularies corresponding to the target source vocabularies, and based on the target translation vocabularies, determining a mixed text corresponding to the to-be-translated text; and training the translation model according to the mixed text and the standard translation text until a training stop condition of the translation model is reached. According to the training method of the translation model provided by the specification, the translation accuracy of the translation model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the technical field of computer technology, and in particular to a translation model training method and a translation method. BACKGROUND

[0002] With the continuous development of computer technology, in the context of translation, people have higher and higher requirements for the accuracy of term translation.

[0003] In the era of neural machine translation, constrained decoding is the mainstream method to realize term intervention. Term intervention refers to introducing key terms specified by a particular field or customer into the translation process through manual or semi-automatic means in machine translation. However, with this method, as the number of constraints increases, the search space expands rapidly, leading to an exponential increase in decoding time complexity, making it difficult to meet the actual needs in high concurrency or low latency scenarios. In addition, by using a large language model (LLM), the large language model is guided to translate through pre-constructed prompts, but when there are multiple professional terms, the model inference efficiency is low.

[0004] Therefore, how to train a model with high translation accuracy and high inference efficiency has become a problem to be solved. SUMMARY Therefore, the embodiments of the present specification provide a translation model training method and a translation method. One or more embodiments of the present specification also relate to a translation model training device and a translation device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects in the prior art.

[0005] According to a first aspect of the embodiments of the present specification, a translation model training method is provided, comprising: constructing a standard database, wherein the standard database includes at least one standard vocabulary pair, and the standard vocabulary pair includes a source vocabulary and a translation vocabulary corresponding to the source vocabulary; obtaining a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated includes at least one target source vocabulary; determining a target translation vocabulary corresponding to each target source vocabulary based on the standard database, and determining a mixed text corresponding to the text to be translated based on each target translation vocabulary; training the translation model according to the mixed text and the standard translation text until a training stop condition of the translation model is reached.

[0006] According to a second aspect of the embodiments of the present specification, a translation method is provided, comprising: obtaining a text to be translated; inputting the text to be translated into a translation model to obtain a target translation text output by the translation model, wherein the translation model is trained based on the training method of the translation model according to the first aspect of the embodiments of the present specification.

[0007] According to a third aspect of the embodiments of the present specification, a training device of a translation model is provided, comprising: a construction unit configured to construct a standard database, wherein the standard database comprises at least one standard vocabulary pair, and the standard vocabulary pair comprises a source vocabulary and a translation vocabulary corresponding to the source vocabulary; an obtaining unit configured to obtain a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated comprises at least one target source vocabulary; a determination unit configured to determine a target translation vocabulary corresponding to each target source vocabulary based on the standard database, and determine a mixed text corresponding to the text to be translated based on each target translation vocabulary; a training unit configured to train the translation model according to the mixed text and the standard translation text until a training stop condition of the translation model is reached.

[0008] According to a fourth aspect of the embodiments of the present specification, a translation device is provided, comprising: an obtaining unit configured to obtain a text to be translated; a processing unit configured to input the text to be translated into a translation model to obtain a target translation text output by the translation model, wherein the translation model is trained based on the training method of the translation model according to the first aspect of the embodiments of the present specification.

[0009] According to a fifth aspect of the embodiments of the present specification, a computing device is provided, comprising: a memory and a processor; the memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0010] According to a sixth aspect of the embodiments of the present specification, a computer readable storage medium is provided, which stores computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0011] According to a seventh aspect of the embodiments of the present specification, a computer program product is provided, comprising computer programs / instructions, which realize the steps of the above method when executed by the processor.

[0012] According to one embodiment of the present specification, a standard database is constructed, and each vocabulary in the standard database exists in the form of a standard vocabulary pair, each source vocabulary corresponds to a respective translation vocabulary, thereby providing a standard for translation in the translation process. On this basis, the text to be translated and the standard translation text corresponding to the text to be translated are obtained, and the standard provided by the standard translation text for the text to be translated provides a training label for subsequent training of the translation model. According to the comparison between the vocabulary in the standard database and the vocabulary in the text to be translated, and the replacement of the vocabulary in the text to be translated according to the vocabulary in the standard database, a replacement standard is provided for the replacement process, thereby avoiding the inaccuracy of the vocabulary in the text to be translated. Further, the translation model is trained according to the mixed text with the standard translation vocabulary and the standard translation text, so that the translation model improves the translation efficiency on the basis of learning the standard translation vocabulary. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 A flowchart of a training method of a translation model according to one embodiment of the present specification is shown; Figure 2 A process flowchart of a translation method according to one embodiment of the present specification is shown; Figure 3 A structural schematic diagram of a translation method according to one embodiment of the present specification is shown; Figure 4 A structural schematic diagram of a training device of a translation model according to one embodiment of the present specification is shown; Figure 5 A structural schematic diagram of a translation device according to one embodiment of the present specification is shown; Figure 6 An architecture diagram of a translation system according to one embodiment of the present specification is shown; Figure 7 A structural block diagram of a computing device according to one embodiment of the present application is shown. DETAILED DESCRIPTION

[0014] In the following description, many specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced in many different ways beyond the specific embodiments described herein, and it is understood that one of ordinary skill in the art can make similar modifications without departing from the spirit of the present specification, so the present specification is not limited to the specific implementations disclosed below.

[0015] The terminology used in this disclosure of one or more embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0016] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal sequence, but are used only to distinguish one piece of information from another. For example, a first can be termed a second, and, similarly, a second can be termed a first, without departing from the scope of one or more embodiments of the present disclosure. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination."

[0017] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards in the relevant region, and provide corresponding operation portal for user to choose authorization or refusal.

[0018] In one or more embodiments of the present disclosure, a large model refers to a deep learning model with a large number of model parameters, usually containing hundreds of millions, tens of billions, hundreds of billions, thousands of billions or even tens of thousands of billions of model parameters. The large model can also be called a foundation model. Through large-scale unlabeled corpus pre-training, a pre-trained model with hundreds of millions of parameters is produced. Such a model can adapt to a wide range of downstream tasks and has good generalization ability. For example, large language models (LLM) and multi-modal pre-training models.

[0019] In practical applications, a large model can be applied to different tasks by fine-tuning a pre-trained model with a small number of samples. The large model can be widely applied in natural language processing (NLP) and computer vision, and can be applied to computer vision tasks such as visual question answering (VQA), image captioning (IC), image generation, and natural language processing tasks such as text-based sentiment classification, text summarization generation, and machine translation. The main application scenarios of the large model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, and the like.

[0020] The training method and the translation method of the translation model provided in the specification are applied to the scenario of translating the text to be translated containing professional terms. For example, the scenario of translating the text containing medical field professional terms.

[0021] First, the noun terms related to one or more embodiments of the specification are explained.

[0022] Data synthesis can be understood as artificially generating training samples that do not originally exist but have real data characteristics and semantically reasonable characteristics through algorithms, rules, models or other automated means. The core goal is to expand the scale of training data, enhance data diversity, and effectively alleviate the problems of scarce labeled data or privacy restrictions. This technology is widely used in key scenarios such as large model pre-training, instruction fine-tuning, and security alignment.

[0023] Retrieval-Augmented Generation (RAG) can be understood as a hybrid artificial intelligence architecture that combines information retrieval (Retrieval) and text generation (Generation). The core idea is to enable language models to dynamically retrieve and reference the latest, authoritative or specific domain information in external knowledge bases when generating answers, thereby significantly improving the accuracy, timeliness and explainability of the output content.

[0024] Large Language Model-based Translation can be understood as a technical paradigm that uses a general-purpose large language model (LLM) with a large number of parameters to give it cross-language translation capabilities through prompting or fine-tuning. Although such models are not designed specifically for translation tasks, they have shown strong zero-shot translation capabilities and multilingual generalization performance due to their extensive exposure to massive multilingual corpora during pre-training.

[0025] Neural Machine Translation (NMT) can be understood as the use of deep neural networks (such as Seq2Seq with attention mechanism, Transformer architecture, etc.) to achieve end-to-end translation mapping learning.

[0026] The term intervention can be understood as the fact that general machine translation models are usually trained based on large-scale general corpora, and when dealing with highly specialized or customized content, they may not be able to correctly identify or faithfully reproduce key terms, and even misinterpret or be inconsistent. Terminology intervention in machine translation refers to explicitly introducing specific domain or customer-specified key terms (such as professional terms, brand names, product names, legal terms, etc.) into the translation process through manual or semi-automatic methods to ensure that these terms remain consistent, accurate, and consistent with the expected context in the translation.

[0027] With the continuous development of computer technology, translation capabilities have also been enhanced. In the context of medical literature retrieval, users usually query in Chinese, but expect the search results to include not only Chinese literature but also related English literature. Accurate translation of medical terms (such as rare drug names, disease terms, etc.) in user input into corresponding English expressions is a problem that needs to be solved. However, the translation model in the related art often performs poorly when dealing with highly specialized medical vocabulary, and is prone to term misinterpretation or inconsistency. For example, an online deployed translation module based on a large language model (LLM) has strong general knowledge and cross-domain generalization capabilities, but without explicit term guidance, it is still difficult to ensure the accuracy and reliability of medical term translation.

[0028] Therefore, a translation model training method and a translation method are provided in the specification. By constructing a standard database, the translation model is guided to learn standard terminology obtained by actively referring to and correctly using a dictionary during the translation process in the training stage, thereby significantly improving the translation accuracy of medical professional terminology and better supporting the accurate retrieval needs of multilingual medical literature. Specifically, in the specification, a translation model training method and a translation method are provided. The specification also relates to a translation model training device and a translation device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0029] Referring to Figure 1 , Figure 1 A flowchart of a translation model training method according to an embodiment of the specification is shown, which specifically includes the following steps 102-108.

[0030] Step 102: Construct a standard database, wherein the standard database includes at least one standard vocabulary pair, and the standard vocabulary pair includes a source vocabulary and a translation vocabulary corresponding to the source vocabulary.

[0031] The standard database can be understood as a database containing professional field source vocabulary and translation vocabulary corresponding to the source vocabulary. The database is constructed based on professional field knowledge, for example, the database can be a dictionary corresponding to professional field knowledge, etc. It should be understood that the construction method of the standard database is not limited in the specification. On this basis, in the medical field, the standard database can be understood as professional medical terminology constructed for professional data in the medical field, and the professional medical terminology in the first language is taken as the source vocabulary, and the professional medical data in the second language is taken as the translation vocabulary. The second language is obtained by language conversion from the first language. Further, based on the first language being Chinese, the second language can be English or other languages. The standard database covers all terminology in the professional field and the corresponding translation.

[0032] Further, the languages corresponding to the source vocabulary and the translation vocabulary involved in the specification can be flexibly selected according to specific implementation scenarios, which are not limited in the specification.

[0033] The standard vocabulary pair can be understood as a vocabulary pair formed by the source language and the translation vocabulary corresponding to the source language in different language forms. For example, in the medical field, the standard vocabulary pair contains key terminology such as common diseases, symptoms, drugs, examination items, and their standard English translation.

[0034] The source vocabulary can be understood as a professional term or a common vocabulary in the professional field in the form of the first language. For example, in the medical field, the source vocabulary can be a medical term.

[0035] The translated vocabulary can be understood as a vocabulary in the second language corresponding to the source vocabulary in the first language after translation, and the vocabulary in the second language is also a term or a common vocabulary in the field. For example, in the medical field, the translated vocabulary can be an English version of the medical term translated from the first language.

[0036] In a specific embodiment provided in the present specification, source vocabulary in a professional field and translated vocabulary in different language forms corresponding to the source vocabulary are obtained. They are constructed as standard vocabulary pairs to provide a basis for subsequent training of translation models.

[0037] For example, a high-quality professional medical term dictionary is constructed in the medical field, covering key terms such as common diseases, symptoms, drugs, examination items, and their standard English translations. The key terms and their standard English translations are constructed as standard vocabulary pairs.

[0038] Step 104: obtaining a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated includes at least one target source vocabulary.

[0039] The text to be translated can be understood as a text in the same professional field as the above-mentioned standard database that needs to be accurately translated. The text to be translated includes at least one source vocabulary that needs to be converted in language. It should be understood that the text to be translated can be artificially constructed or obtained from various translated documents, and the method of obtaining the text to be translated is not limited in the present specification. In addition, the source vocabulary in the text to be translated is a disassembled source vocabulary obtained by processing the text to be translated, and the target source vocabulary can be understood as a source vocabulary determined in the standard database according to the disassembled source vocabulary.

[0040] The standard translation text can be understood as a standard translation text obtained by translating the text to be translated. In the standard translation text, each vocabulary follows the translated vocabulary or the source vocabulary corresponding to each vocabulary pair in the above-mentioned standard database.

[0041] In a specific embodiment provided in the present specification, the text to be translated is obtained. On this basis, the text to be translated is translated, wherein the obtained standard translation text contains accurate translation of each term, and the standard translation text is obtained. The standard translation text is a label for subsequent training of the translation model.

[0042] For ease of understanding, the acquisition manner of the standard translation text is explained in the following manner in the specification.

[0043] Specifically, in a specific embodiment provided in the specification, the standard translation text corresponding to the to-be-translated text is obtained, including: determining the standard translation vocabulary corresponding to each target source vocabulary in the to-be-translated text; determining the initial mixed text corresponding to the to-be-translated text based on each standard translation vocabulary, and inputting the initial mixed text into the text translation model; in the text translation model, based on the prompt word reasoning instruction, the standard translation text output by the text translation model is obtained.

[0044] The standard translation vocabulary can be understood as a translation vocabulary corresponding to a source vocabulary determined according to a vocabulary in a standard database, and can also be a translation vocabulary corresponding to a source vocabulary determined according to various documents and other information in a professional field. It should be understood that the source of the standard translation vocabulary is not limited in the specification.

[0045] The initial mixed text can be understood as a text containing at least two languages. For example, the standard translation vocabulary of the second language corresponding to each target source vocabulary of the first language constituting the to-be-translated text is determined in the to-be-translated text, the target source vocabulary of the first language is replaced with the standard translation vocabulary of the second language, and the text obtained by the replacement is determined as the initial mixed text.

[0046] The text translation model can be understood as a model constructed based on a large language model and having a text translation capability.

[0047] The prompt word reasoning instruction can be understood as an instruction for guiding the text translation model to translate the initial mixed text according to the prompt word reasoning instruction to obtain the standard translation text. For example, the prompt word reasoning instruction can be an instruction containing the standard translation vocabulary corresponding to the target source vocabulary based on the instruction for guiding the text translation model to translate the to-be-translated text.

[0048] In a specific embodiment provided in the specification, the standard translation vocabulary corresponding to each target source vocabulary in the to-be-translated text is determined and replaced with the standard translation vocabulary, and on this basis, the initial mixed text is obtained. The initial mixed text is input into the text translation model, and the standard translation text output by the text translation model according to the prompt word reasoning instruction is obtained.

[0049] In an example, a standard translation vocabulary corresponding to each target source vocabulary in the text to be translated is determined, and a corresponding relationship between the standard translation vocabulary and the target source vocabulary is determined. The corresponding relationship and a translation instruction for instructing the text translation model to translate the text are taken as the prompt word reasoning instruction. On this basis, the initial mixed text is input into the text translation model, and the text translation model is guided to translate the initial mixed text according to the prompt word reasoning instruction, to obtain the standard translation text.

[0050] For example, in the medical field, a batch of original medical texts are selected, term replacement is performed to generate Chinese-English mixed input, and then the mixed input is input into a high-performance large language model for reasoning. The high-performance large language model has strong context understanding and word alignment capabilities, and can generate high-quality standard translation texts.

[0051] In another example, a standard translation vocabulary corresponding to each target source vocabulary in the text to be translated is determined, and a corresponding relationship between the standard translation vocabulary and the target source vocabulary is determined. The target source vocabulary in the text to be translated is replaced according to the corresponding relationship to obtain an initial mixed text containing two languages. On this basis, it is determined that the translation instruction for instructing the text translation model to translate the text is a prompt word reasoning instruction. The prompt word reasoning instruction and the initial mixed text are input into the text translation model to obtain the standard translation text.

[0052] According to a specific embodiment provided in the specification, by means of the text translation model and the prompt word reasoning instruction, the text translation model is used to translate the text to be translated, and the efficiency of determining the standard translation text is improved.

[0053] On the basis of the above, the standard translation text corresponding to the text to be translated can also be obtained in the following manner in the specification.

[0054] Specifically, in another specific embodiment provided in the specification, the standard translation text corresponding to the text to be translated is obtained, including: Based on the standard database, a translation vocabulary corresponding to each target source vocabulary in the text to be translated is determined; Based on each translation vocabulary, a standard translation text corresponding to the text to be translated is determined.

[0055] In a specific embodiment provided in the specification, by means of a translation engine supporting a term intervention function, before reasoning, the translation vocabulary corresponding to each target source vocabulary in the standard database is loaded, and the specified translation vocabulary is forced to be retained or mapped, so that an output sample with strong term consistency and high alignment quality is obtained.

[0056] According to a specific embodiment provided in the specification, according to the existing term intervention engine and the standard database constructed, the standard translation text is obtained, and the reliability of obtaining the standard translation text is improved.

[0057] Step 106: determining a target translation vocabulary corresponding to each target source vocabulary based on the standard database, and determining the mixed text corresponding to the text to be translated based on each target translation vocabulary.

[0058] The mixed text can be understood as a text to be translated composed of at least two languages. For example, the text to be translated is composed of a plurality of source vocabularies, wherein there are source vocabularies corresponding to target translation vocabularies. In this case, the source vocabulary corresponding to the target translation vocabulary is replaced, and a mixed text containing target translation vocabularies and source vocabularies is obtained.

[0059] In a specific embodiment provided in the specification, first, the source vocabulary to be replaced in which the professional term exists in the text to be translated is determined, and the source vocabulary to be replaced is determined as the target source vocabulary. According to each standard vocabulary pair in the standard database, the target translation vocabulary corresponding to the target source vocabulary is determined, the target translation vocabulary is replaced with the target source vocabulary in the text to be translated, and a mixed text containing two languages is obtained.

[0060] For ease of understanding, the process of obtaining the mixed text is explained in the following manner in the specification.

[0061] In a specific embodiment provided in the specification, at least one target source vocabulary is identified in the text to be translated based on the source vocabulary corresponding to each standard vocabulary pair in the standard database, comprising: Disassembling the text to be translated to obtain at least one disassembled source vocabulary, and determining the vocabulary semantics of each disassembled source vocabulary; Determining the standard vocabulary semantics of the source vocabulary corresponding to each standard vocabulary pair in the standard database; Based on the vocabulary semantics of each disassembled source vocabulary and the standard vocabulary semantics of each source vocabulary, at least one target source vocabulary is determined in the text to be translated.

[0062] The disassembled source vocabulary can be understood as a source vocabulary obtained by disassembling the text to be translated according to the vocabulary disassembling manner.

[0063] The vocabulary semantics can be understood as the vocabulary semantics obtained by performing semantic analysis on the disassembled source vocabulary.

[0064] In the specific embodiment provided in the specification, the text to be translated is subjected to word segmentation processing to obtain independent source words corresponding to the continuous text, and semantic analysis is performed on each source word to obtain word semantics corresponding to each source word. Each standard word in the standard database is also subjected to semantic analysis to obtain standard word semantics corresponding to each standard word in the standard database. The word semantics of the source words are matched with the word semantics of the standard words to obtain a word pair composed of a source word and a standard word that match each other in semantics, and then at least one target source word that can be replaced is determined in the text to be translated according to the word pair.

[0065] In the specification, the manner of word segmentation processing of the text to be translated is not limited.

[0066] Further, after matching according to the word semantics, if there is a target source word corresponding to at least two translation words, the specification can also use the following manner to determine the target translation word corresponding to the target source word from the at least two translation words.

[0067] Specifically, based on the word semantics of each disassembled source word and the standard word semantics of each source word, at least one target source word is determined in the text to be translated, comprising: An initial disassembled source word is determined, and a text semantics of the text to be translated is determined, wherein the initial disassembled source word is any one of the disassembled source words; Based on the initial disassembled source word and the standard word semantics of each source word, at least one initial target source word corresponding to the initial disassembled source word is determined in the text to be translated; Based on the text semantics of the text to be translated, a target source word corresponding to the initial disassembled source word is determined from the at least one initial target source word.

[0068] In the specific embodiment provided in the present specification, in the case of obtaining at least one disassembled source vocabulary according to the text to be translated, an arbitrary disassembled source vocabulary is selected, and the disassembled source vocabulary selected is determined as an initial disassembled source vocabulary. On this basis, if the initial disassembled source vocabulary matches the standard vocabulary semantics of a source vocabulary in the standard database, the source vocabulary in the standard database is determined as an initial target source vocabulary, and the initial target source vocabulary is determined as the target source vocabulary corresponding to the initial disassembled vocabulary. In addition, if the initial disassembled source vocabulary matches the standard vocabulary semantics of at least two source vocabularies in the standard database, the two source vocabularies in the standard database are respectively determined as initial target source vocabularies. At this time, the text semantics of the text to be translated is determined, and the text semantics of the text to be translated is matched with the vocabulary semantics of each initial target source vocabulary to obtain at least two matching results. According to the at least two matching results, the initial target source vocabulary with a higher matching degree is determined as the target source vocabulary corresponding to the initial disassembled vocabulary.

[0069] The above operation is repeatedly performed until each source vocabulary in the text to be translated is matched with the vocabulary in the standard database, and at least one target source vocabulary corresponding to the text to be translated in the standard database is obtained.

[0070] According to the specific embodiment related in the present specification, the disassembled source vocabulary corresponding to the text to be translated is determined, which retains the representation ability of the vocabulary in the text to be translated. The target source vocabulary corresponding to the disassembled source vocabulary is determined according to the semantic matching degree between the vocabulary semantics of the disassembled source vocabulary and the vocabulary semantics of each source vocabulary in the standard database, which provides a matching basis for determining the target source vocabulary. In addition, in the case of at least two initial target source vocabularies in the standard database, the target source vocabulary is determined from the at least two initial target source vocabularies according to the text semantics of the text to be translated, which further improves the accuracy of determining the target source vocabulary. Accurate sample data is provided for subsequent training of the translation model, which improves the accuracy of training the translation model.

[0071] Based on the above, when at least one target source vocabulary in the text to be translated is determined, the target translation vocabulary corresponding to the target source vocabulary is replaced with the source vocabulary in the text to be translated to obtain a mixed text.

[0072] Step 108: training the translation model according to the mixed text and the standard translation text until the training stop condition of the translation model is reached.

[0073] The training stop condition can be understood as that the loss corresponding to the translation model reaches a preset loss threshold, the gradient of the loss function corresponding to the translation model tends to zero, the training period of the translation model reaches a preset period, etc.

[0074] It should be understood that the training stop condition involved in the present specification can be flexibly adjusted according to actual conditions. The present specification does not limit this.

[0075] In an embodiment provided in the present specification, the translation model is trained according to the mixed text and the standard translation text, including: obtaining a translation instruction category; training the translation model based on the translation instruction category, the mixed text and the standard translation text.

[0076] The translation instruction category can be understood as translating the mixed text into the standard translation text of the first language, or translating the mixed text into the standard translation text of the second language, wherein the first language and the second language are determined based on the language contained in the mixed text.

[0077] In an embodiment provided in the present specification, in the case where the translation instruction category is to translate the mixed text into the standard translation text of the first language, the mixed text and the standard translation text are input into the translation model according to the translation instruction category, and the translation model is trained until the training stop condition of the translation model is reached.

[0078] It should be understood that the standard translation text involved in the present specification corresponds to the translation instruction category. For example, in the case where the translation instruction category is to translate the mixed text into the standard translation text of the first language, the standard translation text is the translation text of the first language. Similarly, in the case where the translation instruction category is to translate the mixed text into the standard translation text of the second language, the standard translation text is the translation text of the second language.

[0079] According to an embodiment provided in the present specification, the translation model is trained according to the translation instruction category, thereby improving the diversification of the translation language of the translation model.

[0080] For ease of understanding, the training process of the translation model is described in the following manner in the present specification.

[0081] In an embodiment provided in the present specification, the translation model is trained according to the mixed text and the standard translation text until the training stop condition of the translation model is reached, including: inputting the mixed text into the translation model to obtain an initial translation text output by the translation model; comparing the standard translation text and the initial translation text to obtain a comparison result; adjusting the model parameters of the translation model based on the comparison result until the training stop condition of the translation model is reached.

[0082] In an embodiment provided in the specification, the mixed text is input into the translation model to obtain an initial translation text output by the translation model. The initial translation text is compared with the standard translation text, and the training direction of the translation model is determined according to the difference between the initial translation text and the standard translation text. The model parameters are adjusted so that the trained translation model can be trained in the direction of the standard translation text, and thus a trained translation model is obtained.

[0083] The following description is combined with the accompanying Figure 2 The translation method is explained and described by taking the application of the training method of the translation model provided in the specification in the translation process as an example. Among them, Figure 2 A process flow diagram of a translation method provided in an embodiment of the specification is shown, which specifically includes the following steps 202-204.

[0084] Step 202: obtaining a text to be translated.

[0085] Step 204: inputting the text to be translated into the translation model to obtain a target translation text output by the translation model.

[0086] The translation model is trained based on the training method of the above translation model.

[0087] In an embodiment provided in the specification, the translation request of the user is determined, the text to be translated input by the user is obtained according to the translation request of the user, and the text to be translated is input into the translation model. On this basis, if the translation request of the user is a first request, the translation instruction category and the translation prompt word are input into the translation model to obtain a target translation text output by the translation model. The translation prompt word is used to guide the translation model to output the target translation text. On this basis, the translation prompt word is stored in the translation model.

[0088] Further, if the translation request of the user is a non-first request, the translation instruction category and the text to be translated are input into the translation model. On this basis, since the translation prompt word has been stored in the translation model, the translation prompt word does not need to be input into the translation model again during the translation process according to the translation model, and the target translation text can be obtained. Thus, the translation efficiency of the translation model is improved.

[0089] According to an embodiment provided in the specification, the translation text to be translated is translated according to the translation model, and the translation accuracy is improved. In addition, since the translation model has the function of storing the initial translation prompt word, the translation prompt word does not need to be input into the translation model again during the subsequent translation process of the text to be translated, the inference efficiency of the translation model is improved, and the translation speed is improved, and the user experience is improved.

[0090] In the specific implementation provided in the present specification, in order to facilitate the understanding of the training method and the translation method of the translation model described above, the training method and the translation method of the translation model are exemplarily described in the examples shown in the present specification. Figure 3 Figure 3 The structure diagram of the translation method provided by one embodiment of the present specification is shown.

[0091] In the specific implementation provided in the present specification, the text to be translated is set as the translation text in the medical field. For example, the text to be translated is “treatment of breast cancer”, and the translation model is constructed according to this scenario.

[0092] Specifically, the professional medical vocabulary dictionary is constructed to obtain the corresponding standard database described above in the present specification. The professional medical vocabulary dictionary includes at least one standard vocabulary pair, and the standard vocabulary pair includes a Chinese vocabulary and an English vocabulary corresponding to the Chinese vocabulary. For example, a high-quality professional medical terminology dictionary is constructed in the medical field, which covers common diseases, symptoms, drugs, examination items, etc. On the basis of the constructed standard database, the standard database is used as model input to facilitate term recognition and replacement.

[0093] According to the professional medical vocabulary dictionary, the term recognition and replacement are performed, the source vocabulary in the text to be translated is replaced, and the replaced Chinese-English mixed sentence is obtained. For example, in the above scenario, according to the professional medical vocabulary dictionary, it is determined that the English vocabulary corresponding to “breast cancer” is “Breast cancer”, and on this basis, “breast cancer” in the text to be translated is replaced, and the expression of the Chinese-English mixed sentence is “Breast cancer treatment method”.

[0094] On this basis, the standard translation text corresponding to the text to be translated is obtained, and the specific implementation manner is referred to the above embodiments of the present specification, which will not be described herein.

[0095] The Chinese-English mixed sentence and the standard translation text are used to train the translation model, the model training is performed according to the translation instruction category in the translation model, and the stage prediction result in the training process is output until the training stop condition of the translation model is reached.

[0096] For example, if the translation instruction category is to reserve the Chinese terminology, the translation model translates the text to be translated according to the instruction type in the training process to obtain the corresponding Chinese translation text. If the translation instruction category is to reserve the English terminology, the translation model translates the text to be translated according to the instruction type in the training process to obtain the corresponding English translation text.

[0097] ​It needs to be understood that after the trained translation model is obtained, in actual application process, the translation model also has the function of storing the translation prompt word in the first translation request, so as to facilitate subsequent non-first translation request without inputting the translation prompt word again, and improve the inference efficiency of the translation model.

[0098] Corresponding to the method embodiments described above, the present specification also provides a training device for a translation model, Figure 4 The structure of a training device for a translation model provided by an embodiment of the present specification is shown. As shown in the figure, Figure 4 The device comprises: A construction unit 402 configured to construct a standard database, wherein the standard database comprises at least one standard word pair, and the standard word pair comprises a source word and a translation word corresponding to the source word.

[0099] An acquisition unit 404 configured to acquire a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated comprises at least one target source word.

[0100] A determination unit 406 configured to determine a target translation word corresponding to each target source word based on the standard database, and determine a mixed text corresponding to the text to be translated based on each target translation word.

[0101] A training unit 408 configured to train the translation model according to the mixed text and the standard translation text until a training stop condition of the translation model is reached.

[0102] Further, the determination unit 406 is further configured to: Identify at least one target source word in the text to be translated based on the source word corresponding to each standard word pair in the standard database; Determine a target translation word corresponding to each target source word based on the translation word in each standard word pair.

[0103] Further, the determination unit 406 is further configured to: Disassemble the text to be translated to obtain at least one disassembled source word, and determine the word semantics of each disassembled source word; Determine the standard word semantics of the source word corresponding to each standard word pair in the standard database; Determine at least one target source word in the text to be translated based on the word semantics of each disassembled source word and the standard word semantics of each source word.

[0104] Further, the determination unit 406 is further configured to: determine an initial disassembled source vocabulary, and determine a text semantics of the text to be translated, wherein the initial disassembled source vocabulary is any one of the disassembled source vocabularies; determine at least one initial target source vocabulary corresponding to the initial disassembled source vocabulary in the text to be translated based on the initial disassembled source vocabulary and standard vocabulary semantics of each source vocabulary; determine a target source vocabulary corresponding to the initial disassembled source vocabulary in the at least one initial target source vocabulary based on the text semantics of the text to be translated.

[0105] Further, the acquisition unit 404 is further configured to: determine a standard translation vocabulary corresponding to each target source vocabulary in the text to be translated; determine an initial mixed text corresponding to the text to be translated based on each standard translation vocabulary, and input the initial mixed text to a text translation model; obtain a standard translation text output by the text translation model based on a prompt word reasoning instruction in the text translation model.

[0106] Further, the acquisition unit 404 is further configured to: determine a translation vocabulary corresponding to each target source vocabulary in the text to be translated based on the standard database; determine a standard translation text corresponding to the text to be translated based on each translation vocabulary.

[0107] Further, the training unit 408 is further configured to: acquire a translation instruction category; train the translation model based on the translation instruction category, the mixed text, and the standard translation text.

[0108] Further, the training unit 408 is further configured to: input the mixed text to the translation model to obtain an initial translation text output by the translation model; compare the standard translation text and the initial translation text to obtain a comparison result; adjust model parameters of the translation model based on the comparison result until a training stop condition of the translation model is reached.

[0109] Corresponding to the method embodiments described above, the present specification also provides a translation device embodiment, Figure 5 A structure diagram of a translation device provided by an embodiment of the present specification is shown. As shown in the figure, Figure 5 The device comprises: An acquisition unit 502 is configured to acquire a text to be translated; The processing unit 504 is configured to input the text to be translated into the translation model to obtain target translated text output by the translation model, wherein the translation model is trained based on the training method of the translation model.

[0110] The above is a schematic scheme of the training device and translation device of the translation model of the embodiment. It should be noted that the technical scheme of the training device and translation device of the translation model belongs to the same concept as the technical scheme of the training method and translation method of the translation model described above. The technical scheme of the training device and translation device of the translation model, which is not described in detail, can be referred to the description of the technical scheme of the training method and translation method of the translation model.

[0111] Referring to Figure 6 , Figure 6 An architecture diagram of a translation system is shown, which can include a client 100 and a server 200. The client 100 is configured to send text to be translated to the server 200.

[0112] The server 200 is configured to obtain text to be translated, input the text to be translated into a translation model to obtain target translated text output by the translation model, wherein the translation model is trained based on the training method of the translation model, and send the target translated text to the client 100.

[0113] The client 100 is further configured to receive the target translated text sent by the server 200.

[0114] The scheme of the embodiment of the present specification can be applied to the translation system, which can include multiple clients 100 and a server 200. The client 100 can be referred to as an end-side device, and the server 200 can be referred to as a cloud-side device. Multiple clients 100 can establish a communication connection through the server 200. In the translation scenario, the server 200 is used to provide translation services between multiple clients 100. Multiple clients 100 can be used as a sending end or a receiving end to realize communication through the server 200.

[0115] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the translation scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 can generate a translation according to the data stream and push the translation to other clients that establish a communication connection.

[0116] The client 100 and the server 200 establish a connection through a network. The network provides a medium for a communication link between the client 100 and the server 200. The network can include various connection types, such as wired, wireless communication links, or fiber optic cables, and the like. The data transmitted by the client 100 can need to be encoded, transcoded, compressed, and the like before being published to the server 200.

[0117] The client 100 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5) application, or a light application (also known as a small program, a lightweight application), or a cloud application, and the like. The client 100 can be developed based on a software development kit (SDK) provided by the server 200, such as an RTC (Real Time Communication) SDK, and the like. The client 100 can be deployed in a computing device, and needs to rely on the device or some APP in the device, and the like. The computing device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, and the like. Various other applications can also be configured in the computing device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.

[0118] The server 200 can include servers that provide various services, such as servers that provide communication services for multiple clients, servers that provide support for models used on clients for background training, servers that process data sent by clients, and the like. It should be noted that the server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server of cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDNs), and big data and artificial intelligence platforms, and the like. The server can also be an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.

[0119] It should be noted that the training method and the translation method of the translation model provided in the embodiments of the present specification are generally executed by the server, but in other embodiments of the present specification, the client can also have similar functions as the server, so as to execute the training method and the translation method of the translation model provided in the embodiments of the present specification. In other embodiments, the training method and the translation method of the translation model provided in the embodiments of the present specification can also be executed by the client and the server together.

[0120] Figure 7 A structural block diagram of a computing device according to an embodiment of the present application is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 through a bus 730, and a database 750 is used to save data.

[0121] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include the public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as a IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, etc.

[0122] In an embodiment of the present application, the above-mentioned components of the computing device 700 and other components not shown in the figure can be connected to each other, for example, through a bus. It should be understood that Figure 7 the above-mentioned components of the computing device 700 and other components not shown in the figure can be connected to each other, for example, through a bus. It should be understood that Figure 7 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0123] The computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 700 can also be a mobile or stationary server.

[0124] The processor 720 is configured to execute computer program / instructions, which, when executed by the processor, implement the steps of the training method and the translation method of the translation model.

[0125] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device belongs to the same concept as the technical scheme of the training method and the translation method of the translation model, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the training method and the translation method of the translation model.

[0126] An embodiment of the present specification also provides a computer readable storage medium storing computer program / instructions, which, when executed by a processor, implement the steps of the training method and the translation method of the translation model.

[0127] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, the computer readable storage medium embodiment is basically similar to the training method and the translation method of the translation model, so the description is relatively simple, and the relevant parts can be referred to the description of the training method and the translation method of the translation model.

[0128] An embodiment of the present specification also provides a computer program product comprising computer program / instructions, which, when executed by a processor, implement the steps of the training method and the translation method of the translation model.

[0129] The above is a schematic scheme of the computer program product of the embodiment. It should be noted that the technical scheme of the computer program product belongs to the same concept as the technical scheme of the training method and the translation method of the translation model, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the training method and the translation method of the translation model.

[0130] The above detailed description has shown, described, and pointed out novel features of the application. The foregoing can be implemented in other embodiments or carried out in additional or different ways without departing from the spirit and essential characteristics of the application. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

[0131] The computer readable medium can include any entity or apparatus that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate contents according to the requirements of patent practice, for example, according to the patent practice in some regions, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0132] It should be noted that the above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different than the order in which the actions or steps are recited in the embodiments, and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can also be advantageous.

[0133] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0134] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. Alternative embodiments do not describe all the details and limit the present application to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present specification. The present specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and utilize the present specification. The present specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for training a translation model, comprising: constructing a standard database, wherein the standard database comprises at least one standard word pair, and each standard word pair comprises a source word and a translation word corresponding to the source word; obtaining a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated comprises at least one target source word; determining a target translation word corresponding to each target source word based on the standard database, and determining a hybrid text corresponding to the text to be translated based on each target translation word; and training the translation model according to the hybrid text and the standard translation text until a training stop condition of the translation model is reached.

2. The method of claim 1, wherein determining a target translation word corresponding to each target source word based on the standard database comprises: identifying at least one target source word in the text to be translated based on the source word of each standard word pair in the standard database; and determining a target translation word corresponding to each target source word based on the translation word in each standard word pair.

3. The method of claim 2, wherein identifying at least one target source word in the text to be translated based on the source word of each standard word pair in the standard database comprises: disassembling the text to be translated to obtain at least one disassembled source word and determine a word semantic of each disassembled source word; determining a standard word semantic of the source word of each standard word pair in the standard database; and determining at least one target source word in the text to be translated based on the word semantic of each disassembled source word and the standard word semantic of each source word.

4. The method of claim 3, wherein determining at least one target source word in the text to be translated based on the word semantic of each disassembled source word and the standard word semantic of each source word comprises: determining an initial disassembled source word and a text semantic of the text to be translated, wherein the initial disassembled source word is any one of the disassembled source words; determining at least one initial target source word corresponding to the initial disassembled source word in the text to be translated based on the initial disassembled source word and the standard word semantic of each source word; and determining a target source word corresponding to the initial disassembled source word from the at least one initial target source word based on the text semantic of the text to be translated.

5. The method of any one of claims 1 to 4, wherein obtaining a standard translation text corresponding to the text to be translated comprises: determining a standard translation word corresponding to each target source word in the text to be translated; determining an initial hybrid text corresponding to the text to be translated based on each standard translation word, and inputting the initial hybrid text into a text translation model; and obtaining a standard translation text output by the text translation model based on a prompt word inference instruction in the text translation model.

6. The method of any one of claims 1 to 4, wherein obtaining a standard translation text corresponding to the text to be translated comprises: determining a translation word corresponding to each target source word in the text to be translated based on the standard database; and determining a standard translation text corresponding to the text to be translated based on each translation word. ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ determine a standard translation text corresponding to the text to be translated based on each translation vocabulary. 7.The method of claim 1, wherein the translation model is trained according to the mixed text and the standard translation text, comprising: obtaining a translation instruction category; training the translation model based on the translation instruction category, the mixed text and the standard translation text. 8.The method of claim 1, wherein the translation model is trained according to the mixed text and the standard translation text until a training stop condition of the translation model is reached, comprising: inputting the mixed text into the translation model to obtain an initial translation text output by the translation model; comparing the standard translation text and the initial translation text to obtain a comparison result; adjusting model parameters of the translation model based on the comparison result until the training stop condition of the translation model is reached. 9.A translation method, comprising: obtaining a text to be translated; inputting the text to be translated into a translation model to obtain a target translation text output by the translation model, wherein the translation model is trained based on the training method of the translation model according to any one of claims 1 to 8. 10.A training device of a translation model, comprising: a construction unit configured to construct a standard database, wherein the standard database comprises at least one standard vocabulary pair, and each standard vocabulary pair comprises a source vocabulary and a translation vocabulary corresponding to the source vocabulary; an obtaining unit configured to obtain a text to be translated and a standard translation text corresponding to the text to be translated, wherein the text to be translated comprises at least one target source vocabulary; a determining unit configured to determine a target translation vocabulary corresponding to each target source vocabulary based on the standard database, and determine a mixed text corresponding to the text to be translated based on each target translation vocabulary; a training unit configured to train the translation model according to the mixed text and the standard translation text until a training stop condition of the translation model is reached. 11.A translation device, comprising: an obtaining unit configured to obtain a text to be translated; a processing unit configured to input the text to be translated into a translation model to obtain a target translation text output by the translation model, wherein the translation model is trained based on the training method of the translation model according to any one of claims 1 to 8. 12.A computing device, comprising: a memory and a processor; the memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, which realize the steps of the method according to any one of claims 1 to 9 when executed by the processor. 13.A computer readable storage medium storing computer programs / instructions, which realize the steps of the method according to any one of claims 1 to 9 when executed by the processor. 14.A computer program product comprising computer programs / instructions, which realize the steps of the method according to any one of claims 1 to 9 when executed by the processor.