Multilingual translation model generation method, translation method, terminal and medium

By training high-resource monolingual sentences and low-resource bilingual sentence pairs, a multilingual translation model is generated, which solves the problem of poor translation quality caused by scarce training resources, and achieves efficient and accurate multilingual translation.

CN115796192BActive Publication Date: 2025-08-08PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211011066.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2025-08-08
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

Due to the scarce training corpus resources in the prior art, the translation quality of multilingual translation models is poor, and error superposition and time-consuming problems are prone to occur through bridged language translation.

Method used

By obtaining multiple monolingual statements with high resources, training the preset autoregressive language model, generating a pre-trained language model, and then using low-resource bilingual statements to train the pre-trained language model to generate a multilingual translation model, avoiding bridging language translation and improving translation quality and compatibility.

Benefits of technology

It realizes the generation of high-quality multilingual translation models through scarce training resources, improves translation efficiency and translation quality, reduces error superposition, and enhances the robustness of language translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115796192B_ABST
    Figure CN115796192B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a method for generating a multilingual translation model, a translation method, a terminal, and a storage medium. The method comprises obtaining a plurality of first monolingual sentences, training a preset autoregressive language model, and generating a pre-trained language model. The pre-trained autoregressive language model comprises a decoder. A plurality of bilingual sentence pairs are obtained, and two mutually translated sentences in the bilingual sentence pairs are concatenated to generate bilingual training samples. The pre-trained language model is trained based on the bilingual training samples to generate a multilingual translation model. The multilingual translation model is used to translate a given source language into a target sentence. Through the above scheme, a high-quality multilingual translation model is generated using scarce language resources, thereby achieving high-quality multilingual translation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for generating a multilingual translation model, a translation method, a terminal, and a computer-readable storage medium. Background Art

[0002] Machine translation, also known as automatic translation, is a technology that uses computers to convert one natural language (the source language) into another (the target language). Neural network translation models are one implementation of machine translation, relying on large corpora containing large amounts of data to train the translation models. However, the training sentences required for machine translation models are a scarce resource, with both monolingual and bilingual corpora being extremely scarce.

[0003] Currently, in order to achieve multi-language translation using scarce training sentences, two approaches are usually adopted: the first is to use multiple different translation models (such as Chinese-Japanese, Chinese-English, and Chinese-Russian), and select a bridge language to achieve translation from the source language to multiple target languages (such as English-Chinese-Russian, and English-Chinese-Japanese); the second approach is based on the traditional neural network translation model, forcibly training all bilingual corpora together, and ultimately obtaining a machine translation model involving multiple languages (such as Chinese, English, Japanese, and Russian).

[0004] Although the above two processing methods can achieve multilingual translation to a certain extent, the defects of the two processing methods themselves result in poor translation quality. For the first method, on the one hand, multiple different translation models require a large amount of bilingual corpus, and the current scarcity of bilingual corpus resources leads to the translation quality of the trained translation model cannot be guaranteed. On the other hand, when using a bridging language, at least two translations are required, which easily leads to error superposition, and multiple translations are also more time-consuming. For the second method, multilingual corpora are trained together. When there are large differences in language characteristics or structure between different languages, the traditional multilingual translation framework will not be able to solve the translation knowledge conflict problem caused by different language characteristics, compatibility cannot be guaranteed, and the translation quality of the trained multilingual translation model is poor.

[0005] Based on this, how to provide a multilingual translation method that achieves high translation quality through scarce training languages has become a technical problem that needs to be solved urgently. Summary of the Invention

[0006] The main purpose of the present invention is to provide a method for generating a multilingual translation model, a translation method, a terminal and a computer-readable storage medium, aiming to solve the problem in the prior art that a multilingual translation model with high translation quality cannot be achieved through scarce language resources.

[0007] To achieve the above objectives, an embodiment of the present invention provides a method for generating a multilingual translation model, the method comprising:

