Text translation method and device, electronic equipment and storage medium

By identifying and processing difficult words separately in text translation methods, the deviation problem between general understanding and specific context comprehension during translation is solved, and more accurate and high-quality text translation results are achieved.

CN119398063AActive Publication Date: 2025-02-07PENG CHENG LAB

Patent Information

Application Number
CN202411414815.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-02-07
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

In existing machine translation technology, large language models directly apply the general interpretation of the words to be translated during translation, resulting in deviations from the general understanding of the words to be translated in a specific context, which in turn leads to inaccurate text translation results.

Method used

A text translation method is proposed. By obtaining the original text in the source language, performing preliminary translation to obtain the initial translated text in the target language, determining the difficult words in the original text, and interpreting these words individually to obtain the word in the target language Difficult word translation text, and then correct the initial word translation based on the difficult word translation text, update the initial translated text, and obtain more accurate target text.

Benefits of technology

By targetedly dealing with difficult words, the accuracy and quality of text translation are improved, and the accurate understanding of the words to be translated in a specific context is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398063A_ABST
    Figure CN119398063A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a text translation method and device, electronic equipment and a storage medium, and belongs to the technical field of machine translation. The method comprises the following steps: acquiring an original text in a source language; preliminarily translating the original text to obtain an initial translated text under the target language, and determining difficult words in the original text and initial word translations of the difficult words in the initial translated text based on the original text and the initial translated text; independently performing word explanation on the difficult words in the original text to obtain a difficult word translation text under the target language; and correcting the initial word translation based on the difficult word translation text to obtain a corrected target word translation, and updating the initial translation text based on the target word translation to obtain a target text of the original text in the target language. The accuracy of the text translation result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of machine translation, and in particular to a text translation method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of science and technology and economy, multilingual communication has become a trend. In order to overcome language barriers and improve communication efficiency, machine translation has emerged. Machine translation is a type of text translation, which aims to automatically translate sentences in one natural language (source language) into sentences in another natural language (target language).

[0003] Generally, text translation is achieved using a large language model (LLM). However, the large language model in the related art directly applies the general interpretation of the words to be translated to the sentence translation, which causes a deviation between the general understanding of the words to be translated and the specific understanding of the words to be translated in the source language sentence scenario, thereby resulting in inaccurate text translation results. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a text translation method, device, electronic device and storage medium, aiming to improve the accuracy of text translation results.

[0005] To achieve the above purpose, a first aspect of an embodiment of the present application proposes a text translation method, the method comprising:

[0006] Get the original text in the source language;

[0007] Performing a preliminary translation of the original text to obtain an initial translation text in the target language, and determining the difficult words in the original text and the initial word translations of the difficult words in the initial translation text based on the original text and the initial translation text;

[0008] Explain the difficult words in the original text separately to obtain the translation text of the difficult words in the target language;

[0009] The initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation, and the initial translation text is updated based on the target word translation to obtain a target text of the original text in the target language.

[0010] In some embodiments, performing a preliminary translation on the original text to obtain an initial translation text in the target language includes:

[0011] Constructing first prompt information related to the source language and the target language, and inputting the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct to translate the demonstration original text into a demonstration initial translation text, and the demonstration initial translation text includes a demonstration initial word translation;

[0012] Taking the original text as a constraint and the first prompt information as a translation guide, the original text is preliminarily translated to obtain an initial translation text in the target language.

[0013] In some embodiments, the original text is used as a constraint condition and the first prompt information is used as a translation guide to perform a preliminary translation on the original text to obtain an initial translation text in the target language, including:

[0014] Acquire first example information corresponding to the first prompt information;

[0015] The original text is used as a constraint condition and the first prompt information and the first example information are used as translation guides to perform a preliminary translation on the original text to obtain an initial translation text in the target language.

[0016] In some embodiments, determining difficult words in the original text based on the original text and the initial translation text includes:

[0017] Constructing second prompt information related to the source language and the target language, and inputting the second prompt information, the original text and the initial translation text into a preset large language model, wherein the second prompt information is used to indicate determining the difficult words of the demonstration from the original text of the demonstration;

[0018] Retrieving computing power resources based on the second prompt information, wherein the computing power resources include internal computing power resources and external computing power resources;

[0019] Using the second prompt information as a guide for analysis, computing resources are used to parse the original text and the initial translation text to obtain difficult words.

[0020] In some embodiments, the second prompt information is used as a parsing guide, and computing resources are used to perform text parsing on the original text and the initial translation text to obtain difficult words, including:

[0021] Acquire second example information corresponding to the second prompt information;

[0022] Using the second prompt information and the second example information as analysis guides, computing resources are used to perform text analysis on the original text and the initial translation text to obtain difficult words.

[0023] In some embodiments, the difficult words in the original text are interpreted individually to obtain the translation text of the difficult words in the target language, including:

[0024] Constructing third prompt information related to the source language and the target language, and inputting the third prompt information, the original text and the difficult words into a preset large language model, wherein the third prompt information is used to instruct to interpret the difficult words for demonstration separately to obtain the translation text of the difficult words for demonstration;

[0025] With the original text as a constraint and the third prompt information as an explanation guide, the difficult words in the original text are explained individually to obtain the translation text of the difficult words in the target language.

[0026] In some embodiments, the original text is used as a constraint condition and the third prompt information is used as an explanation guide to interpret the difficult words in the original text separately to obtain the translation text of the difficult words in the target language, including:

[0027] Acquire third example information corresponding to the third prompt information;

[0028] With the original text as a constraint condition and the third prompt information and the third example information as an explanation guide, the difficult words in the original text are explained word by word to obtain a translation text of the difficult words in the target language.

[0029] In some embodiments, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation, including:

[0030] Constructing fourth prompt information related to the source language and the target language, and inputting the fourth prompt information, the original text, the initial translation text and the difficult word translation text into a preset large language model, wherein the fourth prompt information is used to instruct to correct the demonstration initial word translation according to the demonstration difficult word translation text;

[0031] With the original text and the initial translation text as constraints and the fourth prompt information as a correction guide, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation.

[0032] In some embodiments, the original text and the initial translation text are used as constraints, the fourth prompt information is used as a correction guide, and the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation, including:

[0033] Acquire fourth example information corresponding to the fourth prompt information;

[0034] With the original text and the initial translation text as constraints, and with the fourth prompt information and the fourth example information as correction guides, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation.

[0035] In some embodiments, updating the initial translation text based on the target word translation to obtain the target text of the original text in the target language includes:

[0036] Performing a translation quality evaluation on the initial translation text to obtain a first translation score, and performing a translation quality evaluation on the initial translation text updated based on the target word translation to obtain a second translation score;

