Translation agent based on dynamic memory enhancement and construction method
Through the dynamic memory-enhanced translation agent construction method, the shortcomings of machine translation systems in context understanding, cultural differences, idioms and professional terminology processing are solved, high-quality translation consistency and language style coherence are achieved, and the translation needs of multiple languages and professional fields are adapted.
Patent Information
- Application Number
- CN202510669790.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-12
AI Technical Summary
Existing machine translation systems have shortcomings in context understanding, cultural differences, idiom translation, long text processing and professional terminology processing, resulting in unnatural, inconsistent and incoherent translation results.
A dynamic memory-enhanced translation agent construction method is adopted. Through language identification, professional field identification, semantic segmentation, translation process control, named entity recognition and professional terminology processing, long-term memory and short-term memory are combined, and the LLM large language model is used for translation. The translation is verified through COMET scoring and historical memory.
It achieves high-quality translation in multiple languages, professional fields and long text scenarios, maintains translation consistency and coherence of language style, has strong adaptability and high translation accuracy.
Smart Images

Figure CN120633680A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence and natural language processing, and in particular relates to a translation agent based on dynamic memory enhancement and a construction method thereof. Background Art
[0002] With the rapid development of new-generation artificial intelligence technologies such as large language models and intelligent agents, machine translation capabilities are constantly improving. By fine-tuning and training large models, optimizing prompt words, and building intelligent agents, special problems in the translation process can be solved more flexibly, achieving high-quality machine translation in more scenarios.
[0003] However, there are still some problems with current machine translation, such as (1) Insufficient contextual understanding: Machine translation systems often find it difficult to accurately capture subtle contextual differences in texts, resulting in translation results that may appear stiff or unnatural in specific contexts; (2) Cultural differences and idiom translation: Idioms, slang, and proverbs from different cultural backgrounds are difficult to be accurately translated by machines because they usually require a deep cultural understanding; (3) Long text processing: Machine translation is prone to coherence problems when processing long texts, resulting in a lack of consistency in translation results at the paragraph or chapter level; (4) Professional terminology and domain knowledge: Professional terminology and knowledge in specific industries or fields are a challenge for machine translation systems. Summary of the Invention
[0004] Technical solution: In order to solve the above technical problems, the present invention provides a method for constructing a translation agent based on dynamic memory enhancement, which includes the following specific steps:
[0005] Step 1: Language identification: Identify the foreign language of the text to be translated;
[0006] Step 2: Professional Domain Identification: Build and update the domain dictionary, and use the LLM large language model to compare and identify professional terms in the professional domain dictionary for the text to be translated. For scenarios with extremely long texts, sample detection and identification are performed.
[0007] Step 3: Semantic segmentation: Perform semantic segmentation on the long text and set the upper threshold of the token mark to divide it into N text blocks;
[0008] Step 4: Control the translation process: Translate from the first text block to the end of the Nth block, where N is an integer of 1.
[0009] As an improvement, in step 4, the LLM large language model is used to identify named entities and professional terms in the text block to be translated. When polysemous words appear, they are recorded as polysemous. When translating to the Kth text block (1<K≤N), the named entities and terms are cached in long-term memory, and the historical memory must be consistent with the current translation.
[0010] As an improvement, in step 4, when translating to the Kth text block (1<K≤N), the bilingual summary of the K-1th text block is extracted as short-term memory to constitute the LLM large language model translation task prompt word.
[0011] As an improvement, based on the long-term memory and short-term memory processing, the translation task instructions of the LLM large language model are constructed and translation is performed, wherein the translation task instructions include the professional field identified in step 2, the named entities and domain terms identified in the K-th text block, and the bilingual summary of the K-th text block to the K-1-th text block.
[0012] As an improvement, step 4 also includes verifying the translation structure of the original translation of the text block, performing COMET scoring on the translation quality, and determining whether to re-translate by setting a COMET scoring threshold.
[0013] As an improvement, when the value is not lower than the threshold, the translation of the current text block, the translation memory of named entities and terms, and the bilingual summary of the original text and the translation will be cached.
[0014] As an improvement, when the value is lower than the threshold, the standard translation of the historical approximate corpus will be set as the prompt word Few-shot of the LLM large language model for re-translation.
[0015] As a specific embodiment of the present invention, a translation agent is also provided, comprising
[0016] Memory for storing computer programs;
[0017] A processor is used to implement the above-mentioned construction method when executing the computer program.
[0018] Beneficial Effects: The translation agent proposed in this invention first identifies the foreign language of the text to be translated, then uses the LLM large language model to identify the specific domain of the text to be translated. For very long texts, sampling detection and recognition are performed, and semantic segmentation is performed into multiple text blocks. Finally, the translation is completed in sequence. By constructing a dynamic memory software framework that includes short-term memory retention of bilingual summaries of text blocks, long-term memory consistency maintenance for NER, and RAG historical memory retrieval, and utilizing the LLM translation task dynamic memory prompt word construction method, this method successfully solves the difficult problems of machine translation in complex scenarios such as multilingual, specialized, and long contexts, such as difficulty in maintaining contextual consistency, difficulty in adapting to the specific domain, and difficulty in maintaining translation style.
[0019] Compared with traditional translation agents and translation methods, the present invention has the following significant advantages:
[0020] (1) The intelligent agent of the present invention integrates multiple models and domain terminology libraries, achieving adaptability to multiple languages and professional fields. In fields requiring extremely high translation accuracy, such as medicine, law, and the military, the intelligent agent demonstrates even greater adaptability. Furthermore, based on dynamic memory enhancement technology, the intelligent agent can ensure the consistency of terminology and the coherence of language style during the translation process.
[0021] (2) The intelligent agent of the present invention maintains a standard translation corpus in a professional field in real time and uses RAG technology to achieve real-time learning of translations without the need for fine-tuning or training large models, thereby enabling the translation capability of the model to grow continuously and linearly.
[0022] (3) The intelligent translation construction method of the present invention utilizes bilingual summarization, named entity recognition (NER) long-term memory processing, and dynamic memory prompt word construction technology. The dynamic memory prompt word construction technology can maintain the translation consistency of named entities in long-distance contexts based on the content of the current text block, combined with the summary of the previous paragraph or reference to the standard translation of similar historical corpus materials, and based on the memory content. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of the method for constructing a translation agent of the present invention. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present invention will be described clearly and completely below so that those skilled in the art can better understand the advantages and features of the present invention and thus more clearly define the scope of protection of the present invention. The embodiments described in the present invention are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without making any creative work shall fall within the scope of protection of the present invention.
[0025] See Figure 1 FIG. 1 is a flow chart of the present invention, wherein a method for constructing a translation agent based on dynamic memory enhancement includes the following specific steps:
[0026] Step 1. Identify the foreign language of the text to be translated.
[0027] Step 2: Use the LLM large language model to identify the professional field of the text to be translated, and perform sampling detection and recognition for extremely long text scenarios.
[0028] Step 3. Perform semantic segmentation on the overlong text and control a certain token upper limit (such as 4K) to divide it into N text blocks.
[0029] Step 4: Control the translation process, starting from the first text block to the end of the Nth block.
[0030] In this invention, based on the professional domain identified in step 2, the LLM large language model is used to identify named entities and professional terms in the current text block, and translation is performed according to the domain dictionary. If there are polysemous words, the polysemy is recorded. When translating the Kth (K>1) text block, the long-term memory cache of named entities and terms is referenced to maintain translation consistency.
[0031] Named entities or specialized terms may require multiple translation methods. For example, when a document includes articles from multiple sources across the internet, the translation may fluctuate between different translations in different contexts. However, through long-term memory, the translation of longer documents can maintain contextual consistency.
[0032] Furthermore, in the present invention, when translating the Kth (K>1) text block, the bilingual summary of the K-1th block is extracted as short-term memory to form the LLM translation task prompt word, thereby maintaining the semantic fluency of the context.
[0033] Then, the professional field identified in step 2, the named entities and domain terms identified in the current text block, and the bilingual summary of the previous block are combined to form the LLM translation task instructions and implement the translation.
[0034] As a specific embodiment of the present invention, when a large language model is used to translate long text, introducing a bilingual summary of the preceding text can significantly improve translation quality, mainly in the following three aspects:
[0035] (1) Enhanced contextual consistency
[0036] For example, after the model obtains the summary of the previous paragraph "Climate change threatens biodiversity", it will prioritize "species migration patterns" over ambiguous expressions such as "animal travel routes" when translating "species migration patterns change".
[0037] (2) Guarantee of terminology uniformity
[0038] For example, if the term "quantum entanglement" appears in the previous abstract, the term "particle entanglement phenomenon" in the subsequent paragraph will be automatically matched to "particle entanglement phenomenon" instead of a direct translation to avoid terminology confusion.
[0039] (3) Optimization of reference resolution
[0040] For example, if the previous text mentions "the Act", the model can accurately translate the subsequent "its amended clauses" into "its amended clauses" through summary memory, rather than incorrectly processing it as "their modifications".
[0041] As a specific embodiment of the present invention, translation verification is also performed. Specifically, the translation structure of the current text block is verified based on the original translation. A COMET score threshold (e.g., 0.85) is set. When the translation quality exceeds the threshold, the translation, translation memory of named entities and terms, and bilingual summaries of the original and translated texts are cached. If the translation quality does not meet the threshold, the standard translation of the historical similar corpus is retrieved as the few-shot prompt word of the LLM and the translation is re-performed.
[0042] It should be pointed out that there are many existing translation indicators such as BLEU, COMET, Rouge-L, etc., but the COMET score does not require the introduction of standard translations and can be evaluated directly using the model.
[0043] Finally, when the translation of the last block of the text is completed, the N translation blocks are combined into the final translation result, and the translation task is completed.
[0044] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims
1. A method for constructing a translation agent based on dynamic memory enhancement, characterized by: The specific steps include Step 1: Language identification: Identify the foreign language of the text to be translated; Step 2: Professional Domain Identification: Build and update the domain dictionary, and use the LLM large language model to compare and identify professional terms in the professional domain dictionary for the text to be translated. For scenarios with extremely long texts, sample detection and identification are performed. Step 3: Semantic segmentation: Perform semantic segmentation on the long text and set the upper threshold of the token mark to divide it into N text blocks; Step 4: Control the translation process: Translate from the first text block to the end of the Nth block, where N is an integer of 1.
2. The method for constructing a translation agent based on dynamic memory enhancement according to claim 1, characterized in that: In step 4, the LLM large language model is used to identify named entities and professional terms in the text block to be translated. When polysemous words appear, they are recorded as polysemous. When translating to the Kth text block (1<K≤N), the named entities and terms are cached in long-term memory, and the historical memory must be consistent with the current translation.
3. The method for constructing a translation agent based on dynamic memory enhancement according to claim 2, characterized in that: In step 4, when translating to the Kth text block (1<K≤N), the bilingual summary of the K-1th text block is extracted as short-term memory to form the LLM large language model translation task prompt word.
4. The method for constructing a translation agent based on dynamic memory enhancement according to claim 4, characterized in that: Based on the processing of long-term memory and short-term memory, the translation task instructions of the LLM large language model are constructed and translated, wherein the translation task instructions include the professional field identified in step 2, the named entities and domain terms identified in the K-th text block, and the bilingual summary of the K-th text block to the K-1-th text block.
5. The method for constructing a translation agent based on dynamic memory enhancement according to claim 2, characterized in that: Step 4 also includes verifying the structure of the original translation of the text block, performing COMET scoring on the translation quality, and determining whether to re-translate by setting a COMET scoring threshold.
6. The method for constructing a translation agent based on dynamic memory enhancement according to claim 5, characterized in that: When it is not lower than the threshold, the translation of the current text block, the translation memory of named entities and terms, and the bilingual summary of the original text and the translation will be cached.
7. The method for constructing a translation agent based on dynamic memory enhancement according to claim 5, characterized in that: When it is lower than the threshold, the standard translation of the historical approximate corpus will be set as the prompt word Few-shot of the LLM large language model for re-translation.
8. A translation agent, characterized by: include memory for storing computer programs; A processor, configured to implement the construction method according to any one of claims 1 to 7 when executing the computer program.