[0008] Acquire multiple first monolingual sentences and train a preset autoregressive language model to generate a pre-trained language model; the preset autoregressive language model is composed of a decoder;

[0009] Acquire a plurality of bilingual sentence pairs, and concatenate two mutually translated sentences in the bilingual sentence pairs to generate bilingual training samples;

[0010] The pre-trained language model is trained based on the bilingual training samples to generate a multilingual translation model; the multilingual translation model is used to translate a given source language into a target sentence.

[0011] Optionally, the plurality of first monolingual sentences consist of monolingual sentences in multiple languages; and the plurality of bilingual sentence pairs consist of at least three bilingual sentence pairs in different mutually translated languages.

[0012] Optionally, the first monolingual sentence and at least one of the source sentence and the target sentence in the bilingual sentence pair adopt the same language.

[0013] Optionally, obtaining a plurality of bilingual sentence pairs and concatenating two mutually translated sentences in the bilingual sentence pairs to generate bilingual training samples specifically includes:

[0014] Determining a language identifier of a source sentence, a language identifier of a target sentence, and a translation identifier of the source sentence into the target sentence in each bilingual sentence pair;

[0015] The language identifier of the source sentence, the source sentence, the translation identifier, the language identifier of the target sentence, and the target sentence in the bilingual sentence pair are concatenated in a preset order to generate a bilingual training sample.

[0016] Optionally, training the pre-trained language model based on the bilingual training samples to generate a multilingual translation model specifically includes:

[0017] Acquire a plurality of second monolingual sentences and determine a language identifier of each second monolingual sentence;

[0018] concatenating the language identifier of the second monolingual sentence and the corresponding second monolingual sentence to generate a monolingual training sample;

[0019] The pre-trained language model is trained according to the monolingual training samples and the bilingual training samples to generate the multilingual translation model.

[0020] Optionally, the second monolingual sentence and at least one of the source sentence and the target sentence in the bilingual sentence pair adopt the same language.

[0021] Optionally, acquiring a plurality of first monolingual sentences, training a preset autoregressive language model, and generating a pre-trained language model specifically includes:

[0022] determining the language family of each first monolingual sentence, and grouping the first monolingual sentences with the same language family into a language family set;

[0023] The preset autoregressive language model is trained according to the language set to generate a pre-trained language model.

[0024] Optionally, the method further includes:

[0025] Based on a preset corpus, multiple original monolingual sentences and multiple original bilingual sentence pairs are obtained;

[0026] performing data preprocessing on each of the original monolingual sentences and the original bilingual sentence pairs to obtain the first monolingual sentences and the bilingual sentence pairs;

[0027] The data preprocessing includes at least one or more of: data format conversion, data fusion, soft and hard rule filtering, alignment filtering, precise deduplication, fuzzy deduplication, and length screening.

[0028] To achieve the above-mentioned purpose, an embodiment of the present invention further provides a translation method, which includes:

[0029] Obtaining a sentence to be translated, a language identifier of the sentence to be translated, a translation identifier, and a language identifier of a target sentence;

[0030] Inputting the sentence to be translated, the language identifier of the sentence to be translated, the translation identifier, and the language identifier of the target sentence as input items into the multilingual translation model to obtain a target sentence corresponding to the sentence to be translated;

[0031] The multilingual translation model is obtained by any of the above-mentioned methods for generating a multilingual translation model.

[0032] Optionally, the translation method further includes:

[0033] The target sentence is converted into a corresponding target voice, and the target voice is sent to a corresponding user terminal so that the user terminal plays the target language.

[0034] Optionally, the translation method further includes:

[0035] In the case that the sentence to be translated is in a voice format, the sentence to be translated is converted into a corresponding text format, and the sentence to be translated in the text format is used as an input item of a multilingual translation model.

[0036] To achieve the above objectives, an embodiment of the present invention further provides a terminal, comprising: a processor and a memory; the memory storing a computer-readable program executable by the processor; and the processor implementing the steps of the method for generating a multilingual translation model as described in any one of the above items, or the steps of the translation method as described above, when executing the computer-readable program.

