Text translation method and apparatus, electronic device, and storage medium

After performing a preliminary translation on the large language model, difficult words were identified and explained. The translation results were then corrected using specific prompts and computing resources. This solved the problem of word comprehension bias in text translation caused by the large language model, and achieved a more accurate translation effect.

CN119398063BActive Publication Date: 2025-11-04PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing large language models directly apply the general interpretation of words to be translated to sentence translation, which leads to deviations in the specific understanding of the words to be translated in the source language sentence context, resulting in inaccurate translation results.

Method used

After obtaining the original text in the source language and performing a preliminary translation, difficult words are identified and explained separately. Specific prompts are constructed using a large language model and computing resources are used for correction, and the translation result is finally updated.

Benefits of technology

It improved the accuracy and quality of text translation, ensured the accurate translation of difficult words in specific contexts, and enhanced the fluency and accuracy of the translation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398063B_ABST
    Figure CN119398063B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a text translation method and device, electronic equipment and storage medium, belonging to the technical field of machine translation. The method comprises: obtaining an original text in a source language; performing preliminary translation on the original text to obtain an initial translation text in a target language, and determining a difficult word in the original text and an initial word translation text of the difficult word in the initial translation text based on the original text and the initial translation text; separately performing word explanation on the difficult word in the original text to obtain a difficult word translation text in the target language; correcting the initial word translation text based on the difficult word translation text to obtain a corrected target word translation text, and updating the initial translation text based on the target word translation text to obtain a target text of the original text in the target language. The present application can improve the accuracy of the text translation result.
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 and device, electronic equipment and a storage medium. BACKGROUND

[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 as the times require. Machine translation (Machine Translation) is a kind of text translation, which aims to automatically translate a sentence in one natural language (source language) into a sentence in another natural language (target language).

[0003] Generally, text translation is realized by using a large language model (Large Language Model, LLM). However, the large language model in the related art directly applies the general interpretation of the word to be translated to sentence translation, which causes the general understanding of the word to be translated to deviate from the specific understanding of the word to be translated in the source language sentence context, and further leads to inaccurate text translation results. SUMMARY

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

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

[0006] obtaining an original text in a source language;

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

[0008] performing word interpretation on the difficult word in the original text to obtain a difficult word translation text in the target language;

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

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

[0011] construct first prompt information related to the source language and the target language, and input the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct to demonstrate the original text to be translated into a demonstration initial translation text, and the demonstration initial translation text includes a demonstration initial word translation;

[0012] perform preliminary translation on the original text under the constraint of the original text and the translation guide of the first prompt information to obtain the initial translation text in the target language.

[0013] In some embodiments, performing preliminary translation on the original text under the constraint of the original text and the translation guide of the first prompt information to obtain the initial translation text in the target language includes:

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

[0015] perform preliminary translation on the original text under the constraint of the original text and the translation guide of the first prompt information and the first example information to obtain the initial translation text in the target language.

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

[0017] construct second prompt information related to the source language and the target language, and input 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 instruct to determine the demonstration difficult word from the demonstration original text;

[0018] invoke computing resource based on the second prompt information, wherein the computing resource includes internal computing resource and external computing resource;

[0019] perform text analysis on the original text and the initial translation text using the computing resource under the analysis guide of the second prompt information to obtain the difficult word.

[0020] In some embodiments, performing text analysis on the original text and the initial translation text using the computing resource under the analysis guide of the second prompt information to obtain the difficult word includes:

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

[0022] perform text analysis on the original text and the initial translation text using the computing resource under the analysis guide of the second prompt information and the second example information to obtain the difficult word.

[0023] In some embodiments, separately performing word explanation on the difficult word in the original text to obtain the difficult word translation text in the target language includes:

[0024] 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 word into a preset large language model, wherein the third prompt information is used to instruct word-by-word interpretation of the demonstration difficult word to obtain a demonstration difficult word translation text;

[0025] word-by-word interpretation of the difficult word in the original text is performed under the constraint of the original text and the interpretation guidance of the third prompt information to obtain the difficult word translation text in the target language.

[0026] In some embodiments, word-by-word interpretation of the difficult word in the original text is performed under the constraint of the original text and the interpretation guidance of the third prompt information to obtain the difficult word translation text in the target language, including:

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

[0028] word-by-word interpretation of the difficult word in the original text is performed under the constraint of the original text and the interpretation guidance of the third prompt information and the third example information to obtain the difficult word translation text in the target language.

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

[0030] 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 correction of the demonstration initial word translation text according to the demonstration difficult word translation text;

[0031] the initial word translation text is corrected based on the difficult word translation text under the constraint of the original text and the initial translation text and the correction guidance of the fourth prompt information to obtain the corrected target word translation text.

[0032] In some embodiments, the initial word translation text is corrected based on the difficult word translation text under the constraint of the original text and the initial translation text and the correction guidance of the fourth prompt information to obtain the corrected target word translation text, including:

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

[0034] the initial word translation text is corrected based on the difficult word translation text under the constraint of the original text and the initial translation text and the correction guidance of the fourth prompt information and the fourth example information to obtain the corrected target word translation text.

[0035] In some embodiments, the initial translation text is updated based on the target word translation to obtain a target text in the target language, including:

[0036] The initial translation text is evaluated for translation quality to obtain a first translation score, and the initial translation text updated based on the target word translation is evaluated for translation quality to obtain a second translation score;

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

[0038] To achieve the above object, a second aspect of the embodiment of the present application provides a text translation device, which comprises:

[0039] The acquisition module is configured to acquire an original text in a source language;

[0040] The preliminary translation module is configured to preliminarily translate the original text to obtain an initial translation text in a target language, and determine a difficult word in the original text and an initial word translation of the difficult word in the initial translation text based on the original text and the initial translation text;

[0041] The word explanation module is configured to separately explain the difficult word in the original text to obtain a difficult word translation text in the target language;

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

[0043] To achieve the above object, a third aspect of the embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.

[0044] To achieve the above object, a fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect.

[0045] The text translation method and device, electronic equipment and storage medium provided by the present application, the original text under the source language is obtained; the original text is preliminarily translated to obtain the initial translation text under the target language, and the difficult word in the original text and the initial word translation text of the difficult word in the initial translation text are determined based on the original text and the initial translation text; At this time, the initial word translation text obtained is different from the meaning of the corresponding word in the specific context and the meaning of the general translation, so the initial translation text may contain some inaccurate, unsmooth or improved places, after determining the difficult word in the original text, the difficult word in the original text is explained separately to obtain the difficult word translation text under the target language; in this way, the difficult word is processed specifically, and the more optimal word translation result corresponding to the difficult word is determined according to the specific processing result; further, the initial word translation text is corrected based on the difficult word translation text to obtain the modified target word translation text, and the initial translation text is updated based on the target word translation text to obtain the high-accuracy target text corresponding to the original text under the target language, and the translation quality of the original text is improved. BRIEF DESCRIPTION OF DRAWINGS

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

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

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

[0049] Figure 4 is Figure 2 an implementation flowchart of step 102 in

[0050] Figure 5 is Figure 4 an implementation flowchart of step 202 in

[0051] Figure 6 is Figure 2 another implementation flowchart of step 102 in

[0052] Figure 7 is Figure 6 another implementation flowchart of step 403 in

[0053] Figure 8 is Figure 2 another implementation flowchart of step 103 in

[0054] Figure 9 is Figure 8One implementation flowchart of step 602 in

[0055] Figure 10 is Figure 2 One implementation flowchart of step 104 in

[0056] Figure 11 is Figure 10 One implementation flowchart of step 802 in

[0057] Figure 12 is Figure 2 Another implementation flowchart of step 104 in

[0058] Figure 13 is one optional flowchart of the text translation apparatus provided by the embodiments of the present application;

[0059] Figure 14 is a hardware structure schematic diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0060] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the 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 apparatus schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the apparatus or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

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