[0037] When the second translation score is greater than the first translation score, it is determined to update the initial translation text to the target text based on the target word translation.

[0038] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a text translation device, the device comprising:

[0039] An acquisition module, used to acquire the original text in the source language;

[0040] A preliminary translation module is used to perform preliminary translation of the original text to obtain an initial translation text in the target language, and determine the difficult words in the original text and the initial word translation of the difficult words in the initial translation text based on the original text and the initial translation text;

[0041] A word interpretation module is used to interpret the difficult words in the original text separately to obtain the translation text of the difficult words in the target language;

[0042] The target translation module is used to correct the initial word translation based on the difficult word translation text to obtain a corrected target word translation, and to update the initial translation text based on the target word translation to obtain an updated target text in the target language.

[0043] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the method of the above-mentioned first aspect when executing the computer program.

[0044] To achieve the above objectives, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.

[0045] The text translation method, device, electronic device and storage medium proposed in the present application obtain an original text in a source language; perform a preliminary translation of the original text to obtain an initial translation text in a target language, and determine the difficult words in the original text and the initial translation text based on the original text and the initial translation text; since the meaning of the corresponding words in a specific context is different from the meaning under the general translation, the initial translation text may contain some inaccuracies, unsmoothness or areas that need improvement. After determining the difficult words in the original text, the difficult words in the original text are interpreted individually to obtain the translation text of the difficult words in the target language; in this way, the difficult words are processed in a targeted manner, and a better word translation result corresponding to the difficult words is determined according to the targeted processing result; then, the initial word translation is corrected based on the translation text of the difficult word to obtain a corrected target word translation, and the initial translation text is updated based on the target word translation to obtain a highly accurate target text corresponding to the original text in the target language, thereby improving the translation quality of the original text. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a schematic diagram of an optional application scenario of the text translation device provided in the embodiment of the present application;

[0047] Figure 2 is an optional flowchart of the text translation method provided in the embodiment of the present application;

[0048] Figure 3 is another optional flowchart of the text translation method provided in the embodiment of the present application;

[0049] Figure 4 yes Figure 2 A flowchart of an implementation of step 102 in FIG.

[0050] Figure 5 yes Figure 4 A flowchart of an implementation of step 202 in FIG.

[0051] Figure 6 yes Figure 2 Another implementation flowchart of step 102 in FIG.

[0052] Figure 7 yes Figure 6 Another implementation flow chart of step 403 in FIG.

[0053] Figure 8 yes Figure 2 Another implementation flow chart of step 103 in FIG.

[0054] Fig. 9 yes Figure 8A flowchart of an implementation of step 602 in FIG.

[0055] Fig.10 yes Figure 2 A flowchart of an implementation of step 104 in FIG.

[0056] Fig.11 yes Fig.10 A flowchart of an implementation of step 802 in FIG.

[0057] Fig.12 yes Figure 2 Another implementation flowchart of step 104 in FIG.

[0058] Fig.13 is an optional flow chart of a text translation device provided in an embodiment of the present application;

[0059] Fig.14 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0063] First, some nouns involved in this application are analyzed:

[0064] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0065] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as text translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0066] With the rapid development of science and technology and economy, multilingual communication has become a trend. In order to overcome language barriers and improve communication efficiency, machine translation has emerged. Machine translation is a type of text translation that aims to automatically translate sentences in one natural language (source language) into sentences in another natural language (target language).

[0067] Generally, text translation is achieved using a large language model. However, the large language model in the related art directly applies the general interpretation of the words to be translated to the sentence translation, which causes a deviation between the general understanding of the words to be translated and the specific understanding of the words to be translated in the source language sentence scenario, thereby resulting in inaccurate text translation results.

[0068] Based on this, the embodiments of the present application provide a text translation method, device, electronic device and storage medium, aiming to improve the accuracy of text translation results.

[0069] It should be noted that in the embodiments of the present application, when it comes to information related to user characteristics such as user basic information or user identity, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the user's separate permission or separate consent will be obtained first. After the user's separate permission or separate consent is clearly obtained, the necessary data for the normal operation of the embodiments of the present application will be obtained. For example, when the original text in the source language obtained in the embodiments of the present application contains the user's personal information, such as name, address, telephone number, email address, etc., the consent of the relevant user will be obtained first, otherwise the original text used in the embodiments of the present application cannot be obtained.

[0070] The text translation method, device, electronic device, and storage medium provided in the embodiments of the present application will be described through the following embodiments. First, the application scenario of the text translation device in the embodiments of the present application is described. Figure 1 As shown, Figure 1 The present invention is a schematic diagram of an optional application scenario of the text translation device provided in an embodiment of the present application. In an implementation scenario, an original text obtained by the text translation device is in Chinese, and the text translation device needs to translate the original text in Chinese into English. Based on this, first, the original text is input into the text translation device in the embodiment of the present application; then, the text translation device performs a preliminary translation on the original text to obtain an initial translation text in English. It should be noted that the translation quality of the initial translation text obtained at this time is poor, and some words in the original text are not accurately translated; then, based on the original text and the initial translation text, the difficult words in the original text and the initial word translations of the difficult words in the initial translation text are determined; then, the difficult words in the original text are interpreted separately to obtain the difficult word translation text in English; finally, the initial word translation is corrected based on the difficult word translation text to obtain the corrected target word translation, and the initial translation text is updated based on the target word translation to obtain the target text of the original text in English. It is understandable that the embodiment of the present application will correct the initial word translations with translation errors in the initial translation text by confirming the word translation texts corresponding to the difficult words in the original text, thereby obtaining a target text with a more accurate text translation result.

[0071] After understanding the application scenarios of the text translation device proposed in the present application, the text translation method proposed in the embodiment of the present application is described in detail.

[0072] In the embodiment of the present application, the text translation device will be described from the perspective of the text translation device, which can be integrated into a computer device, such as a server. Figure 2 As shown, Figure 2 is an optional flowchart of the text translation method provided in the embodiment of the present application. Figure 2 The method in the embodiment may include but is not limited to the following steps 101 to 104. When the text translation device executes the text translation method, the specific process is as follows. It should be noted that the present embodiment Figure 2 The order of step 101 to step 104 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0073] Step 101: Obtain the original text in the source language.

[0074] The following is a detailed description of step 101.

[0075] The source language refers to the language used when the text was originally created or written. For example, if a paragraph is written in Chinese, then Chinese is the source language corresponding to the paragraph. In addition, depending on the actual situation, the source language can be any natural language, such as Chinese, French, Japanese, etc., or a programming language or markup language. The embodiments of the present application do not limit the specific type of the source language.