[0037] To achieve the above objectives, an embodiment of the present invention further provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the multilingual translation model generation method as described in any of the above items, or the steps in the translation method as described above.

[0038] The present invention trains a preset autoregressive language model through high-resource, more abundantly distributed monolingual sentences to generate a pre-trained language model to enhance the robustness of language translation. The pre-trained language model is then trained through low-resource bilingual sentences to generate a multilingual translation model to achieve multilingual translation. The solution provided by the embodiment of the present invention, on the one hand, eliminates the need for multilingual translation through a bridging language, effectively avoiding error superposition and accelerating translation efficiency; on the other hand, compared to directly training multilingual corpora together, the compatibility of the multilingual translation model can be improved, which greatly improves the training quality of the multilingual translation model, that is, it achieves high-quality multilingual translation through scarce training languages. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of a scenario of a method for generating a multilingual model provided by an embodiment of the present invention;

[0040] Figure 2 A flowchart of a method for generating a multilingual model provided by an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of the structure of a decoder in a preset autoregressive language model provided by an embodiment of the present invention;

[0042] Figure 4 A tokens graph of training sentences during the model training process provided by an embodiment of the present invention;

[0043] Figure 5 Language diagrams of some countries provided in the embodiments of the present invention;

[0044] Figure 6 The embodiment of the present invention provides Figure 5 Language family distribution map of the languages shown in ;

[0045] Figure 7 Data distribution diagram of monolingual sentences in 53 languages provided by the embodiment of the present invention;

[0046] Figure 8 Data distribution diagram of English-foreign bilingual sentence pairs in 53 languages provided by the embodiment of the present invention;

[0047] Figure 9 Data distribution diagram of "Chinese and foreign" bilingual sentence pairs in 53 languages provided by the embodiment of the present invention;

[0048] Figure 10 Flowchart of step S202 in the method for generating a multilingual model provided in an embodiment of the present invention;

[0049] Figure 11 A schematic diagram of a method for generating a multilingual model according to an embodiment of the present invention;

[0050] Figure 12 Flowchart of step S203 of the method for generating a multilingual model provided by an embodiment of the present invention;

[0051] Figure 13 A flowchart of data processing of a preset corpus provided in an embodiment of the present invention;

[0052] Figure 14 A flowchart of a translation method provided by an embodiment of the present invention;

[0053] Figure 15 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0055] To achieve the above objectives, in an embodiment of the present invention, a plurality of first monolingual sentences are obtained to train a preset autoregressive language model to generate a pre-trained language model. Then, a plurality of bilingual sentence pairs are obtained, and the two mutually translated sentences in the bilingual sentence pairs are concatenated to generate bilingual training samples for training the pre-trained language model to generate a multilingual translation model. Thus, in an embodiment of the present invention, a multilingual translation model is generated by training a preset autoregressive language model using high-resource first monolingual sentences and low-resource bilingual sentence pairs. This enables the generated multilingual translation model to achieve high-quality translation between multiple languages.

[0056] For example, the embodiment of the present invention can be applied to Figure 1 In the scene shown. Figure 1 In the illustrated scenario, terminal device 1 can collect a first monolingual sentence and a bilingual sentence pair and input the first monolingual sentence and bilingual sentence pair to server 2. Server 2 then trains a preset autoregressive language model based on the first monolingual sentence and bilingual sentence pair. Server 2 may pre-store a preset autoregressive language model and, in response to the first monolingual sentence and bilingual sentence pair input by terminal device 1, train the preset autoregressive language model using the first monolingual sentence and bilingual sentence pair to generate a multi-translation language model.

[0057] It is understood that in the above application scenario, although the actions of the embodiments of the present invention are described as being partially performed by the terminal device 1 and partially performed by the server 2, these actions may also be performed entirely by the server 2 or entirely by the terminal device 1. The present invention is not limited in terms of the execution subject, as long as the actions disclosed in the embodiments of the present invention are performed.