[0063] First, the several terms involved in the present application are analyzed:

[0064] Artificial intelligence (AI): a new technical science that studies, develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, and artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. The research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system of using digital computers or digital computer controlled machines 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 use human language (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and is an interdisciplinary subject of computer science and linguistics, and is also commonly known as computational linguistics. Natural language processing includes syntax analysis, semantic analysis, discourse understanding, etc. Natural language processing is commonly used in 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, etc. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and language computing related linguistic research.

[0066] With the rapid development of 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 kind of text translation, which aims to automatically translate sentences of one natural language (source language) into sentences of another natural language (target language).

[0067] Generally, text translation is implemented by using a large language model. However, the large language model in the related art directly applies the general interpretation of the word to be translated to sentence translation, which causes the general understanding of the word to be translated to deviate from the specific understanding of the word to be translated in the source language sentence context, and further causes the result of text translation to be inaccurate.

[0068] Therefore, the embodiments of the present application provide a text translation method and device, an electronic device and a storage medium, which aims to improve the accuracy of the result of text translation.

[0069] It should be noted that in the embodiments of the present application, when it is necessary to obtain user's basic information or information related to user's characteristics such as user's identity, the user's permission or consent will be obtained first, and the collection, use and processing of the 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 separate permission or separate consent of the user will be obtained first, and after obtaining the separate permission or separate consent of the user, 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 personal information of the user, such as name, address, phone number, email and the like, 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 equipment and storage medium provided by the embodiments of the present application will be described through the following embodiments. First, the application scenario of the text translation device of the embodiments of the present application will be described, as shown in the following figure. Figure 1 Figure 1 is an optional application scenario diagram of the text translation device provided by the embodiments of the present application. In an implementation scenario, the original text obtained by the text translation device is Chinese, and the text translation device needs to translate the original text in the Chinese state into English. Based on this, first, the original text is input into the text translation device in the embodiments of the present application; then, the text translation device performs preliminary translation on the original text to obtain the 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 have not been accurately translated; then, based on the original text and the initial translation text, the difficult words in the original text and the initial word translation in the initial translation text of the difficult words are determined; then, the difficult word translation text in English is obtained by separately explaining the difficult words in the original text; 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 can be understood that the embodiments of the present application will correct the initial word translation with translation errors in the initial translation text by confirming the word translation text corresponding to the difficult words in the original text, and thus the target text with more accurate text translation result can be obtained.

[0071] After understanding the application scenario of the text translation device proposed in the present application, the text translation method proposed in the embodiments of the present application will be described in detail.

[0072] In the embodiments of the present application, the text translation device will be described from the dimension of the text translation device, which can be integrated in a computer device, such as a server. As shown in the following figure,​Figure 2 as shown, Figure 2 is an optional flowchart of the text translation method provided by the embodiment of the present application, Figure 2 The method in the embodiment can 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 first noted that the embodiment does not make specific limitation on the order of steps 101 to 104, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs. Figure 2 The order of steps 101 to 104 is not specifically limited in the embodiment, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

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

[0074] Step 101 is described in detail as follows.

[0075] The source language refers to the language used when the text is originally created or written. For example, if a paragraph is written in Chinese, Chinese is the source language corresponding to the paragraph. According to different actual situations, the source language can be any natural language, such as Chinese, French, Japanese, etc., or a programming language or a markup language. The specific type of the source language is not limited in the embodiment of the present application.

[0076] The original text refers to the text that is not subjected to any translation processing on the basis of the condition that the source language is used for text creation. The original text contains all the information that the author originally wants to express. The original text can be a sentence, a paragraph, or an article. The original text can exist in various forms such as a text file (TXT) and a text document (DOC). Regardless of the form, the original text is the basis for subsequent translation.

[0077] Further, the original text can be obtained from an open database, such as retrieved from a related website. When the number of original texts to be obtained is large, the original text can also be captured by web crawler technology. Alternatively, the original text can also be manually input by a user in real time to the text translation device. Of course, the method for obtaining the original text is not limited in the embodiment of the present application, and can be adaptively adjusted according to actual situations.

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

[0079] Step 102 is described in detail as follows.

[0080] The target language refers to a language corresponding to a 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] Further, as Figure 3 indicated, Figure 3 is another optional flowchart of the text translation method provided by the embodiments of the present application. The text translation device first performs preliminary translation on the received original text. The preliminary translation refers to converting the original text into an initial version of text in the target language. It can be understood that, since the meanings of some words in the original text in a specific context are different from the meanings in general translation, the initial translation text obtained by preliminary translation may contain some inaccuracies, incoherence or needs for 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 preliminary translation of the text translation device on the original text is "Many commentators point out that his collapse in the entertainment industry was mainly caused by his own 'digging pit'". However, the meaning of "digging pit" is to dig a pit, which is inconsistent with the meaning of the word "digging pit" in the original text in the whole paragraph. That is, if the initial translation result is directly output as the translation result in the target language, it is obviously inaccurate. Therefore, after obtaining the initial translation text, the embodiments of the present application determine the difficult words in the original text based on the initial translation text, so as to perform targeted processing on the difficult words, and better improve the translation quality of the original text according to the result after the targeted processing.