[0076] Among them, the original text refers to the text that has not been translated in any way under the condition that the source language is the text creation condition. The original text contains all the information that the creator originally wanted to express; the original text can be a sentence, a paragraph or an article; the original text can exist in various forms such as text file (TXT), text document (DOC), etc., but no matter what its form is, the original text is the basis for subsequent translation.

[0077] Furthermore, the original text can be obtained from an open database, such as retrieved from a related website. When the amount of original text to be obtained is large, the original text can also be captured by web crawler technology; alternatively, the original text can also be obtained by the user manually inputting it into the text translation device in real time; of course, the embodiment of the present application does not limit the method for obtaining the original text, and it can be adaptively adjusted according to actual conditions.

[0078] Step 102, preliminarily translate the original text to obtain an initial translation text in the target language, and determine the difficult words in the original text and the initial word translations of the difficult words in the initial translation text based on the original text and the initial translation text.

[0079] The following is a detailed description of step 102.

[0080] The target language refers to the language corresponding to the text that the user expects the text translation device to translate. For example, if the text translation device is translating an English article into Chinese, then Chinese is the target language.

[0081] Furthermore, if Figure 3 As shown, Figure 3 This is another optional flow chart of the text translation method provided in the embodiment of the present application. The text translation device first performs a preliminary translation on the received original text. The preliminary translation refers to converting the original text into an initial version of the text in the target language. It is understandable that since the meaning of some words in the original text in a specific context is different from that in the universal translation, the initial translation text obtained by the preliminary translation may contain some inaccuracies, unsmoothness or areas that need improvement. For example, Figure 3 In the example, the original text is "Many commentators point out that his collapse in the entertainment industry was mainly caused by his own 'digging pit'", and the result of the text translation device's preliminary translation of the original text is "Many commentators point out that his collapse in the entertainment industry was mainly caused by his own 'digging pit'", however, "digging pit" means digging a pit, which is inconsistent with the meaning of the word "digging pit" in the original text in the whole paragraph. That is to say, if the initial translation result is directly output as the translation result in the target language, the translation is obviously inaccurate. Therefore, after obtaining the initial translation text, the embodiment of the present application will determine the difficult words in the original text based on the initial translation text, so as to perform targeted processing on the difficult words later, and better improve the translation quality of the original text according to the results after the targeted processing.

[0082] In some embodiments, Figure 4 As shown, Figure 4 yes Figure 2 A flowchart for implementing step 102 in the embodiment of the present invention is to perform a preliminary translation of the original text to obtain an initial translation text in the target language, including the following steps 201 to 202:

[0083] Step 201, constructing first prompt information related to the source language and the target language, and inputting the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct to translate the demonstration original text into a demonstration initial translation text, and the demonstration initial translation text includes a demonstration initial word translation.

[0084] Step 202: perform a preliminary translation on the original text using the original text as a constraint condition and the first prompt information as a translation guide to obtain an initial translation text in the target language.

[0085] Steps 201 to 202 are described in detail below.

[0086] In some embodiments, in order to improve the efficiency and accuracy of the large language model's translation of the original text, the first prompt information is also input into the large language model while the original text is input into the large language model. The large language model is a type of artificial intelligence model that uses a large amount of data for training, and is designed to perform natural language processing on the input text. The amount of data it processes is very large, usually in the billions to hundreds of billions. Among them, the LLM model can be:

[0087] (1) Generative Pre-trained Transformer (GPT): A model developed by OpenAI with 175 billion parameters that can generate text and / or code based on short written prompts. ChatGPT is an application example of the GPT series and is widely used in scenarios such as dialogue generation and knowledge question answering.

[0088] (2) Pretrained Language Model: A pretrained language model is a model that is pre-trained on large-scale text data to learn a general representation of a language to complete natural language processing tasks. Pretrained language models include but are not limited to Bidirectional Encoder Representations from Transformers (BERT), Robert pretrained model (RoBERTa), A Lite version of BERT (ALBERT), etc.

[0089] (3) Neural Network Language Model (NLM): It is a type of language model used to overcome the curse of dimensionality. It uses distributed representation of words to model natural language sequences to capture the complex features of the input text. NLM models include but are not limited to Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU).

[0090] It should be noted that, in addition to the above-mentioned types of large language models, the large language model of the present application can also select other models with natural language processing capabilities according to actual conditions. That is, the embodiments of the present application do not limit the specific type of the large language model.

[0091] In some embodiments, illustratively, the original text (x) is first input into the large language model:

[0092] [Source Sentencex];

[0093] Next, input the first prompt information (Request1) to the large language model:

[0094] Request1:Please translate the[L s ]sentence into[L t ].

[0095] Among them, [L s ] indicates the language of the sentence to be translated (source language), [L t ] represents the target language (target language) of translation. It should be noted that the interpretations of the same parameters in the embodiments of the present application are the same, and the repeated parts will not be repeated; the first prompt information is used to demonstrate the translation of the original text into the demonstration initial translation text. The demonstration original text refers to the text to be translated for display or testing, and the demonstration initial translation text refers to the preliminary translation result of the demonstration original text into the target language; when the original text is input into the large language model, the large language model can clarify the translation target based on the first prompt information, and then obtain the initial translation text corresponding to the original text.

[0096] Furthermore, the original text and the first prompt information may constitute a first prompt template:

[0097] Request1:Please translate the[L s ]sentence into[L t ].

[0098] #followed by Source Sentence:[Source Sentencex].

[0099] Furthermore, the large language model can perform a preliminary translation of the original text using the original text in the first prompt template as a translation constraint and the first prompt information as a translation guide to obtain an initial translated text in the target language.

[0100] It should be noted that the first prompt information can be selectively enriched according to actual conditions. For example, the first prompt information can also include instructions for translation style, such as formal, colloquial, technical, etc. The embodiment of the present application does not limit the specific instructions contained in the first prompt information.

[0101] In some embodiments, Figure 5 As shown, Figure 5 yes Figure 4 The process of implementing step 202 in the embodiment of the present invention is as follows, wherein the original text is used as a constraint condition and the first prompt information is used as a translation guide to perform a preliminary translation on the original text to obtain an initial translation text in the target language, including the following steps 301 to 302:

[0102] Step 301: Obtain first example information corresponding to first prompt information.

[0103] Step 302: perform a preliminary translation on the original text using the original text as a constraint condition and the first prompt information and the first example information as a translation guide to obtain an initial translation text in the target language.

[0104] Steps 301 to 302 are described in detail below.