[0058] Furthermore, after generating the multilingual translation model, the multilingual translation model can be used to translate a sentence to be translated input via a terminal device to obtain a target sentence, thereby achieving high-quality multilingual translation using scarce language resources. It is understood that the generated multilingual translation model can be stored in the server 2 or in the terminal device, and this is not limited in the embodiments of the present invention.

[0059] It should be noted that the above application scenarios are only shown to facilitate understanding of the present invention, and the embodiments of the present invention do not impose any limitations in this regard. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.

[0060] The invention will be further explained below through description of embodiments with reference to the accompanying drawings.

[0061] The embodiment of the present invention provides a method for generating a multilingual translation model, such as Figure 2 As shown, the method for generating a multilingual translation model provided by an embodiment of the present invention may include at least the following steps:

[0062] S201 , obtaining a plurality of first monolingual sentences, training a preset autoregressive language model, and generating a pre-trained language model.

[0063] The multiple first monolingual sentences are composed of monolingual sentences in multiple languages. The multiple languages can be any language (e.g., Chinese, English, Russian, Japanese, German, Korean, French, etc.). For example, some of the multiple first monolingual sentences may be in English, some may be in Chinese, and the remaining may be in Russian. In this embodiment of the present application, the multiple first monolingual sentences can be extracted from a training set.

[0064] Furthermore, the above-mentioned preset autoregressive language model is composed of a decoder, for example, the preset autoregressive language model is composed of a decoder such as Figure 3 It is understandable that the preset autoregressive language model in the embodiment of the present invention is only composed of a decoder and does not include an encoder.

[0065] In an embodiment of the present invention, a preset autoregressive language model is trained through multiple first monolingual sentences, which can fully learn the language characteristics of different languages. For example, Chinese and English have different language characteristics (such as different grammatical structures), so that the generated pre-trained language model can be applicable to different language characteristics, thereby making the translation of the generated multilingual translation model more accurate and more in line with the language characteristics of the target language.

[0066] Specifically, multiple first monolingual sentences can be concatenated in sequence as input items of a preset autoregressive language model to train the preset autoregressive language model. Moreover, during the model training process, in order to prevent the subsequent monolingual sentences from being interfered with by the previous monolingual sentences, the attention mask in the decoder structure of the preset autoregressive language model can be reset so that when predicting a token, only the tokens that have appeared in the current sentence can be seen. At the same time, in order to ensure the correctness of the position encoding, the position encoding of each first monolingual sentence can be reset, such as Figure 4 shown.

[0067] In some embodiments of the present invention, the language family of each of the multiple first monolingual sentences obtained can be first determined, and the first monolingual sentences with the same language family can be grouped into a language family set; and a preset autoregressive language model can be trained according to the language family set to generate a pre-trained language model.

[0068] Take some of the countries set as an example, Figure 5 There are 53 languages in total, divided by language family, such as Figure 6 As shown, it can be divided into 11 language families. Figure 7 This is the data distribution diagram of monolingual sentences in 53 languages. Figure 8 This is the data distribution diagram of English-foreign bilingual sentence pairs in 53 languages. Figure 9 This is a data distribution diagram of "Chinese-foreign" bilingual sentence pairs in 53 languages provided by the embodiment of the present invention.

[0069] Among scarce language resources, some languages are low-resource languages, with very few available sentences. Because different languages within the same language family share similar linguistic characteristics, sentences from the same language can reinforce each other. Therefore, we can group sentences from the same language family into sets and train a pre-set autoregressive language model on each set of language families. This allows us to effectively learn the linguistic characteristics of low-resource languages, enabling the generated pre-trained language model to achieve more accurate predictions.

[0070] S202 , obtaining a plurality of bilingual sentence pairs, and concatenating two mutually translated sentences in the bilingual sentence pairs to generate bilingual training samples.