[0082] In some embodiments, as Figure 4 indicated, Figure 4 is an implementation flowchart of step 102 in Figure 2 , the preliminary translation of the original text obtains the 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 indicate that the original text is demonstrated to be translated into the initial translation text, and the initial translation text includes the initial word translation.

[0084] Step 202, performing preliminary translation on the original text under the constraint of the original text and the first prompt information as translation guidance to obtain an initial translation text in the target language.

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

[0086] In some embodiments, to improve the translation efficiency and accuracy of the large language model on the original text, the first prompt information is also input into the large language model at the same time as the original text. The large language model is a type of artificial intelligence model trained on a large amount of data, which aims to process the input text in natural language. The data processed by the large language model is very large, usually in the order of tens of 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, which can generate text and / or code according to a short written prompt. ChatGPT is an application instance of the GPT series, which is widely used in dialogue generation, knowledge question answering, etc.

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

[0089] (3) Neural Network Language Model (NLM): a type of language model used to overcome the curse of dimensionality, which uses distributed representation of words to model natural language sequences to capture complex features in 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 several types of large language models, the large language model of the present application can also be selected according to actual conditions Other models with natural language processing capabilities, that is, the specific type of large language model is not limited in the embodiments of the present application.

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

[0092] [Source Sentencex];

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

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

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

[0096] Further, the original text and the first prompt information can constitute a first prompt template:

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

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

[0099] Further, the large language model can preliminarily translate the original text by taking the original text in the first prompt template as the translation constraint and taking the first prompt information as the translation guide, to obtain the initial translation 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 an indication of the translation style, such as formal, colloquial, technical, etc. The specific indication content contained in the first prompt information is not limited by the embodiments of the present application.

[0101] In some embodiments, as shown in Figure 5 , Figure 5 is Figure 4 an implementation flowchart of step 202 in , the original text is constrained, and the first prompt information is used as a translation guide to preliminarily translate the original text to obtain the initial translation text in the target language, including the following steps 301 to 302:

[0102] Step 301, obtaining first example information corresponding to the first prompt information.

[0103] Step 302, preliminarily translating the original text with the original text as a constraint and the first prompt information and the first example information as a translation guide, to obtain the initial translation text in the target language.

[0104] The following describes steps 301 to 302 in detail.

[0105] In some embodiments, to further improve the translation efficiency and accuracy of the large language model for the original text, the first example information can also be input into the original text and the first prompt information. The first example information is an example that shows how to preliminarily translate the demonstration original text to obtain the demonstration initial translation text. The number of first example information examples can be one or more, which can be set according to actual conditions.