[0105] In some embodiments, in order to further improve the efficiency and accuracy of the translation of the original text by the large language model, the first example information can be inputted while inputting the original text and the first prompt information. The first example information is an example showing how to perform a preliminary translation of the demonstration original text to obtain the demonstration initial translation text. The number of examples of the first example information can be one or more, which can be set according to the actual situation.

[0106] For example, the first prompt template consisting of the original text, the first prompt information and the first example information is input into the large language model:

[0107] Request1:Please translate the[L s ]sentence into[L t ];

[0108] #followed by[NDemonstrationsε mt ];

[0109] Source Sentence: [Source Sentencex].

[0110] Among them, N represents the number of first example information, and N in the following text also represents the number of corresponding example information, which will not be repeated.

[0111] Furthermore, the large language model can perform a preliminary translation of the original text using the original text as a constraint and the first prompt information and the first example information as a translation guide to obtain an initial translation text in the target language. It is understandable that since the first example information provides specific cases for the large language model to perform a preliminary translation of the original text, these cases can guide the large language model on how to perform a preliminary translation of similar original texts into initial translation texts, thereby improving the preliminary translation capability of the large language model.

[0112] It should be noted that the first example information can be adaptively adjusted according to the difference between the source language and the target language, and the first example information corresponds to the translation requirement of the first prompt information.

[0113] In some embodiments, Figure 6 As shown, Figure 6 yes Figure 2 Another implementation flow chart of step 102 in the embodiment of the present invention is to determine the difficult words in the original text based on the original text and the initial translation text, including the following steps 401 to 403:

[0114] Step 401, constructing second prompt information related to the source language and the target language, and inputting the second prompt information, the original text and the initial translation text into a preset large language model, wherein the second prompt information is used to indicate the determination of difficult words for the demonstration from the original text of the demonstration.

[0115] Step 402: Retrieve computing power resources based on the second prompt information, where the computing power resources include internal computing power resources and external computing power resources.

[0116] Step 403, using the second prompt information as a parsing guide, using computing resources to perform text parsing on the original text and the initial translation text to obtain difficult words.

[0117] Steps 401 to 403 are described in detail below.

[0118] In some embodiments, Figure 3 As shown, after obtaining the initial translation text, the large language model will determine the difficult words in the original text during the translation process by comparing the original text and the initial translation text. It is understandable that due to cross-language differences or different contexts, the difficult words in the initial translation text are likely to be expressed in an inaccurate, unfluent or difficult to understand form. Therefore, determining the difficult words in the original text will help to further perform natural language processing on it, thereby improving the accuracy of the translation.

[0119] Furthermore, in order to improve the efficiency and accuracy of the large language model in determining difficult words, the second prompt information is also input into the large language model while the original text and the initial translation text are input into the large language model.

[0120] For example, the original text (x) and the initial translation text are first input into the large language model.

[0121] [Source Sentencex];

[0122]

[0123] Next, input the second prompt information (Request2) to the large language model:

[0124] Request2:Given a[L s ]sentence and its draft[L t ]translation,output themistranslated words in the[L s ]sentence.

[0125] Among them, the second prompt information is used to determine the difficult words of the demonstration from the original text of the demonstration. The difficult words of the demonstration refer to the words in the original text of the demonstration that are ambiguous in meaning and have the characteristics of specific context translation; when the original text is input into the large language model, the large language model can clarify the parsing target based on the second prompt information, and parse the original text, and then determine the corresponding difficult words of the original text.

[0126] Furthermore, the original text, the initial translation text and the second prompt information may constitute a second prompt template:

[0127] Request2: Given a[L s ]sentence and its draft[L t ]translation,output themistranslated words in the[L s ]sentence.

[0128] #followed by Source Sentence:[Given Sentencex];

[0129]

[0130] Furthermore, the large language model can use the second prompt information in the second prompt template as a parsing guide, and use the retrieved computing resources to perform text parsing on the original text and the initial translation text to obtain the corresponding difficult words in the original text:

[0131] It should be noted that the second prompt information can be selectively enriched according to actual conditions. For example, the second prompt information can include an indication of the scope of difficult words, such as difficult words are special terms in specific fields (such as "pain points" in the Internet field), cultural or regional characteristic vocabulary, emotional color implications, etc. That is, the embodiment of the present application does not limit the specific indication content contained in the second prompt information.

[0132] Furthermore, when the large language model receives the second prompt information, it can retrieve computing resources based on the second prompt information, so that the large language model interprets the original text and the initial translation text based on the retrieved different computing resources as parsing support to obtain difficult words. Among them, internal computing resources refer to the resources of the large language model itself, and external computing resources refer to resources outside the large language model.

[0133] Furthermore, the large language model can determine the difficult words in the original text based only on internal computing resources, or can determine the difficult words in the original text only by introducing external computing resources; or, first determine the first difficult words based on internal computing resources, and then determine the second difficult words based on external computing resources. The union of the first difficult words and the second difficult words can be taken as the final determined difficult words, or the intersection of the first difficult words and the second difficult words can be taken as the final determined difficult words.

[0134] In some embodiments, Figure 7 As shown, Figure 7 yes Figure 6 Another implementation flow chart of step 403 in the embodiment of the present invention uses the second prompt information as a parsing guide, uses computing resources to perform text parsing on the original text and the initial translation text, and obtains difficult words, including the following steps 501 to 502:

[0135] Step 501: Acquire second example information corresponding to second prompt information.

[0136] Step 502: Using the second prompt information and the second example information as analysis guides, computing resources are used to perform text analysis on the original text and the initial translation text to obtain difficult words.

[0137] Steps 501 to 502 are described in detail below.

[0138] In some embodiments, in order to further improve the efficiency and accuracy of the large language model in determining difficult words from the original text, the second example information can be input into the large language model while the original text, the initial translation text and the second prompt information are input into the large language model. The second example information is an example showing how to determine the difficult words for the demonstration from the original text of the demonstration. The number of examples of the second example information can be one or more, which can be set according to the actual situation.

[0139] For example, the second prompt template consisting of the original text, the second prompt information, the initial translation text and the second example information is input into the large language model:

[0140] Request2: Given a[L s ]sentence and its draft[L t ]translation,output themistranslated words in the[L s ]sentence.

[0141] #followed by[BDemonstrationsε diff ];

[0142] Source Sentence:[Given Sentencex];

[0143]

[0144] Among them, ε diff Indicates the second example information.

[0145] Furthermore, the second prompt information and the second example information are used as parsing guides, and the retrieved computing resources are used to perform text parsing on the original text and the initial translation text to obtain difficult words. It is understandable that since the second example information shows specific cases of how to determine the difficult words of the demonstration from the original text of the demonstration, these cases can guide the large language model on how to determine the corresponding difficult words from similar original texts, thereby improving the parsing ability of the large language model.