[0071] The plurality of bilingual sentence pairs may be composed of at least three bilingual sentence pairs in different mutually translated languages. For example, the plurality of bilingual sentence pairs may include a plurality of Chinese-English sentence pairs, a plurality of Chinese-Russian sentence pairs, and a plurality of Chinese-Japanese sentence pairs, and the translation model trained in this manner may be capable of translating between at least three languages. In an embodiment of the present application, a plurality of first monolingual sentences may be extracted from the training set.

[0072] Figure 10 The flowchart of step S202 in the method for generating a multilingual translation model provided by the embodiment of the present invention is as follows: Figure 10 As shown, step S202 can be implemented by at least the following steps:

[0073] S1001: Determine the language identifier of the source sentence, the language identifier of the target sentence, and the translation identifier from the source sentence to the target sentence in each bilingual sentence pair.

[0074] In an embodiment of the present invention, a bilingual sentence pair includes two sentences to be translated into each other, one of which is a source sentence and the other is a target sentence. For example, the source sentence is "Your schoolbag is on the table" and the target sentence is "Your schoolbag is on the table." The language identifier of a sentence is used to indicate the language to which the sentence belongs. For example, if the source sentence is "Your schoolbag is on the table," the source sentence is in English and its language can be "en." The language identifier can uniquely indicate its corresponding language. The translation identifier is used to indicate the translation of the source sentence into the target sentence. For example, TR is used to indicate translation.

[0075] It is understandable that, of the two mutually translated sentences in a bilingual sentence pair, any one of the sentences can be selected as the source sentence, and the other sentence in the bilingual sentence pair is the target sentence. The definition of the source sentence and the target sentence in the bilingual sentence pair is not limited in the embodiments of the present invention.

[0076] S1002 , in a bilingual sentence pair, the language identifier of the source sentence, the source sentence, the translation identifier, the language identifier of the target sentence, and the target sentence are concatenated in a preset order to generate a bilingual training sample.

[0077] In an embodiment of the present invention, bilingual training samples can be generated by splicing in the order of the language identifier of the source sentence, the source sentence, the translation identifier, the language identifier of the target sentence, and the target sentence. Figure 11 As shown:

[0078] languae_ID--Src_bilingual--Translate_ID--languae_ID--Tag_bilingual, that is, the language identifier of the source sentence--source sentence--translation identifier--language identifier of the target sentence--target sentence.

[0079] It should be noted that the “--” in the above embodiment only represents a connector, which is used for convenience in writing and does not exist in actual use.

[0080] S203: Training the pre-trained language model based on the bilingual training samples to generate a multilingual translation model.

[0081] This multilingual translation model is used to translate a target sentence from a given source sentence. Specifically, given a source sentence, a language identifier for the source sentence, a translation identifier, and a language identifier for the target sentence as input, the multilingual translation model can determine the target sentence corresponding to the given source sentence, where the language of the target sentence corresponds to the language identifier of the input target sentence.

[0082] In an embodiment of the present invention, each bilingual training sample may also be spliced together as an input item of a pre-trained language model. The specific implementation steps may refer to the implementation method of splicing each first monolingual sentence described above, and will not be described in detail in this embodiment of the present invention.

[0083] The method for generating a multilingual translation model provided by an embodiment of the present invention trains a preset autoregressive language model using high-resource, more richly distributed monolingual sentences to generate a pre-trained language model, thereby enhancing the robustness of language translation. The pre-trained language model is then trained using low-resource bilingual sentence pairs to generate a multilingual translation model for multilingual translation. The solution provided by an embodiment of the present invention eliminates the need for bridging languages for multilingual translation, effectively avoiding error accumulation and improving translation efficiency. Furthermore, compared to directly training with multilingual corpora, it improves the compatibility of the multilingual translation model, significantly enhancing the training quality of the multilingual translation model, thereby achieving high-quality multilingual translation using scarce training languages. Furthermore, traditional neural network translation models typically employ an encoder-decoder structure, where the encoder encodes the source sentence into a sentence representation, and the decoder uses this sentence representation to generate the target sentence word by word. Neural network translation models with an encoder-decoder structure require a large number of bilingual sentence pairs, which are currently in short supply. In the embodiment of the present invention, language translation can be completed only by using a decoder, without the need for a decoder, and the reliance on bilingual sentence pairs is relatively small.