[0106] For example, input the first prompt template composed of the original text, the first prompt information and the first example information 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] Wherein, N represents the number of first example information, and N in the subsequent 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 cue information and first example information as translation guidance, thus obtaining an initial translated text in the target language. Understandably, since the first example information provides concrete cases for the large language model's preliminary translation of the original text, these cases can guide the large language model on how to initially translate similar original texts into initial translated texts, thereby improving the large language model's preliminary translation capability.

[0112] It should be noted that the first example information can be adaptively adjusted according to the different source and target languages, and the first example information corresponds to the translation requirements of the first prompt information.

[0113] In some embodiments, such as Figure 6 As shown, Figure 6 yes Figure 2 Another implementation flowchart of step 102 in the original text, which identifies difficult words in the original text based on the original text and the initial translated text, includes the following steps 401 to 403:

[0114] Step 401: Construct second prompt information related to the source language and the target language, and input the second prompt information, the original text and the initial translated text into a preset large language model. The second prompt information is used to indicate the identification of demonstration difficulty words from the demonstration original text.

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

[0116] Step 403: Guided by the second prompt information, use computing resources to perform text parsing on the original text and the initial translated text to obtain difficult words.

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

[0118] In some embodiments, such as Figure 3 As shown, after obtaining the initial translation text, the large language model will identify 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 will most likely be expressed in an inaccurate, non-fluent, or incomprehensible form. Therefore, identifying the difficult words in the original text helps to perform further natural language processing on it, thereby improving the accuracy of the translation.

[0119] Further, 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 when 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

[0121] [Source Sentencex];

[0122]

[0123] Next, the second prompt information (Request2) is input into 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] The second prompt information is used to determine the demonstration difficult words from the demonstration original text, and the demonstration difficult words refer to the words in the demonstration original text that are ambiguous in meaning, have specific context translation characteristics, etc. When the original text is input into the large language model, the large language model can clearly analyze the target based on the second prompt information and perform analysis processing on the original text, and then determine the difficult words of the original text.

[0126] Further, the original text, the initial translation text and the second prompt information can 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] Further, the large language model can use the second prompt information in the second prompt template as analysis guidance, and use the called computing resources to analyze the original text and the initial translation text to obtain the difficult words corresponding to 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 determination range of the difficult words, such as special terms in a specific field (such as "pain points" in the Internet field), culture or region-related characteristic words, emotional color implicit meanings, etc. That is, the specific indication content contained in the second prompt information is not limited by the embodiments of the present application.

[0132] Further, when the large language model receives the second prompt information, it can call computing resources based on the second prompt information, so that the large language model can use the called different computing resources for analysis support to analyze the original text and the initial translation text to obtain the difficult words. The internal computing resources refer to the resources of the large language model itself, and the external computing resources refer to the resources other than the large language model.

[0133] Further, the large language model can determine the difficult words in the original text based on only the internal computing resources, or determine the difficult words in the original text only through the introduced external computing resources. Alternatively, the first difficult words are determined based on the internal computing resources, and then the second difficult words are determined based on the external computing resources. The union of the first difficult words and the second difficult words can be taken as the finally determined difficult words, or the intersection of the first difficult words and the second difficult words can be taken as the finally determined difficult words.

[0134] In some embodiments, as shown in Figure 7 , the method further includes: Figure 7 is another implementation flowchart of step 403 in Figure 6 , using the second prompt information as analysis guidance, and using the computing resources to analyze the original text and the initial translation text to obtain the difficult words, including the following steps 501 to 502:

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

[0136] Step 502: using the second prompt information and the second example information as analysis guidance, and using the computing resources to analyze the original text and the initial translation text to obtain the difficult words.

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

[0138] In some embodiments, to further improve the efficiency and accuracy of the large language model in determining the difficult words from the original text, the second example information can also be input into the large language model at the same time as 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 that shows how to determine the demonstration difficult words from the demonstration original text. The number of examples of the second example information can be one or more, which can be set according to actual conditions.

[0139] For example, the second prompt template composed 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 Sentence x];

[0143]

[0144] Wherein, ε diff represents the second example information.

[0145] Further, the original text and the initial translation text are text parsed by using the called computing resources, with the second prompt information and the second example information as the parsing guide, to obtain the difficult words. It can be understood that, since the second example information shows specific cases of how to determine the demonstration difficult words from the demonstration original text, these cases can guide the large language model 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 requirements of the second prompt information.

[0147] Further, according to the difference of the called computing resources, the large language model can determine the difficult words in the original text in different ways.

[0148] In some embodiments, the large language model can identify the difficult words in the source sentence based on the model's intrinsic knowledge indicated by the internal computing power resources after receiving the second prompt template. Specifically, the large language model uses a greedy decoding method to identify the difficult words The process is represented by the following formula <1>:

[0149]

[0150] Where θ represents a large language model; P is a preset probability function, which takes the second example information as an analysis guide to identify difficult words in the original text; argmax is a function that represents the independent variable that takes the maximum value from the function P.

[0151] Where greedy decoding 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 marker is encountered.

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

[0153]

[0154] Where 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 word through a parameter K (i.e., temperature), thereby controlling the quality and diversity of the generated content.

[0155] Further, after preliminary screening of difficult words based on internal computing power resources / external computing power resources, the obtained difficult words can be further screened to accurately determine the difficult words corresponding to the original text.

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