[0146] It should be noted that the second example information can be adaptively adjusted according to the difference between the source language and the target language, and the second example information corresponds to the parsing requirement of the second prompt information.

[0147] Furthermore, depending on the computing resources retrieved, the large language model can determine difficult words in the original text in different ways.

[0148] In some embodiments, after receiving the second prompt template, the large language model can identify the difficult words in the source sentence based on the model's own intrinsic knowledge indicated by the internal computing resources; specifically, the large language model uses greedy decoding to identify the difficult words. The process of ground identification is expressed as follows <1> :

[0149]

[0150] Wherein, θ represents a large-scale language model; P is a preset probability function, which is based on the second example information As a parsing guide to identify difficult words in the original text; argmax is a function that represents the independent variable that obtains the maximum value from the function P.

[0151] Among them, greedy decoding directly selects the candidate word with the highest probability in the current step as the current output. That is, for each generation position, the large language model selects the word or character with the highest probability from the output distribution and then adds it to the generated sequence. This process continues until the predetermined sequence length is reached or a specific end tag is encountered.

[0152] In some embodiments, after receiving the second prompt template, the large language model can also introduce external computing resources to better determine the difficult words. Specifically, in the process of determining the final difficult words, the large language model performs K temperature sampling non-greedy decoding to expand the capture range of difficult words, reduce the omission of difficult words, and thus improve the accuracy of the final translation. The union of all sampling results is used as the candidate set of difficult words. The process is expressed as follows <2> :

[0153]

[0154] T represents the sampling temperature of the large language model; temperature sampling is a commonly used decoding strategy. It adjusts the probability distribution of the next generated vocabulary through a parameter K (i.e., temperature), thereby controlling the quality and diversity of the generated content.

[0155] Furthermore, after the difficult words are initially screened based on the internal computing resources / external computing resources, the obtained difficult words can be further screened to refine the difficult words corresponding to the original text.

[0156] In some embodiments, when the computing power resources retrieved are internal computing power resources, the inherent capabilities of the large language model are used to further screen the difficult words in the candidate set to determine the final selected difficult words.

[0157] In some embodiments, when the computing power resources retrieved are external computing power resources, the external computing power resources may be external tools with translation quality assessment capabilities, such as token-level translation quality assessment φ(·); at this time, the external tool scores each candidate word and quantifies its degree of error relative to the initial translation text, thereby reflecting the difficulties faced by each word in translation, and further determining the difficult words. It should be noted that the external tool can be selected according to actual conditions, and the embodiments of the present application do not limit this. The process of determining the final difficult words based on external computing power resources is expressed as follows: <3> :

[0158]

[0159] Where d represents the candidate set Any of the difficult words in the initial screening; the embodiment of the present application is based on the formula <3> The words with a score φ(d)>τ are determined as the final selected difficult words; τ is an adjustable difficulty threshold score used to balance the recall and precision of difficult word recognition.

[0160] Step 103, interpreting the difficult words in the original text separately to obtain the translation text of the difficult words in the target language.

[0161] The following is a detailed description of step 103.

[0162] In some embodiments, after the difficult words are determined, the difficult words in the original text are interpreted individually to determine other interpretations of the difficult words in addition to the initial word translation, so that the large language model can understand the difficult words more deeply, and then be able to better determine the optimal translation of the difficult words based on the context corresponding to the original text and the initial translation text.

[0163] In some embodiments, Figure 8 As shown, Figure 8 yes Figure 2 Another implementation flow chart of step 103 in the embodiment of the present invention is to interpret the difficult words in the original text separately to obtain the translation text of the difficult words in the target language, including the following steps 601 to 602:

[0164] Step 601, construct third prompt information related to the source language and the target language, and input the third prompt information, the original text and the difficult words into a preset large language model, wherein the third prompt information is used to instruct to interpret the demonstration difficult words individually to obtain the demonstration difficult words translation text.

[0165] Step 602: Taking the original text as a constraint and the third prompt information as an explanation guide, interpret the difficult words in the original text separately to obtain a translation text of the difficult words in the target language.

[0166] Steps 601 to 602 are described in detail below.

[0167] In some embodiments, in order to improve the efficiency and accuracy of the large language model in interpreting difficult words alone, the third prompt information is also input into the large language model while the original text and difficult words are input into the large language model.

[0168] Exemplarily, the original text (x) and the initial translation text (D) are first input into the large language model:

[0169] Source Sentence:[Given Sentencex];

[0170] Difficult Words:[Difficult WordsD].

[0171] Next, the third prompt information (Request3) is input to the large language model:

[0172] Request3: Given a[L s ]sentence,provide the concise interpretation foreach difficult word with the[L t ].

[0173] Wherein, D is a set of difficult words; the third prompt information is used to instruct to translate the demonstration difficult words separately and obtain the corresponding difficult word translation text. When the original text and difficult words are input into the large language model, the large language model can clearly interpret the target based on the third prompt information, and then obtain the difficult word translation text of the difficult words in the target language.

[0174] Furthermore, the original text, the difficult word set and the third prompt information can constitute a third prompt template:

[0175] Request: Given a[L s ]sentence,provide the concise interpretation foreach difficult word with the[L t ].

[0176] #followed by Source Sentence:[Given Sentencex];

[0177] Difficult Words:[Difficult WordsD].

[0178] Furthermore, the large language model can use the original text as a constraint and the third prompt information as an interpretation guide to perform word interpretation on the difficult words in the original text separately, and obtain the translation text of the difficult words in the target language.

[0179] It should be noted that the third prompt information can be selectively enriched according to actual conditions. For example, the third prompt information can also include instructions for the interpretation style, such as formal, colloquial, technical, etc. The embodiment of the present application does not limit the specific instructions contained in the third prompt information.

[0180] In some embodiments, Fig. 9 As shown, Fig. 9 yes Figure 8 A flowchart for implementing step 602 in the method, taking the original text as a constraint condition and the third prompt information as an explanation guide, interpreting the difficult words in the original text separately to obtain the translation text of the difficult words in the target language, including the following steps 701 to 702:

[0181] Step 701: Obtain third example information corresponding to third prompt information.

[0182] Step 702: Taking the original text as a constraint condition and the third prompt information and the third example information as an explanation guide, interpret the difficult words in the original text separately to obtain a translation text of the difficult words in the target language.

[0183] Steps 701 to 702 are described in detail below.