[0084] In some embodiments of the present invention, the first monolingual sentence and at least one of the source and target sentences in the bilingual sentence pair are in the same language. That is, for example, when the source sentence in the bilingual sentence pair is in English and the target sentence is in Chinese, the first monolingual sentence can be in English and / or Chinese. When the first monolingual sentence and at least one of the source and target sentences in the bilingual sentence pair are in the same language, the pre-trained language model trained on the first monolingual sentence can further improve the translation quality of the multilingual translation model.

[0085] In order to further improve the translation quality of multilingual translation, in some embodiments of the present invention, such as Figure 12 As shown ( Figure 12 This is a flowchart of step S203 in the method for generating a multilingual translation model provided in an embodiment of the present invention. Step S203 can be implemented by at least the following steps:

[0086] S1201: Acquire multiple second monolingual sentences and determine a sentence identifier of each second monolingual sentence.

[0087] It should be noted that the second monolingual sentence and the first monolingual sentence may be the same or different sentences, which is not limited in the embodiment of the present invention.

[0088] In the embodiment of the present invention, the second monolingual sentence and at least one of the source sentence and the target sentence in the bilingual sentence pair use the same language, which can further improve the translation quality of the generated multilingual translation model.

[0089] S1202: Concatenate the language identifier of the second monolingual sentence and the corresponding second monolingual sentence to generate a monolingual training sample.

[0090] like Figure 11 As shown, the language identifier of the second monolingual sentence and the second monolingual sentence are concatenated in the order of the language identifier and the sentence, thereby generating a monolingual training sample.

[0091] S1203: Train the pre-trained language model based on the monolingual training samples and the bilingual training samples to generate a multilingual translation model.

[0092] In this embodiment of the present invention, a pre-trained language model is trained using both monolingual and bilingual training samples, a process known as hybrid incremental learning. Incorporating monolingual training samples into the pre-trained language model training further improves the translation quality of the resulting multilingual translation model, enabling more convenient transfer learning and deployment.

[0093] In some embodiments of the present invention, a plurality of original monolingual sentences and a plurality of original bilingual sentence pairs can be obtained based on a preset corpus; and data preprocessing can be performed on each of the original monolingual sentences and the original bilingual sentence pairs to obtain a first monolingual sentence and a bilingual sentence pair. The data preprocessing includes at least one or more of: data format conversion, data fusion, soft and hard rule filtering, alignment filtering, precise deduplication, fuzzy deduplication, and length screening.

[0094] In an embodiment of the present invention, the above-mentioned preset corpus can be a currently disclosed corpus, which stores a large number of original monolingual sentences and original bilingual sentences. Since there is a certain amount of noise in the original sentences in the preset corpus, in an embodiment of the present invention, data cleaning is performed on the original sentences obtained from the preset corpus to obtain a training set suitable for model training, thereby further improving the accuracy of the generated multilingual translation model and improving the translation quality under limited training resources. Figure 13 As shown, the above-mentioned preset corpus can be composed of multiple corpora. By performing data processing on the original sentences in the preset corpus, corresponding training sets are obtained. These training sets include the first monolingual sentences and bilingual sentence pairs used for model training.

[0095] Linguistic diversity is a major factor contributing to language barriers, making translation between multiple languages crucial. The method for generating a multilingual translation model provided by the present invention utilizes scarce language resources to generate a high-quality multilingual translation model, making it suitable for multilingual translation applications.

[0096] In order to achieve the above purpose, the embodiment of the present invention also provides a translation method, such as Figure 14 As shown ( Figure 14 (a flow chart of a translation method provided by an embodiment of the present invention), the translation method provided by an embodiment of the present invention can be implemented by at least the following steps:

[0097] S1401 , obtaining a sentence to be translated, a language identifier of the sentence to be translated, a translation identifier, and a language identifier of a target sentence.

[0098] S1402: The sentence to be translated, the language identifier of the sentence to be translated, the translation identifier, and the language identifier of the target sentence are input into a multilingual translation model to obtain a target sentence corresponding to the sentence to be translated.

[0099] The multilingual translation model is a multilingual translation model obtained by the above-mentioned method for generating a multilingual translation model.

[0100] In some embodiments of the present invention, the target sentence obtained by translation can be converted into a corresponding target voice, and the target voice is sent to the corresponding user terminal so that the user terminal plays the target language. In some application scenarios, it is necessary to broadcast the target sentence obtained by translation to the corresponding user in the form of voice. Therefore, in embodiments of the present invention, the target sentence can be converted into a target voice, and the target voice is sent to the corresponding user terminal.

[0101] In some embodiments of the present invention, when the sentence to be translated is in speech format, the sentence to be translated is converted into a corresponding text format, and the text-formatted sentence to be translated is used as an input item for a multilingual translation model. In actual use, the sentence to be translated may be speech. Therefore, the sentence to be translated in speech format can be converted into text format first, and the text-formatted sentence to be translated can be used as an input item for translation, thereby achieving the ability to handle multiple forms of translation.

[0102] Based on the above-mentioned method for generating a multilingual translation model and the translation method, an embodiment of the present invention further provides a terminal, such as Figure 15 As shown, it includes at least one processor 150; a display screen 151; and memory 152. It may also include a communications interface 153 and a bus 154. The processor 150, display screen 151, memory 152, and communications interface 153 can communicate with each other via bus 154. The display screen 151 is configured to display a preset user guidance interface in the initial setup mode. The communications interface 153 can transmit information. The processor 150 can invoke logic instructions in the memory 152 to execute the method described in the above embodiment.

[0103] In addition, the logic instructions in the memory 152 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0104] Memory 152, as a computer-readable storage medium, can be configured to store software programs or computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. Processor 150 executes the software programs, instructions, or modules stored in memory 152 to perform functional applications and data processing, thereby implementing the steps of the multilingual translation model generation method or the translation method described in the above embodiments.

[0105] The memory 152 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal. In addition, the memory 152 may include a high-speed random access memory and may also include a non-volatile memory. For example, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk may be a variety of media that can store program code, or may be a transient storage medium.

[0106] Based on the above-mentioned method for generating a multilingual translation model and the translation method, an embodiment of the present invention further provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the method for generating a multilingual translation model or the steps in the translation method described in the above-mentioned embodiment.

[0107] In addition, the specific process of loading and executing the multiple instructions in the terminal and computer-readable storage medium has been described in detail in the above method and will not be described here one by one.

[0108] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0109] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium that can be read by a computer. When executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.