[0157] In some embodiments, when the invoked computing resource is an external computing resource, the external computing resource can be an external tool with translation quality evaluation capability, such as token-level translation quality evaluation φ(·); at this time, the external tool reflects the difficulty faced by each word in translation by scoring each candidate word, quantifying its error degree relative to the initial translation text, and then 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 word based on the external computing resource is represented by the following formula <3>:

[0158]

[0159] wherein d represents any one of the candidate set The word with a score φ(d)>τ is determined as the final difficult word based on formula <3>; τ is an adjustable difficult threshold score, used to balance the recall and precision of difficult word identification.

[0160] Step 103, individually explaining the difficult words in the original text to obtain the difficult word translation text in the target language.

[0161] The step 103 is described in detail below.

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

[0163] In some embodiments, as shown in Figure 8 , Figure 8 is Figure 2 another implementation flowchart of step 103 in

[0164] Step 601, 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 the preset large language model, wherein the third prompt information is used to indicate that the difficult words are individually explained to obtain the demonstration difficult word translation text.

[0165] Step 602, individually explaining the difficult words in the original text by taking the original text as a constraint condition and the third prompt information as an explanation guide, to obtain the difficult word translation text in the target language.

[0166] The steps 601 to 602 are described in detail as follows.

[0167] In some embodiments, 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 when the original text and difficult words are input into the large language model.

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

[0169] Source Sentence: [Given Sentence x];

[0170] Difficult Words: [Difficult Words D].

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

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

[0173] Wherein, D is a set of difficult words; the third prompt information is used to indicate the separate translation of the demonstration difficult words 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 be based on the third prompt information to clearly explain the target, and then obtain the difficult word translation text in the target language.

[0174] Further, the original text, the set of difficult words and the third prompt information can constitute a third prompt template:

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

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

[0177] Difficult Words:[Difficult WordsD].

[0178] Furthermore, the large language model can use the original text as a constraint and third-party prompts as an explanation guide to perform word explanations on difficult words in the original text separately, and obtain the translated text of difficult words in the target language.

[0179] It should be noted that the third prompt information can be selectively enriched according to the actual situation. For example, the third prompt information may also include instructions on the explanation style, such as formal, colloquial, or technical. The embodiments of this application do not limit the specific instructions included in the third prompt information.

[0180] In some embodiments, such as Figure 9 As shown, Figure 9 yes Figure 8 A flowchart for step 602 in the above steps describes a process that uses the original text as a constraint and third-party prompts as an explanation guide to perform word explanations on difficult words in the original text, resulting in translated texts of difficult words in the target language. This includes the following steps 701 to 702:

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

[0182] Step 702: Using the original text as a constraint and the third prompt information and third example information as explanation guides, explain the difficult words in the original text separately to obtain the translated text of the difficult words in the target language.

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

[0184] In some embodiments, to further improve the efficiency and accuracy of the large language model in interpreting difficult words, third example information can also be input along with the original text and difficult words. The third example information is an example demonstrating the translation of a demonstration difficult word, resulting in a translated text. The number of examples in the third example information can be one or more, depending on the specific circumstances.

[0185] For example, a third-hint template consisting of the original text, third-hint information, difficult words, and third-hint example information is input into a 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] Where, ε intp This indicates the third example information.

[0191] Furthermore, based on the third-party prompt template, difficult words are translated to obtain a set of explanations for each difficult word. Explanation set The generation process is represented by the following formula: <4> :

[0192]

[0193] in, x i To demonstrate the original text, To demonstrate difficult words, This demonstrates the translation of difficult words.

[0194] Furthermore, the large language model can use the original text as a constraint and third-party cue information and example information as explanations to perform word interpretation on difficult words in the original text, obtaining translated texts of difficult words in the target language. Understandably, since the third-party example information provides concrete examples of how the large language model can perform word interpretation on difficult words, these examples can guide the large language model on how to interpret similar difficult words, thereby improving the large language model's word translation capabilities.

[0195] It should be noted that the third example information can be adaptively adjusted according to the source language and target language, and the interpretation requirements of the third example information correspond to those of the third prompt information.

[0196] Step 104: Based on the translation text of the difficult words, revise the initial word translation to obtain the revised target word translation, and update the initial translation text based on the target word translation to obtain the target text of the original text in the target language.

[0197] Step 104 will be described in detail below.

[0198] In some embodiments, such as Figure 3 As shown, after determining the translation text of the difficult words, the initial word translation is revised based on the difficult word translation text to optimize the translation quality of the difficult words. Then, the initial translation text is updated by the revised target word translation, thereby improving the translation accuracy of the target text.

[0199] In some embodiments, such as Figure 10 As shown, Figure 10 yes Figure 2 A flowchart of step 104 in the diagram shows how to revise the initial word translation based on the translation text of the difficult words to obtain the revised target word translation, including the following steps 801 to 802:

[0200] Step 801: Construct a fourth prompt message related to the source language and the target language, and input the fourth prompt message, the original text, the initial translation text, and the translation text of the difficult words into the preset large language model. The fourth prompt message is used to indicate the correction of the initial translation of the demonstration words based on the translation text of the demonstration difficult words.

[0201] Step 802: Using 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 translation text of the difficult words to obtain the corrected target word translation.

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

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

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