[0184] In some embodiments, in order to further improve the efficiency and accuracy of the large language model's interpretation of difficult words, the third example information can be input into the original text and difficult words at the same time. The third example information is such an example: showing the translation of the demonstration difficult words to obtain the demonstration difficult word translation text. The number of examples of the third example information can be one or more, which can be set according to the actual situation.

[0185] For example, the third prompt template consisting of the original text, the third prompt information, the difficult words and the third example information is input into the large language model:

[0186] Request: Given a[L s]sentence,provide the concise interpretation foreach difficult word with the[L t ].

[0187] #followed by[NDemonstrationsε intp ];

[0188] Source Sentence:[Given Sentencex];

[0189] Difficult Words:[Difficult WordsD].

[0190] Among them, ε intp Indicates the third example information.

[0191] Further, based on the third prompt template, the difficult words are translated into words to obtain a set of explanations of each difficult word. Explain the collection The generation process is expressed as follows <4> :

[0192]

[0193] in, x i To demonstrate the original text, To demonstrate difficult words, Translate text for difficult words in the demonstration.

[0194] Furthermore, the large language model can interpret the difficult words in the original text individually with the original text as a constraint and the third prompt information and the third example information as an interpretation guide to obtain the difficult word translation text in the target language. It can be understood that since the third example information provides specific examples for how the large language model can interpret the difficult words individually, these examples can guide the large language model on how to interpret similar difficult words, thereby improving the word translation ability of the large language model.

[0195] It should be noted that the third example information can be adaptively adjusted according to the difference between the source language and the target language, and the third example information corresponds to the interpretation requirement of the third prompt information.

[0196] Step 104, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation, and the initial translation text is updated based on the target word translation to obtain a target text of the original text in the target language.

[0197] Step 104 is described in detail below.

[0198] In some embodiments, Figure 3 As shown, after the difficult word translation text is determined, the initial word translation is corrected based on the difficult word translation text to optimize the translation quality of the difficult words, and then the initial translation text is updated by the corrected target word translation, thereby improving the translation accuracy of the obtained target text.

[0199] In some embodiments, Fig.10 As shown, Fig.10 yes Figure 2 A flowchart for implementing step 104 in the embodiment of the present invention, in which the initial word translation is corrected based on the difficult word translation text to obtain the corrected target word translation, includes the following steps 801 to 802:

[0200] Step 801, construct fourth prompt information related to the source language and the target language, and input the fourth prompt information, the original text, the initial translation text and the difficult word translation text into a preset large language model, wherein the fourth prompt information is used to instruct to correct the demonstration initial word translation according to the demonstration difficult word translation text.

[0201] Step 802, taking the original text and the initial translation text as constraint conditions and the fourth prompt information as a correction guide, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation.

[0202] Steps 801 to 802 are described in detail below.

[0203] In some embodiments, in order to improve the efficiency and accuracy of the large language model in correcting the initial word translation based on the difficult word translation text, the fourth example information can also be input into the large language model while the original text, the initial translation text and the difficult word translation text are input into the large language model.

[0204] For example, the original text (x) and the initial translation text (x) are first input into the large language model. And difficult word translation text:

[0205] Source Sentence:[Given Sentencex];

[0206]

[0207]

[0208] Next, the fourth prompt information (Request4) is input to the large language model:

[0209] Request4: Given a[L s ]sentence and its draft[L t ]translation, please revise the translation according to the interpretations of the difficult words.

[0210] in, is a collection of difficult word translation texts; when the original text, the initial translation text and the difficult word translation text are input into the large language model, the large language model can clearly correct the target based on the fourth prompt information, and then correct the initial word translation based on the difficult word translation text to obtain the corrected target word translation.

[0211] Furthermore, the original text, the difficult word set and the fourth prompt information can constitute a fourth prompt template:

[0212] Request4: Given a[L s ]sentence and its draft[L t ]translation, please revise the translation according to the interpretations of the difficult words.

[0213] #followed by Source Sentence:[Given Sentencex];

[0214]

[0215] Furthermore, the large language model can use the original text and the initial translation text as constraints and the fourth prompt information as a correction guide to correct the initial word translation based on the difficult word translation text to obtain a corrected target word translation.

[0216] It should be noted that the fourth prompt information can be selectively enriched according to actual conditions. For example, the fourth prompt information can also include instructions for translation correction, such as direct replacement, re-translation based on the translation of difficult words, etc. The embodiment of the present application does not limit the specific instructions contained in the fourth prompt information.

[0217] In some embodiments, Fig.11 As shown, Fig.11 yes Fig.10 A flowchart for implementing step 802 in the embodiment of the present invention, taking the original text and the initial translation text as constraints, taking the fourth prompt information as a correction guide, correcting the initial word translation based on the difficult word translation text, and obtaining the corrected target word translation, including the following steps 901 to 902:

[0218] Step 901: Obtain fourth example information corresponding to fourth prompt information.

[0219] Step 902, taking the original text and the initial translation text as constraint conditions, taking the fourth prompt information and the fourth example information as correction guidance, correcting the initial word translation based on the difficult word translation text, and obtaining a corrected target word translation.

[0220] Steps 901 to 902 are described in detail below.

[0221] In some embodiments, in order to further improve the efficiency and accuracy of the large language model in correcting the initial word translation based on the difficult word translation text, the fourth example information can be input while inputting the original text and the fourth prompt information. Among them, the fourth example information is such an example: it shows that the initial word translation of the demonstration is corrected based on the difficult word translation text to obtain the target word translation of the demonstration. The number of examples of the fourth example information can be one or more, which can be set according to the actual situation.

[0222] For example, the fourth prompt template consisting of the original text, the initial translation text, the difficult word translation text, the fourth prompt information and the fourth example information is input into the large language model:

[0223] Request4: Given a[L s ]sentence and its draft[L t ]translation, please revise the translation according to the interpretations of the difficult words.

[0224] #followed by[NDemonstrationsε igt ];

[0225] Source Sentence:[Given Sentencex];

[0226]

[0227] Among them, ε igtThe fourth example information indicates guiding the large language model to generate a translation of a target word.

[0228] Further, based on the fourth prompt template, the initial word translation text is corrected to obtain the target word translation, and then the final target text is obtained. Target text The generation process of is expressed as follows <5> As shown:

[0229]

[0230] in, x i To demonstrate the original text, To demonstrate the initial translation text, Translate text for difficult words in the demonstration, The target text for the demonstration.