[0110] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for generating a multilingual translation model, characterized in that: The method for generating the multilingual translation model includes: Acquire multiple first monolingual sentences, train a preset autoregressive language model, and generate a pre-trained language model; The step of obtaining a plurality of first monolingual sentences and training a preset autoregressive language model to generate a pre-trained language model specifically includes: determining the language family of each first monolingual sentence, and grouping the first monolingual sentences with the same language family into a language family set; Training the preset autoregressive language model according to the language set to generate a pre-trained language model; During model training, the attention mask in the decoder structure of the preset autoregressive language model is reset so that when predicting a token, only the tokens that have appeared in the current sentence are seen. The position encoding of each first monolingual sentence is reset to ensure the position encoding is correct. The preset autoregressive language model is composed of a decoder; Acquire a plurality of bilingual sentence pairs, and concatenate two mutually translated sentences in the bilingual sentence pairs to generate bilingual training samples; Training the pre-trained language model based on the bilingual training samples to generate a multilingual translation model; Training the pre-trained language model based on the bilingual training samples to generate a multilingual translation model specifically includes: Acquire a plurality of second monolingual sentences and determine a language identifier of each second monolingual sentence; concatenating the language identifier of the second monolingual sentence and the corresponding second monolingual sentence to generate a monolingual training sample; Training the pre-trained language model according to the monolingual training samples and the bilingual training samples to generate the multilingual translation model; The multilingual translation model is used to translate a given source language into a target sentence.