[0205] Source Sentence:[Given Sentencex];

[0206]

[0207]

[0208] Next, the fourth prompt (Request4) is input into 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] wherein, is a difficult word translation text set; when the original text, the initial translation text and the difficult word translation text are input to the large language model, the large language model can correct the target based on the fourth prompt information, and then correct the initial word translation text based on the difficult word translation text to obtain the corrected target word translation text.

[0211] Further, 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 Sentence x];

[0214]

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

[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 an instruction for translation correction, such as direct replacement, retranslation according to the difficult word translation, etc., and the specific instruction content contained in the fourth prompt information is not limited by the embodiments of the present application.

[0217] In some embodiments, as Figure 11 shown, Figure 11 isFigure 10 An implementation flowchart of step 802 in the method 800 is shown in FIG. 9, which is based on the difficult word translation text to revise the initial word translation text, to obtain the revised target word translation text, under the constraint of the original text and the initial translation text, and the fourth prompt information as the revision guide, including the following steps 901 to 902:

[0218] Step 901, obtaining the fourth example information corresponding to the fourth prompt information.

[0219] Step 902, revising the initial word translation text based on the difficult word translation text, under the constraint of the original text and the initial translation text, and the fourth prompt information and the fourth example information as the revision guide, to obtain the revised target word translation text.

[0220] The steps 901 to 902 are described in detail as follows.

[0221] In some embodiments, to further improve the efficiency and accuracy of the large language model in revising the initial word translation text based on the difficult word translation text, the fourth example information can also be input into the large language model at the same time as the input of the original text and the fourth prompt information. The fourth example information is an example that shows the revision of the demonstration initial word translation text based on the demonstration difficult word translation text to obtain the demonstration target word translation text. The number of examples of the fourth example information can be one or more, which can be set according to actual conditions.

[0222] For example, a fourth prompt template composed 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] Wherein, ε igtThis represents the fourth example information used to guide the large language model in generating translations of the target word.

[0228] Furthermore, based on the fourth prompt template, the initial word translation text is revised to obtain the target word translation, and thus the final target text is obtained. target text The generation process is represented by the following formula: <5> As shown:

[0229]

[0230] in, x i To demonstrate the original text, To demonstrate the initial translated text, To demonstrate the translation of difficult words, To demonstrate the target text.

[0231] Furthermore, the large language model can use the original text and initial translated text as constraints, and the fourth cue information and fourth example information as correction guidance, to revise the initial word translation based on the translation text of the difficult words, thus obtaining the revised target word translation. Understandably, since the fourth example information provides concrete cases of how the large language model can revise the initial word translation based on the demonstration translation text of the difficult words to obtain the demonstration target word translation, these cases can guide the large language model on how to revise the initial word translation based on similar translation texts of difficult words, thereby improving the large language model's ability to ultimately obtain the revised target text.

[0232] It should be noted that the fourth example information can be adaptively adjusted according to the different source and target languages. Furthermore, 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 the difficult words in a more official language style to obtain the target word translation, then the fourth example information will include examples with specified style requirements.

[0233] In some embodiments, such as Figure 12 As shown, Figure 12 yes Figure 2 Another implementation flowchart of step 104 in the process involves updating the initial translated 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: Evaluate the translation quality of the initial translation text to obtain a first translation score, and evaluate the translation quality of the updated initial translation text based on the target word translation to obtain a second translation score.

[0235] Step 1002, when the second translation score is greater than the first translation score, determining to update the initial translation text to the target text based on the target word translation.

[0236] The steps 1001 to 1002 are described in detail as follows.

[0237] In some embodiments, as shown in Figure 3 in the process of updating the initial translation text based on the target word translation, if the difficult word translation text set is not used, the initial word translation is adjusted to obtain text s I (i.e. the initial translation text), and the translation quality of the text s I is evaluated to obtain a first translation score s1; if the difficult word translation text set is used, the initial word translation is adjusted to obtain text s II, and the translation quality of the text s II is evaluated to obtain a second translation score s2; by comparing s1 and s2, if s1>s2, it indicates that the translation quality of the initial translation text is better, and the initial translation text is kept unchanged; if s1<s2, it indicates that the translation quality of the text s I obtained based on the initial word translation is better, and the initial word translation is taken as the target word translation; otherwise, it indicates that the translation quality of the text s II obtained based on the difficult word translation text is better, and the difficult word translation text is taken as the target word translation.

[0238] The tool for evaluating the translation quality of the text (Translation Quality Evaluation, TQE) can be an integrated translation quality evaluation tool such as QA Checker, MemoQ, etc.; or an independent translation quality evaluation tool 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 given original text x, initial translation text and difficult word translation text set , the following steps are performed:

[0240] ① the initial translation text is updated based on the elements in the difficult word translation text set to obtain an updated text;

[0241] ② the translation quality of the updated text is evaluated by using a translation quality evaluation tool to obtain a corresponding translation score S1;

[0242] ③ each element in the difficult word translation text set is tried to be deleted in turn, and steps ① and ② are performed to obtain an updated translation score S2;

[0243] ④ if S2>S1 exists, the corresponding element is removed from the difficult word translation text set ​The current update text is output as the target text of the final translation, and the initial translation text is also subjected to translation quality evaluation to obtain a translation score S0. If the scores of S1 and any S2 are 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 of the final translation.