[0231] Furthermore, the large language model can use the original text and the initial translation text as constraints, and the fourth prompt information and the fourth example information as correction guides, to correct the initial word translation based on the difficult word translation text to obtain the corrected target word translation. It can be understood that since the fourth example information provides a specific case for how the large language model corrects the demonstration initial word translation based on the demonstration difficult word translation text and obtains the demonstration target word translation, these cases can guide the large language model on how to correct the initial word translation based on similar difficult word translation texts, thereby improving the ability of the large language model to ultimately obtain the corrected target text.

[0232] It should be noted that the fourth example information can be adaptively adjusted according to the difference between the source language and the target language, and the fourth example information corresponds to the correction requirements of the fourth prompt information. For example, if the fourth prompt information requires the large language model to re-translate difficult words in a more official language based on the difficult word translation text to obtain the target word translation, then the fourth example information will include examples of specified style requirements.

[0233] In some embodiments, Fig.12 As shown, Fig.12 yes Figure 2 Another implementation flow chart of step 104 in the embodiment of the present invention is to update the initial translation text based on the target word translation to obtain the target text of the original text in the target language, including the following steps 1001 to 1002:

[0234] Step 1001: perform translation quality evaluation on an initial translation text to obtain a first translation score, and perform translation quality evaluation on an initial translation text updated based on a target word translation to obtain a second translation score.

[0235] Step 1002: When the second translation score is greater than the first translation score, determine to update the initial translation text to the target text based on the translation of the target word.

[0236] The following provides a detailed description of Steps 1001 to 1002.

[0237] In some embodiments, as Figure 3 shown, during the process of updating the initial translation text based on the translation of the target word, if the set of translation texts for difficult words is not used to adjust the initial translation of the word to obtain text sⅠ (i.e., the initial translation text), and the translation quality of text sⅠ is evaluated to obtain the first translation score s1; if the set of translation texts for difficult words is used to adjust the initial translation of the word to obtain text sⅡ, and the translation quality of text sⅡ is evaluated to obtain the second translation score s2; compare s1 and s2. If s1 > s2, it indicates that the translation quality of the initial translation text is better, and the initial translation text remains unchanged; if s1 < s2, it indicates that the translation quality of text sⅠ obtained based on the initial translation of the word is better, and then the initial translation of the word is used as the translation of the target word; otherwise, it indicates that the translation quality of text sⅡ obtained based on the translation text of the difficult word is better, and then the translation text of the difficult word is used as the translation of the target word.

[0238] Among them, the tool for evaluating the translation quality (Translation Quality Evaluation, TQE) of the text can be an integrated translation quality evaluation tool such as QA Checker, MemoQ, etc.; or a stand-alone translation quality evaluation tool such as ApSIC Xbench, ErrorSpy, etc.; of course, the translation quality evaluation tool can also be specifically set according to the actual situation, and the embodiments of the present application do not limit this.

[0239] Exemplarily, in the case of a given original text x, an initial translation text and a set of translation texts for difficult words :

[0240] ① Update the initial translation text based on the elements in the set of translation texts for difficult words to obtain an updated text;

[0241] ② Use a translation quality evaluation tool to evaluate the translation quality of the updated text to obtain the corresponding translation score S1;

[0242] ③ Try to delete each element in in turn, and perform Steps ① and ② to obtain the updated translation score S2;

[0243] ④ If there is S2 > S1, then remove the corresponding element from , and the current updated text is output as the target text obtained by the final translation; in particular, the translation quality assessment tool will also perform a translation quality assessment on the initial translation text to obtain a corresponding translation score S0. If the scores of S1 and any S2 are both less than S0, it is determined that the translation quality of the initial translation text is better, and the initial translation text is output as the target text obtained by the final translation.

[0244] In order to better understand the beneficial effects of the text translation method proposed in this application, an example is given below to illustrate:

[0245] Original text (English): The four-time All-Pro wide receiver wrote on Twitter on Thursday: "I'm still the best why stop now." He followed with the suggestion that the game needs him.

[0246] "I'm still the best, why stop," the four-time All-Star wide receiver wrote on Twitter on Thursday. He went on to offer advice on what the game needs from him.

[0247] It can be found that "All-Stars stop" and "stop" are obviously not translated smoothly.

[0248] In comparison, the target text (Chinese) translated using the text translation method proposed in this application is: "I'm in great shape now, why should I retire now?" The four-time All-Star catcher wrote on Twitter on Thursday. He accepted the advice that the game needed him.

[0249] Specifically, the text translation device provided by the present application first determines that the difficult words corresponding to the original text are "All-Pro", "wide receiver", and "stop now"; and determines that the difficult word translation texts corresponding to each difficult word are "All-Pro means that the athlete is full-time", "wide receiver means the receiver in American football and Canadian football", and "stop now means why you terminate your professional career". It should be noted that there can be one or more difficult word translation texts corresponding to each difficult word, and only one of them is taken as an example here; then, the initial word translation is updated based on the difficult word translation text to obtain a revised target word text; then, the initial translation text is updated according to the revised target word text to obtain the final target text.

[0250] Among them, the standard answer translated from the original text is: "I'm in great shape now, why should I retire now?" the four-time All-Star catcher wrote on Twitter on Thursday, accepting the advice that the game needs him.

[0251] like Fig.13 As shown, Fig.13 110 is an optional flowchart of a text translation device provided in an embodiment of the present application. The text translation device includes the following modules 1101 to 1104:

[0252] The acquisition module 1101 is used to acquire the original text in the source language.

[0253] The preliminary translation module 1102 is used to perform preliminary translation on the original text to obtain an initial translation text in the target language, and determine the difficult words in the original text and the initial word translation of the difficult words in the initial translation text based on the original text and the initial translation text.

[0254] The word interpretation module 1103 is used to perform word interpretation on the difficult words in the original text separately to obtain the translation text of the difficult words in the target language.

[0255] The target translation module 1104 is used to correct the initial word translation based on the difficult word translation text to obtain a corrected target word translation, and to update the initial translation text based on the target word translation to obtain an updated target text in the target language.

[0256] The text translation method, device, electronic device and storage medium proposed in the present application obtain an original text in a source language; perform a preliminary translation of the original text to obtain an initial translation text in a target language, and determine the difficult words in the original text and the initial translation text based on the original text and the initial translation text; since the meaning of the corresponding words in a specific context is different from the meaning under the general translation, the initial translation text may contain some inaccuracies, unsmoothness or areas that need improvement. After determining the difficult words in the original text, the difficult words in the original text are interpreted individually to obtain the translation text of the difficult words in the target language; in this way, the difficult words are processed in a targeted manner, and a better word translation result corresponding to the difficult words is determined according to the targeted processing result; then, the initial word translation is corrected based on the translation text of the difficult word to obtain a corrected target word translation, and the initial translation text is updated based on the target word translation to obtain a highly accurate target text corresponding to the original text in the target language, thereby improving the translation quality of the original text.