2. The method for generating a multilingual translation model according to claim 1, wherein: The plurality of first monolingual sentences are composed of monolingual sentences in multiple languages; and the plurality of bilingual sentence pairs are composed of at least three bilingual sentence pairs in different mutually translated languages.

3. The method for generating a multilingual translation model according to claim 1, wherein: The first monolingual sentence and at least one of the source sentence and the target sentence in the bilingual sentence pair adopt the same language.

4. The method for generating a multilingual translation model according to claim 1, wherein: Obtaining multiple bilingual sentence pairs and concatenating two mutually translated sentences in the bilingual sentence pairs to generate bilingual training samples, specifically including: Determining a language identifier of a source sentence, a language identifier of a target sentence, and a translation identifier of the source sentence into the target sentence in each bilingual sentence pair; The language identifier of the source sentence, the source sentence, the translation identifier, the language identifier of the target sentence, and the target sentence in the bilingual sentence pair are concatenated in a preset order to generate a bilingual training sample.

5. The method for generating a multilingual translation model according to claim 1, wherein: The second monolingual sentence and at least one of the source sentence and the target sentence in the bilingual sentence pair adopt the same language.

6. The method for generating a multilingual translation model according to claim 1, wherein: The method further comprises: Based on a preset corpus, multiple original monolingual sentences and multiple original bilingual sentence pairs are obtained; performing data preprocessing on each of the original monolingual sentences and the original bilingual sentence pairs to obtain the first monolingual sentences and the bilingual sentence pairs; The data preprocessing includes at least one or more of: data format conversion, data fusion, soft and hard rule filtering, alignment filtering, precise deduplication, fuzzy deduplication, and length screening.

7. A translation method, characterized in that: A multilingual translation model obtained by applying the method for generating a multilingual translation model according to any one of claims 1 to 6, wherein the translation method comprises: Obtaining a sentence to be translated, a language identifier of the sentence to be translated, a translation identifier, and a language identifier of a target sentence; Inputting the sentence to be translated, the language identifier of the sentence to be translated, the translation identifier, and the language identifier of the target sentence as input items into the multilingual translation model to obtain a target sentence corresponding to the sentence to be translated; The multilingual translation model is obtained by the method for generating a multilingual translation model according to any one of claims 1 to 6.

8. The translation method according to claim 7, characterized in that: The translation method further comprises: The target sentence is converted into a corresponding target voice, and the target voice is sent to a corresponding user terminal so that the user terminal plays the target voice.

9. The translation method according to claim 7, characterized in that: The translation method further comprises: In the case that the sentence to be translated is in a voice format, the sentence to be translated is converted into a corresponding text format, and the sentence to be translated in the text format is used as an input item of a multilingual translation model.

10. A terminal, characterized in that: The terminal includes: a processor and a memory; the memory stores a computer-readable program that can be executed by the processor; when the processor executes the computer-readable program, it implements the steps in the method for generating a multilingual translation model according to any one of claims 1 to 6, or the steps in the translation method according to claims 7 to 9.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the multilingual translation model generation method according to any one of claims 1 to 6, or the steps in the translation method according to claims 7 to 9.

Citation Information

Patent Citations

  • Method for generating pseudo data by low-resource language based on multi-language model

    CN113111667A

  • Translation model training method and device and translation method and device

    CN113449529A