Search

CN-122021669-A - Text translation method, server, storage medium, and program product

CN122021669ACN 122021669 ACN122021669 ACN 122021669ACN-122021669-A

Abstract

The application provides a text translation method, a server, a storage medium and a program product. The method relates to the field of artificial intelligence and comprises the steps of obtaining an original text and a target language to be translated, searching a translation text pair matched with the original text in a translation database, inputting the translation text pair comprising the original language text and the target language text, translating the original language text appearing in the original text into a corresponding target language text through a text translation model, generating a translation text of the target language corresponding to the original text, performing external knowledge intervention on the text translation model based on a pre-customized translation database, effectively avoiding translation errors of customized words on the premise of not retraining parameters of the text translation model, and improving translation accuracy of the text translation model to customized words such as proper nouns, professional terms, new words and the like.

Inventors

  • TANG JIALONG
  • ZHANG PEI
  • GAO RUIZE
  • YANG BAOSONG

Assignees

  • 阿里巴巴(中国)有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (13)

  1. 1. A method of text translation, comprising: acquiring an original text to be translated and a target language to be translated; Searching a translation database for translation text pairs matched with the original text, wherein the translation database comprises translation text pairs of at least one customized vocabulary, and the translation text pairs comprise original language text and target language text; And inputting the original text, the target language and the translation text pair into a text translation model, translating the original language text appearing in the original text into a corresponding target language text through the text translation model, and generating the translation text of the target language corresponding to the original text.
  2. 2. The method of claim 1, wherein searching the translation database for a translation text pair that matches the original text comprises: And matching the original text with the translated text pairs in the translation database, and determining the translated text pairs in which the contained original language text appears in the original text to obtain the translated text pairs matched with the original text.
  3. 3. The method of claim 1, wherein said translating the original text, the target language, and the translated text to an input text translation model, translating the original language text appearing in the original text to corresponding target language text by the text translation model, and generating translated text of the target language corresponding to the original text, comprises: Inserting the original text, the target language and the translation text pair into a prompt word to generate a task instruction, wherein the task instruction is used for prompting a text translation model to generate a translation text of the target language of the original text based on the translation text pair; Inputting the task instruction into a text translation model, translating the original language text appearing in the original text into a corresponding target language text based on the prompt of the task instruction through the text translation model, and generating a translated text of the target language corresponding to the original text.
  4. 4. A method according to any one of claims 1-3, wherein the training process of the text translation model comprises: Acquiring text translation data, wherein the text translation data comprises an original text and a target text of the target language corresponding to the original text; Constructing training data according to the text translation data, wherein the training data comprises the original text, target text corresponding to the original text, original language used by the original text, target language and translation text pairs of customized vocabulary contained in the original text; And performing fine tuning training on the pre-trained text translation model by using the training data to obtain a trained text translation model.
  5. 5. The method of claim 4, wherein constructing training data from the text translation data comprises: Extracting translation text pairs of customized words from the original text and target texts corresponding to the original text by using a text pair extraction model to obtain translation text pairs of customized words contained in the original text, wherein the translation text pairs of the customized words comprise original language texts and target language texts of the customized words; And constructing training data according to the original text, the target text corresponding to the original text, the original language, the target language and the translation text pair of the customized vocabulary contained in the original text.
  6. 6. The method as recited in claim 5, further comprising: verifying whether a translation text pair in the training data meets a quality condition, wherein the quality condition is that original text in the training data contains original language text in the translation text pair and target text in the training data contains target language text in the translation text pair; and deleting the training data which do not meet the quality condition.
  7. 7. The method of claim 4, wherein using the training data to fine tune the pre-trained text translation model to obtain a trained text translation model comprises: Inputting the training data into the pre-trained text translation model, and generating a prediction result of the target text in the training data through the pre-trained text translation model; And adjusting parameters of the pre-trained text translation model according to the prediction result of the target text to obtain a trained text translation model.
  8. 8. A method according to any one of claims 1-3, further comprising: Acquiring translation text pairs of at least one customized vocabulary to be added to a translation database; and adding the translated text pairs of the at least one customized vocabulary to the translation database.
  9. 9. The method of claim 8, wherein the obtaining translation pairs of at least one custom vocabulary to be added to the translation database comprises: responding to a request for adding a translation text pair to the translation database, displaying a vocabulary customization interface, and acquiring the translation text pair of at least one customization vocabulary to be added to the translation database, which is input through the vocabulary customization interface; And/or the number of the groups of groups, And receiving a customized vocabulary file uploaded through a front-end interface, and reading translated text pairs of at least one customized vocabulary to be added to a translation database from the customized vocabulary file.
  10. 10. A method of text translation, comprising: Receiving a translation request sent by a terminal side device, wherein the translation request comprises an original text to be translated and a target language to be translated; Searching a translation text pair matched with the original text in a translation database, wherein the translation database comprises translation text pairs of at least one customized vocabulary, and the translation text pairs comprise original language text and target language text of the customized vocabulary; Inputting a text translation model by the original text and the translation text pair, translating the original language text appearing in the original text into a corresponding target language text through the text translation model, and generating a translation text of the target language corresponding to the original text; And returning the translated text of the target language to the end-side equipment.
  11. 11. A server for a server, which comprises a server and a server, characterized by comprising the following steps: at least one processor, and A memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor to cause the server to perform the method of any of claims 1-10.
  12. 12. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the method of any of claims 1-10.
  13. 13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.