[0244] In order to better understand the beneficial effects of the text translation method proposed in the present application, the following will be described in an example:

[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] Text translated using related technologies (Chinese): 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.

[0247] It can be found that “All-Pro wide receiver” and “stop now” are obviously not fluent translations.

[0248] In comparison, the target text (Chinese) translated using the text translation method proposed in the present application: 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.

[0249] Specifically, the text translation device provided in the present application first determines the difficult words corresponding to the original text as “All-Pro”, “wide receiver”, and “stop now”; and determines the difficult word translation texts corresponding to each difficult word as “All-Pro indicates that the athlete is full-time”, “wide receiver indicates a receiver in American football and Canadian football”, and “stop now indicates why to stop one’s 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 given here; then, the initial word translation text is updated based on the difficult word translation text to obtain the modified target word text; and then, the initial translation text is updated according to the modified target word text to obtain the final target text.

[0250] Wherein, the standard answer of the original text translation is: the four-time all-star receiver wrote on Twitter on Thursday, "I'm in great shape, why do I have to retire now?" He accepted the game needs his advice.

[0251] As Figure 13 shown, Figure 13 is an optional flowchart of a text translation device provided by an embodiment of the present application, which includes the following modules 1101 to 1104:

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

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

[0254] The word explanation module 1103 is configured to perform word explanation on the difficult words in the original text to obtain difficult word translation text in the target language.

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

[0256] The text translation method, device, electronic equipment and storage medium provided by the present application, which acquires original text in a source language; performs preliminary translation on the original text to obtain initial translation text in a target language, and determines difficult words in the original text and initial word translation text of the difficult words in the initial translation text based on the original text and the initial translation text. At this time, the initial word translation text obtained may contain some inaccurate, unsmooth or improved places because the meanings of the corresponding words in a specific context are different from the meanings in general translation. After determining the difficult words in the original text, the difficult words in the original text are separately explained to obtain difficult word translation text in the target language. In this way, the difficult words are processed specifically, and the more optimal word translation result corresponding to the difficult words is determined according to the specific processing result. Then, the initial word translation text is corrected based on the difficult word translation text to obtain corrected target word translation text, and the initial translation text is updated based on the target word translation text to obtain high-accuracy 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 basically the same as the specific embodiment of the above-mentioned text translation method, and will not be repeated here.

[0258] The embodiment of the present application further provides an electronic device, which comprises a memory and a processor. The memory stores a computer program. The processor executes the computer program to realize the text translation method. The electronic device can be any intelligent terminal, such as a tablet computer or a vehicle-mounted computer.

[0259] As shown in Figure 14 , Figure 14 is a hardware structure schematic diagram of the electronic device provided by the embodiment of the present application. The electronic device comprises:

[0260] The processor 1201 can be implemented in the form of a general-purpose CPU (Central Processing Unit, central processor), a microprocessor, an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the embodiment of the present application.

[0261] The memory 1202 can be implemented in the form of a ROM (Read Only Memory, read-only memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory, random access memory). The memory 1202 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 1202 and are called and executed by the processor 1201 to implement the text translation method of the embodiment of the present application.

[0262] The input / output interface 1203 is used to realize 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 by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0264] The bus 1205 transmits information between various components (for example, the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204) of the device.

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

[0266] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the text translation method.

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

[0268] The embodiments described in the embodiments of the present application are used 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 by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

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

[0270] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0271] Those skilled in the art can understand that all or some steps in the above disclosed method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0272] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a given step or its integral presence in the process, method, system, article, or apparatus having been made with a wider scope. The use of notation such as "first", "second", "third", etc. does not generally limit the areas, but is used to connect like elements or to distinguish one claim from another. These terms can be used interchangeably when appropriate. Terms concerning the relative position of elements can be interpreted such that their use adheres to their normal meaning, but they can also be interpreted to mean the opposite according to specific claims.

[0273] It should be understood that, in the application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases: 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 represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple 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, and c can be single or multiple.

[0274] In several embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the above-described device embodiments are only illustrative, for example, the division of the above-mentioned units is only a logical functional division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0276] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0277] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.

[0278] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not limited to the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A text translation method, characterized in that, The method includes: Retrieve the raw text in the source language; The original text is initially translated to obtain an initial translated text in the target language. Based on the original text and the initial translated text, the difficult words in the original text and the initial word translations of the difficult words in the initial translated text are determined. By individually defining the difficult words in the original text, a translated text of the difficult words in the target language is obtained. Based on the translation of the difficult words, the initial word translation is corrected to obtain the corrected target word translation. The initial translation is then updated based on the target word translation to obtain the target text of the original text in the target language. The preliminary translation of the original text to obtain the initial translated text in the target language includes: Construct first prompt information related to the source language and the target language, and input the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct the original demonstration text to be translated into the initial demonstration translation text, and the initial demonstration translation text includes the initial demonstration word translations; Using the original text as a constraint and the first prompt as a translation guide, the original text is initially translated to obtain the initial translated text in the target language. The process of identifying difficult words in the original text based on the original text and the initial translated text includes: Construct a second prompt message related to the source language and the target language, and input the second prompt message, the original text and the initial translated text into a preset large language model, wherein the second prompt message is used to indicate the identification of demonstration difficult words from the demonstration original text; Based on the second prompt information, computing resources are retrieved, wherein the computing resources include internal computing resources and external computing resources; Guided by the second prompt, the computing resources are used to perform text parsing on the original text and the initial translated text to obtain the difficult words; Guided by the second prompt information, the computing resources are used to parse the original text and the initial translated text to obtain the difficult words, including: Obtain the second example information corresponding to the second prompt information; Guided by the second prompt information and the second example information, the computing resources are used to perform text parsing on the original text and the initial translated text to obtain the difficult words.