[0257] The specific implementation of the text translation device is substantially the same as the specific implementation of the above-mentioned text translation method, and will not be described in detail here.

[0258] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above text translation method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0259] like Fig.14 As shown, Fig.14 : is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application, the electronic device includes:

[0260] The processor 1201 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0261] The memory 1202 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1202 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1202, and the processor 1201 calls and executes the text translation method of the embodiment of this application;

[0262] Input / output interface 1203, used to implement information input and output;

[0263] The communication interface 1204 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0264] A bus 1205 that transmits information between the various components of the device (e.g., the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204);

[0265] The processor 1201 , the memory 1202 , the input / output interface 1203 and the communication interface 1204 are connected to each other in communication within the device via the bus 1205 .

[0266] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned text translation method is implemented.

[0267] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0268] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0269] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0270] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0271] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0272] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0273] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0274] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0275] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0276] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0277] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0278] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A text translation method, characterized in that: The method comprises: Get the original text in the source language; Performing a preliminary translation on the original text to obtain an initial translation text in a target language, and determining difficult words in the original text and initial word translations of the difficult words in the initial translation text based on the original text and the initial translation text; Performing word interpretation on the difficult words in the original text separately to obtain a translation text of the difficult words in the target language; The initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation, and the initial translation text is updated based on the target word translation to obtain a target text of the original text in a target language.

2. The method according to claim 1, characterized in that The preliminary translation of the original text to obtain an initial translation text in the target language includes: Constructing first prompt information related to the source language and the target language, and inputting the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct to translate the demonstration original text into a demonstration initial translation text, and the demonstration initial translation text includes a demonstration initial word translation; The original text is initially translated with the original text as a constraint condition and the first prompt information as a translation guide to obtain an initial translation text in the target language.

3. The method according to claim 2, characterized in that The method of performing a preliminary translation of the original text using the original text as a constraint condition and the first prompt information as a translation guide to obtain an initial translation text in a target language includes: Acquire first example information corresponding to the first prompt information; The original text is used as a constraint condition and the first prompt information and the first example information are used as translation guides to perform a preliminary translation on the original text to obtain an initial translation text in a target language.

4. The method according to claim 2, characterized in that: The determining of difficult words in the original text based on the original text and the initial translation text comprises: Constructing second prompt information related to the source language and the target language, and inputting the second prompt information, the original text and the initial translation text into a preset large language model, wherein the second prompt information is used to indicate determining difficult words for demonstration from the original demonstration text; Retrieving computing power resources based on the second prompt information, wherein the computing power resources include internal computing power resources and external computing power resources; The second prompt information is used as a parsing guide, and the computing resources are used to perform text parsing on the original text and the initial translation text to obtain the difficult words.

5. The method according to claim 4, characterized in that The step of using the second prompt information as a parsing guide and utilizing the computing resources to perform text parsing on the original text and the initial translation text to obtain the difficult words includes: Acquire second example information corresponding to the second prompt information; The second prompt information and the second example information are used as analysis guides, and the computing resources are used to perform text analysis on the original text and the initial translation text to obtain the difficult words.

6. The method according to claim 4, characterized in that The step of performing word interpretation on the difficult words in the original text to obtain a translation text of the difficult words in the target language includes: Constructing third prompt information related to the source language and the target language, and inputting the third prompt information, the original text and the difficult words into a preset large language model, wherein the third prompt information is used to instruct to interpret the demonstration difficult words separately to obtain a demonstration difficult word translation text; Taking the original text as a constraint condition and the third prompt information as an explanation guide, the difficult words in the original text are individually explained to obtain a translation text of the difficult words in the target language.

7. The method according to claim 6, characterized in that The step of using the original text as a constraint condition and the third prompt information as an explanation guide to interpret the difficult words in the original text separately to obtain a translation text of the difficult words in the target language includes: Acquire third example information corresponding to the third prompt information; Taking the original text as a constraint condition and the third prompt information and the third example information as an explanation guide, the difficult words in the original text are individually explained to obtain a translation text of the difficult words in the target language.

8. The method according to claim 6, characterized in that The step of correcting the initial word translation based on the difficult word translation text to obtain a corrected target word translation includes: Constructing fourth prompt information related to the source language and the target language, and inputting the fourth prompt information, the original text, the initial translation text and the difficult word translation text into a preset large language model, wherein the fourth prompt information is used to instruct to correct the demonstration initial word translation according to the demonstration difficult word translation text; The original text and the initial translation text are used as constraint conditions, the fourth prompt information is used as a correction guide, and the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation.

9. The method according to claim 8, characterized in that The method of using the original text and the initial translation text as constraint conditions and the fourth prompt information as a correction guide, and correcting the initial word translation based on the difficult word translation text to obtain a corrected target word translation, includes: Acquire fourth example information corresponding to the fourth prompt information; Taking the original text and the initial translation text as constraint conditions, taking the fourth prompt information and the fourth example information as correction guides, the initial word translation is corrected based on the difficult word translation text to obtain a corrected target word translation.

10. The method according to claim 1, characterized in that The updating of the initial translation text based on the target word translation to obtain a target text of the original text in the target language includes: Performing a translation quality evaluation on the initial translation text to obtain a first translation score, and performing a translation quality evaluation on the initial translation text updated based on the target word translation to obtain a second translation score; When the second translation score is greater than the first translation score, it is determined to update the initial translation text to the target text based on the target word translation.

11. A text translation device, characterized in that: The device comprises: An acquisition module, used to acquire the original text in the source language; A preliminary translation module, configured to perform preliminary translation on the original text to obtain an initial translation text in a target language, and determine difficult words in the original text and initial word translations of the difficult words in the initial translation text based on the original text and the initial translation text; A word interpretation module, used to interpret the difficult words in the original text separately to obtain a translation text of the difficult words in the target language; The target translation module is used to correct the initial word translation based on the difficult word translation text to obtain a corrected target word translation, and to update the initial translation text based on the target word translation to obtain an updated target text in a target language.

12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 10 when executing the computer program.

13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Text translation method and device, electronic equipment and storage medium

    CN115062631A

  • Large model machine translation method based on RAG

    CN117993396A

  • LLM-based text translation method and apparatus, and program product

    CN118153587A

  • Computing technologies for using large language models to enable translations follow specific style guidelines

    WO2024192093A1

Cited By

  • Embedded translation system and method with content auditing mechanism

    CN121212166A

  • Large language model machine translation optimization method and system

    CN121562641A