Description

Text translation method, server, storage medium, and program product Technical Field The present application relates to computer technology, and in particular, to a text translation method, a server, a storage medium, and a program product. Background With the continuous development of artificial intelligence technology, text translation models are increasingly widely used. The text translation model may convert text in one language (referred to as the original language) to translated text in another language (referred to as the target language). At present, the end-to-end text translation model is insufficient in learning proper nouns, new words, rare words and the like in the field, so that the problem of knowledge illusion is easy to generate, and the accuracy of a text translation result is low. Disclosure of Invention The application provides a text translation method, a server, a storage medium and a program product, which are used for solving the problem of low accuracy of a translation result of a text translation model. In a first aspect, the present application provides a text translation method, including: acquiring an original text to be translated and a target language to be translated; Searching a translation database for translation text pairs matched with the original text, wherein the translation database comprises translation text pairs of at least one customized vocabulary, and the translation text pairs comprise original language text and target language text; And inputting the original text, the target language and the translation text pair into a text translation model, translating the original language text appearing in the original text into a corresponding target language text through the text translation model, and generating the translation text of the target language corresponding to the original text. In a second aspect, the present application provides a text translation method, including: Receiving a translation request sent by a terminal side device, wherein the translation request comprises an original text to be translated and a target language to be translated; Searching a translation text pair matched with the original text in a translation database, wherein the translation database comprises translation text pairs of at least one customized vocabulary, and the translation text pairs comprise original language text and target language text of the customized vocabulary; Inputting a text translation model by the original text and the translation text pair, translating the original language text appearing in the original text into a corresponding target language text through the text translation model, and generating a translation text of the target language corresponding to the original text; And returning the translated text of the target language to the end-side equipment. In a third aspect, the present application provides a server comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor for causing the server to perform the method provided in any of the preceding aspects. In a fourth aspect, the present application provides a computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement a method as provided in any of the preceding aspects. In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements a method as provided in any of the preceding aspects. The text translation method, the server, the storage medium and the program product provided by the application acquire an original text to be translated and a target language to be translated, search a translation text pair matched with the original text in a translation database, wherein the translation database comprises at least one translation text pair of customized words, the translation text pair comprises an original language text and a target language text, input the original text, the target language and the translation text pair into a text translation model, translate the original language text appearing in the original text into a corresponding target language text through the text translation model, and generate the translation text of the target language corresponding to the original text. External knowledge intervention is performed on the text translation model based on a pre-customized translation database, so that translation errors of customized words are effectively avoided on the premise that parameters of the text translation model do not need to be retrained, translation accuracy of the text translation model to customized words such as proper nouns, professional terms and new words can be improved, and accuracy of text translation results is improved. Drawings The accompanying drawings, which are incorporated in an