2. The method according to claim 1, characterized in that, The process of performing a preliminary translation of the original text, using the original text as a constraint and the first prompt information as a translation guide, to obtain an initial translated text in the target language, includes: Obtain the first example information corresponding to the first prompt information; Using the original text as a constraint and the first prompt information and the first example information as translation guides, the original text is initially translated to obtain the initial translated text in the target language.

3. The method according to claim 1, characterized in that, The step of individually interpreting the difficult words in the original text to obtain the translated text of the difficult words in the target language includes: Construct a third prompt message related to the source language and the target language, and input the third prompt message, the original text and the difficult words into a preset large language model, wherein the third prompt message is used to instruct that the demonstration difficult words be explained separately to obtain the demonstration difficult words translation text; Using the original text as a constraint and the third prompt as an explanation guide, the difficult words in the original text are explained individually to obtain the translated text of the difficult words in the target language.

4. The method according to claim 3, characterized in that, The process of using the original text as a constraint and third-party prompts as an interpretive guide to separately explain the difficult words in the original text, thereby obtaining translated texts of the difficult words in the target language, includes: Obtain the third example information corresponding to the third prompt information; Using the original text as a constraint and the third prompt information and the third example information as explanation guides, the difficult words in the original text are explained individually to obtain the translated text of the difficult words in the target language.

5. The method according to claim 3, characterized in that, The process of revising the initial word translation based on the translated text of the difficult words to obtain the revised target word translation includes: Construct a fourth prompt message related to the source language and the target language, and input the fourth prompt message, the original text, the initial translation text, and the translation text of the difficult words into a preset large language model, wherein the fourth prompt message is used to instruct the initial translation of the demonstration words to be corrected based on the translation text of the demonstration difficult words; Using the original text and the initial translated text as constraints and the fourth prompt information as a correction guide, the initial word translation is corrected based on the translation text of the difficult words to obtain the corrected target word translation.

6. The method according to claim 5, characterized in that, The process involves using the original text and the initial translated text as constraints, and the fourth prompt information as a correction guide, to revise the initial word translation based on the translation text of the difficult words, resulting in the revised target word translation, including: Obtain the fourth example information corresponding to the fourth prompt information; Using the original text and the initial translated text as constraints, and the fourth prompt information and the fourth example information as correction guidance, the initial word translation is corrected based on the translation text of the difficult words to obtain the corrected target word translation.

7. The method according to claim 1, characterized in that, The step of updating the initial translated text based on the target word translation to obtain the target text of the original text in the target language includes: The initial translated text is evaluated for translation quality to obtain a first translation score, and the updated initial translated text based on the target word is evaluated for translation quality to obtain a second translation score; When the second translation score is greater than the first translation score, the initial translated text is updated to the target text based on the target word translation.

8. A text translation device, characterized in that, The device includes: The acquisition module is used to acquire the raw text in the source language. The preliminary translation module is used to perform a preliminary translation of the original text to obtain an initial translated text in the target language, and to determine the difficult words in the original text and the initial word translation of the difficult words in the initial translated text based on the original text and the initial translated text. The word explanation module is used to explain the difficult words in the original text individually, and to obtain the translated text of the difficult words in the target language. The target translation module is used to correct the initial word translation based on the translation text of the difficult words to obtain the corrected target word translation, and to update the initial translation text based on the target word translation to obtain the updated target text in the target language; The preliminary translation of the original text to obtain the initial translated text in the target language includes: Construct first prompt information related to the source language and the target language, and input the first prompt information and the original text into a preset large language model, wherein the first prompt information is used to instruct the original demonstration text to be translated into the initial demonstration translation text, and the initial demonstration translation text includes the initial demonstration word translations; Using the original text as a constraint and the first prompt as a translation guide, the original text is initially translated to obtain the initial translated text in the target language. The process of identifying difficult words in the original text based on the original text and the initial translated text includes: Construct a second prompt message related to the source language and the target language, and input the second prompt message, the original text and the initial translated text into a preset large language model, wherein the second prompt message is used to indicate the identification of demonstration difficult words from the demonstration original text; Based on the second prompt information, computing resources are retrieved, wherein the computing resources include internal computing resources and external computing resources; Guided by the second prompt, the computing resources are used to perform text parsing on the original text and the initial translated text to obtain the difficult words; Guided by the second prompt information, the computing resources are used to parse the original text and the initial translated text to obtain the difficult words, including: Obtain the second example information corresponding to the second prompt information; Guided by the second prompt information and the second example information, the computing resources are used to perform text parsing on the original text and the initial translated text to obtain the difficult words.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

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

    CN115062631A

  • Large model machine translation method based on RAG

    CN117993396A