Document-level machine translation method based on multi-granularity knowledge enhancement and related device

By segmenting documents into semantically coherent sub-documents and combining global and local knowledge enhancement methods, the problems of sentence omission and illusion in document-level machine translation are solved, achieving high-quality translation results, especially in the translation of technical documents, maintaining contextual consistency and proper noun consistency.

CN120930659APending Publication Date: 2025-11-11XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511042430.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing document-level machine translation technologies suffer from sentence omissions and illusions when processing multilingual documents, and are deficient in terms of proper noun consistency, paragraph cohesion, and semantic accuracy, which particularly affects the translation quality of technical documents.

Method used

We employ a document-level machine translation method based on multi-granularity knowledge enhancement. By segmenting documents into semantically coherent sub-documents, we extract global and local knowledge (such as bilingual summaries, proper nouns, topic descriptions, and transition cues), and utilize a large language model for translation and sentence alignment to generate high-quality translation results.

Benefits of technology

It improved the contextual consistency, proper noun consistency, and semantic accuracy of the translation, reduced sentence omissions and illusions, and enhanced the quality of the translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930659A_ABST
    Figure CN120930659A_ABST
Patent Text Reader

Abstract

The invention discloses a document-level machine translation method based on multi-granularity knowledge enhancement and a related device, and relates to the technical field of document-level machine translation.The method comprises the steps that a to-be-translated source document using a source language is segmented to obtain a plurality of sub-documents, multi-granularity knowledge is generated through a large language model, and the multi-granularity knowledge is obtained; comprising global knowledge including a global source language abstract, a global target language abstract, a global proper noun set and global topic description, and local knowledge including a core topic and a transition prompt of each sub-document, and translating each sub-document by using a large language model under multi-granularity knowledge enhancement, and performing sentence alignment on the sub-documents and the translated sub-documents, and if the sentence alignment succeeds, removing overlapped sentences in each translated sub-document by using a large language model and then performing splicing to obtain a translated target document using a target language. The translation quality can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of document-level machine translation technology, and in particular to a document-level machine translation method and related apparatus based on multi-granularity knowledge enhancement. Background Technology

[0002] Currently, smart devices (such as industrial control systems and smart terminals) increasingly need to process multilingual documents to support global applications. Therefore, there is a growing need for document translation, translating documents from source languages ​​to target languages, such as technical manuals and user guides. Existing document-level machine translation (DocMT) technologies are mainly divided into two types: Doc2Doc (whole document translation) and Doc2Sent (sentence-by-sentence translation). The Doc2Doc method attempts to preserve context and maintain consistency by translating the entire document at once, but often leads to sentence omissions (up to 8.75% omission rate) and illusion problems (generating content unrelated to the source document). The Doc2Sent method, by translating sentence by sentence, avoids sentence omissions and reduces illusion problems compared to Doc2Doc, but it disrupts discourse coherence and pronoun translation accuracy, resulting in a lack of overall contextual consistency in the translation. Furthermore, both the Doc2Doc and Doc2Sent methods have shortcomings in handling proper noun consistency, paragraph coherence, and semantic accuracy. In particular, in the translation of technical documents, inconsistent terminology and semantic discrepancies can seriously affect the translation quality. Summary of the Invention

[0003] The purpose of this application is to provide a document-level machine translation method and related apparatus based on multi-granularity knowledge enhancement, which can improve translation quality.

[0004] To achieve the above objectives, this application provides the following solution:

[0005] Firstly, this application provides a document-level machine translation method based on multi-granularity knowledge enhancement, wherein the document-level machine translation method based on multi-granularity knowledge enhancement includes:

[0006] Obtain the source document to be translated, which uses the source language.

[0007] The source document to be translated is segmented to obtain multiple sub-documents; each sub-document includes multiple sentences, and there are several overlapping sentences between adjacent sub-documents;

[0008] For each sub-document, the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues are extracted using a large language model; the transition cues are used to indicate the logical relationship between the sub-document and its previous sub-document.

[0009] The source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all the sub-documents are merged using a large language model to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description; the global set of proper nouns includes the source language proper nouns and the corresponding target language proper nouns.

[0010] For each sub-document, the sub-document, the global source language summary, the global target language summary, the global proper noun set, the global topic description, and the core topic and transition cues of the sub-document are used as input. The sub-document is translated using a large language model to obtain a translated sub-document in the target language. Sentence alignment is performed between the sub-document and the translated sub-document. If the sentence alignment is successful, the translated sub-document is output.

[0011] For each translated sub-document, a large language model is used to remove sentences in the translated sub-document that overlap with the previous translated sub-document, resulting in a deduplicated sub-document.

[0012] All the deduplicated sub-documents are concatenated to obtain the translated target document in the target language.

[0013] Optionally, the source document to be translated is segmented to obtain multiple sub-documents, specifically including: segmenting the source document to be translated into multiple sub-documents according to the principle that each sub-document includes c sentences and there are o overlapping sentences between two adjacent sub-documents; where c and o are positive integers.

[0014] Optionally, the source document to be translated is segmented into multiple sub-documents, specifically including: establishing an objective function with the goal of maximizing the sum of the semantic coherence quality of all sub-documents; optimizing and solving the objective function to segment the source document to be translated into multiple sub-documents.

[0015] Optionally, the objective function is:

[0016]

[0017] Where n is the number of sub-documents; q(C i ) represents the i-th sub-document Ci The quality of semantic coherence; p j For the i-th sub-document C i The j-th paragraph, which consists of several sentences; SIM(p j Z i ) is p j and Z i The semantic similarity between them, Z i For the i-th sub-document C i The centroid vector.

[0018] Optionally, a large language model is used to extract the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topics, and transition cues from the sub-document, specifically including:

[0019] Using the sub-document as input, a large language model is used to extract the source language summary and the target language summary of the sub-document; the source language summary is a summary using the source language, and the target language summary is a summary using the target language;

[0020] Using the sub-document and the global source language summary as input, the source language proper nouns of the sub-document are extracted using a large language model, and the source language proper nouns are translated to extract the target language proper nouns of the sub-document; the source language proper nouns are proper nouns using the source language, and the target language proper nouns are proper nouns using the target language.

[0021] Using the sub-document as input, a large language model is used to extract the topic description of the sub-document;

[0022] Using the sub-document as input, the core topics of the sub-document are extracted using a large language model;

[0023] Using the sub-document and its previous sub-document as input, a large language model is used to extract transition cues from the sub-document.

[0024] Optionally, the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all the sub-documents are merged using a large language model to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description, specifically including:

[0025] The source language summaries of all the sub-documents are merged using a large language model to obtain a global source language summary;

[0026] The target language summaries of all the sub-documents are merged using a large language model to obtain a global target language summary;

[0027] The source language proper nouns of all the sub-documents are merged using a large language model to obtain an initial global proper noun set. For each source language proper noun in the initial global proper noun set, the target language proper noun obtained from the first translation of the source language proper noun is selected as the target language proper noun corresponding to the source language proper noun. The source language proper noun and the target language proper noun corresponding to the source language proper noun are combined to form a global proper noun set.

[0028] The topic descriptions of all the sub-documents are merged using a large language model to obtain a global topic description.

[0029] Optionally, if sentence alignment fails, the process of "using the sub-document, the global source language summary, the global target language summary, the global proper noun set, the global topic description, and the core topic and transition prompts of the sub-document as input, translating the sub-document using a large language model to obtain a translated sub-document in the target language, and then aligning the sub-document and the translated sub-document with sentences" is repeated until sentence alignment is successful or the maximum number of repetitions is reached. If sentences are not aligned after the maximum number of repetitions is reached, the translated sub-document obtained after manual adjustment of the last translated sub-document is output.

[0030] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the above-described document-level machine translation method based on multi-granularity knowledge enhancement.

[0031] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned document-level machine translation method based on multi-granularity knowledge enhancement.

[0032] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described document-level machine translation method based on multi-granularity knowledge enhancement.

[0033] According to the specific embodiments provided in this application, this application has the following technical effects:

[0034] This application provides a document-level machine translation method and related apparatus based on multi-granularity knowledge enhancement. The method segments a source document in the source language into multiple sub-documents, each containing multiple sentences. Adjacent sub-documents have several overlapping sentences, which helps maintain contextual coherence and paragraph connections. For each sub-document, a large language model is used to extract the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues. Furthermore, the large language model is used to merge the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all sub-documents, resulting in a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description. This paper generates multi-granular knowledge, in which global source language summaries and global target language summaries maintain contextual consistency, global proper noun sets maintain proper noun consistency, global topic descriptions provide domain guidance and maintain semantic accuracy, core topics maintain semantic accuracy, and transition cues maintain contextual coherence and paragraph connection. With multi-granular knowledge enhancement, a large language model is used to translate each sub-document, resulting in a translated sub-document in the target language. Sentence alignment is performed between the sub-documents and the translated sub-documents; if alignment is successful, the translated sub-document is output. Sentence alignment reduces sentence omissions and illusions. The large language model removes overlapping sentences from each translated sub-document before concatenation to obtain the translated target document in the target language. This application combines document segmentation, multi-granular knowledge generation, and sentence alignment to simultaneously maintain contextual consistency, proper noun consistency, paragraph connection, and semantic accuracy, reducing sentence omissions and illusions and improving translation quality. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This diagram illustrates the application environment of a document-level machine translation method based on multi-granularity knowledge enhancement, as provided in Embodiment 1 of this application.

[0037] Figure 2 This is a flowchart illustrating a document-level machine translation method based on multi-granularity knowledge enhancement, as provided in Embodiment 1 of this application.

[0038] Figure 3This is a schematic diagram comparing the UTW percentages of different methods provided in Embodiment 1 of this application.

[0039] Figure 4 This is a schematic diagram comparing the translation time of different methods provided in Embodiment 1 of this application.

[0040] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] Example 1

[0043] The document-level machine translation method based on multi-granularity knowledge enhancement provided in this application can be applied to, for example... Figure 1The application environment shown is as follows. The terminal communicates with the server via a network. The data storage system stores the data that the server needs to process. The data storage system can be set up independently, integrated into the server, or placed in the cloud or on another server. The terminal can send a translation request to the server. After receiving the translation request, the server retrieves the source document to be translated in the source language; it segments the source document into multiple sub-documents; for each sub-document, it uses a large language model to extract the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues; it then uses the large language model to merge the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all sub-documents to obtain a global source language summary, a global target language summary, and a global set of proper nouns. The system takes a global topic description as input. For each sub-document, it uses a large language model to translate the sub-document into the target language. The translated sub-document is then aligned with the original sub-document, and if the alignment is successful, the translated sub-document is output. For each translated sub-document, the large language model removes overlapping sentences from the previous translated sub-document to obtain a deduplicated sub-document. All deduplicated sub-documents are then concatenated to obtain the translated target document in the target language. The server can then send the translated target document (the result of the translation request) back to the client.

[0044] Furthermore, in some embodiments, the document-level machine translation method based on multi-granularity knowledge enhancement can also be implemented by a server or a terminal independently. For example, the terminal can directly process the translation request to be processed, or the server can obtain the translation request to be processed from the data storage system and process it.

[0045] The terminals can be, but are not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices, while portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. Servers can be implemented using independent servers, server clusters composed of multiple servers, or cloud servers.

[0046] In one exemplary embodiment, such as Figure 2As shown, a document-level machine translation method based on multi-granularity knowledge enhancement is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 The following steps are used as an example of a server in the example.

[0047] Step S1: Obtain the source document to be translated using the source language.

[0048] Step S2: The source document to be translated is segmented to obtain multiple sub-documents; each sub-document includes multiple sentences, and there are several overlapping sentences between adjacent sub-documents.

[0049] Step S3: For each sub-document, use a large language model to extract the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues of the sub-document; the transition cues are used to indicate the logical relationship between the sub-document and the previous sub-document of the sub-document.

[0050] Step S4: Using a large language model, the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all the sub-documents are merged to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description; the global set of proper nouns includes the source language proper nouns and the corresponding target language proper nouns.

[0051] Step S5: For each sub-document, using the sub-document, the global source language summary, the global target language summary, the global proper noun set, the global topic description, and the core topic and transition cues of the sub-document as input, the sub-document is translated using a large language model to obtain a translated sub-document in the target language. Sentence alignment is performed between the sub-document and the translated sub-document. If the sentence alignment is successful, the translated sub-document is output.

[0052] Step S6: For each translated sub-document, use a large language model to remove sentences in the translated sub-document that overlap with the previous translated sub-document, to obtain a deduplicated sub-document.

[0053] Step S7: Concatenate all the deduplicated sub-documents to obtain the translated target document using the target language.

[0054] By implementing steps S1 to S7 above, this embodiment can combine document segmentation, multi-granularity knowledge generation, and sentence alignment to simultaneously maintain contextual consistency, proper noun consistency, paragraph coherence, and semantic accuracy, reduce sentence omissions and illusion problems, and improve translation quality.

[0055] Driven by the need for high-quality multilingual technical document translation, the development of intelligent translation devices or systems requires a method that can preserve the global semantics of documents while ensuring sentence-level translation accuracy, and reducing omissions and illusions. To address this, this embodiment proposes a document-level machine translation method based on multi-granularity knowledge enhancement (referred to as SubDocTrans). This method solves the aforementioned problems by segmenting documents into semantically coherent sub-documents and combining global knowledge enhancement, local knowledge enhancement, and sentence alignment.

[0056] This embodiment proposes a document-level machine translation method based on multi-granularity knowledge enhancement, which mainly includes:

[0057] (1) Sub-document segmentation: The source document is segmented into semantically coherent sub-documents, preserving contextual coherence.

[0058] (2) Multi-granularity knowledge enhancement: Extract global knowledge (bilingual summary, bilingual proper nouns, topic description) and local knowledge (core topics, transition prompts) to enhance the coherence and consistency of the translation.

[0059] (3) Sentence alignment strategy: Generate high-quality translations by using sentence alignment strategies to reduce omissions and illusions.

[0060] This embodiment significantly improves translation quality, coherence, and terminology consistency by combining sub-document segmentation, multi-granularity knowledge enhancement (global knowledge enhancement and local knowledge enhancement), and sentence alignment.

[0061] The document-level machine translation method based on multi-granularity knowledge enhancement in this embodiment can be executed on a device with data processing capabilities (such as a server or embedded computing device), specifically on a computing device with a large language model (LLM), and includes the following steps.

[0062] (a) Document segmentation can be accomplished by the segmentation module of a computing device.

[0063] (1) Input the source document Ds = {s1, s2, ..., s...} using the source language. N}, where N is the total number of sentences, and the source document consists of N sentences.

[0064] (2) Randomly divide the sentences in the source document into multiple paragraphs, each paragraph containing one or more sentences, to obtain the source document Ds = {p1, p2, ..., p...} M}, where M is the total number of paragraphs, and the source document consists of M paragraphs.

[0065] (3) Calculate the semantic similarity between paragraphs using TF-IDF (Term Frequency-Inverse Document Frequency) weighted Word2Vec (a model used to generate word vectors):

[0066]

[0067] Among them, SIM(p i ,p j ) represents the i-th paragraph p i and the j-th paragraph p j The semantic similarity between them; ∝ indicates a direct proportionality, that is, for each other... Normalization is performed to convert it into standard semantic similarity; m For the i-th paragraph p i The m-th word in; w n For the j-th paragraph p j The nth word in; tfidf(w m ,p i ) represents the m-th word w m In the i-th paragraph p i The TF-IDF score in the data is calculated using the TF-IDF algorithm, and the specific statistics are as follows: m In p i The number of times it appears in the text is used to obtain the TF value, and the total number of paragraphs is calculated as the number of words containing w. m The ratio of the number of paragraphs is used to calculate the IDF value, and the logarithm of the ratio is taken to obtain the TF value. The product of the TF value and the IDF value is calculated to obtain the TF-IDF score; SIM(w m ,w n ) represents the m-th word w m and the nth word w n The cosine similarity between Word2Vec embeddings is obtained through the Word2Vec model. Specifically, the Word2Vec model generates w... m and w n The word vectors, and then based on w m word vectors and w n The cosine similarity is calculated from the word vectors; tfidf(w n ,p j ) represents the nth word w n In the j-th paragraph p j The TF-IDF score in the data.

[0068] (4) Optimize the segmentation through dynamic programming to maximize the semantic coherence quality of the sub-documents. The objective function for optimization is:

[0069]

[0070] Where n is the number of sub-documents, which needs to be determined through optimization; q(C i ) represents the i-th sub-document C i The quality of semantic coherence, C i It includes multiple paragraphs and needs to be determined through optimization; p j For the i-th sub-document C i The j-th paragraph; SIM(p j Z i ) is p j and Z i The semantic similarity between them, Z i For the i-th sub-document C i The centroid vector, Z i Includes multiple vectors w z Typically, it includes semantic information from multiple words; essentially, it is a multi-dimensional vector representing the overall semantics of a sub-document, encompassing the semantic contributions of multiple words within the sub-document. n For the j-th paragraph p j The nth word in; w z For the i-th sub-document C i The centroid vector Z i The z-th word vector in the tfidf(w) n ,p j ) represents the nth word w n In the j-th paragraph p j TF-IDF score in; SIM(w n ,w z ) represents the nth word w n and the z-th word vector w z The cosine similarity between Word2Vec embeddings is obtained through the Word2Vec model, specifically by generating w using the Word2Vec model. n The word vectors, and then based on w n Word vectors and word vector w z The cosine similarity is calculated; tfidf(w) z Z i ) represents the vector of the z-th word. z In the i-th sub-document C i The centroid vector Z i The TF-IDF score in the data.

[0071] centroid vector Z iThe calculation formula is:

[0072]

[0073] Among them, |C i |For subdocument C i The number of sentences in; s j For sub-document C i The j-th sentence in; v(s) j ) is a sub-document C i The j-th sentence s j The vector representation of is obtained by calculating using the Word2Vec model.

[0074] By optimizing the objective function, the number of sub-documents and the paragraphs included in each sub-document are finally determined, generating n sub-documents {C1, C2, ..., C}. n Each sub-document contains several paragraphs, which are multiple sentences. The first o sentences of each sub-document are set to repeat the last o sentences of the previous sub-document. In this case, there are o sentences overlapping between two adjacent sub-documents (e.g., o = 3).

[0075] Document segmentation can divide long documents into semantically coherent sub-documents, preserving contextual coherence and reducing translation complexity.

[0076] This embodiment can also employ a fixed-length segmentation-based document segmentation method to complete document segmentation. The source document is segmented into sub-documents according to a fixed number of sentences (e.g., every 10 sentences) or a fixed character length. The implementation involves directly segmenting the input source document into sub-documents according to a fixed number of sentences (e.g., 10 sentences), using a simple segmentation algorithm without calculating semantic similarity or optimizing the semantic coherence quality of the sub-documents. Advantages include: simple implementation, low computational complexity, no need for pre-training a Word2Vec model or dynamic programming, and suitability for resource-constrained scenarios. Limitations include: fixed segmentation ignores semantic coherence, potentially leading to semantic breaks between sub-documents and affecting the contextual consistency of the translation (e.g., reduced accuracy (APT) for pronoun translation).

[0077] In this embodiment, the source document to be translated using the source language is obtained, and the source document to be translated is segmented to obtain multiple sub-documents. Each sub-document includes multiple sentences, and there are several overlapping sentences between two adjacent sub-documents.

[0078] The process of segmenting the source document to be translated into multiple sub-documents includes: segmenting the source document to be translated into multiple sub-documents according to the principle that each sub-document contains c sentences and there are o overlapping sentences between adjacent sub-documents, where c and o are positive integers.

[0079] The process involves segmenting the source document to be translated into multiple sub-documents. Specifically, this includes: establishing an objective function with the goal of maximizing the sum of the semantic coherence quality of all sub-documents; optimizing and solving the objective function; and segmenting the source document to be translated into multiple sub-documents.

[0080] The objective function is:

[0081]

[0082] Where n is the number of sub-documents; q(C i ) represents the i-th sub-document C i The quality of semantic coherence; p j For the i-th sub-document C i The j-th paragraph, which consists of several sentences; SIM(p j Z i ) is p j and Z i The semantic similarity between them, Z i For the i-th sub-document C i The centroid vector.

[0083] (II) Multi-granularity knowledge generation

[0084] (1) Global knowledge extraction can be completed by the global knowledge extraction module of the computing device.

[0085] 1) Bilingual summary generation:

[0086] For the i-th subdocument C i Generate source language summaries A using a large language model s,i and target language summary A t,i :

[0087] A s,i A t,i =L Summary (C i );

[0088] Among them, A s,i For the i-th sub-document C i Source language summary; A t,i For the i-th sub-document C i Target language summary; L Summary For large language models.

[0089] Merge the bilingual summaries of all sub-documents to form a global bilingual summary:

[0090]

[0091] Among them, A s For global source language summarization; L MergeS This is the summary merging module, specifically the large language model; The set of source language summaries for all sub-documents, containing the source language summary A of the i-th sub-document. s,i Where i ranges from 1 to n, and n is the number of sub-documents; A t A global target language summary; The set of target language summaries for all sub-documents, containing the target language summary A of the i-th sub-document. t,i , where i ranges from 1 to n, and n is the number of sub-documents.

[0092] Bilingual summarization refers to compressing and refining a sub-document to generate a concise version that retains the core information of the original text, with the aim of quickly extracting key information.

[0093] 2) Bilingual proper noun generation:

[0094] For the i-th subdocument C i Based on global source language summarization A s Use a large language model to extract the source language proper noun P of the i-th sub-document. i And for the proper noun P in the source language i The translation yields proper nouns in the target language:

[0095] P i =L ProperNouns (C i A s );

[0096] Among them, P i For the i-th sub-document C i The source language proper noun; L ProperNouns For large language models; A s This is a global source language summary.

[0097] Merge the source language proper nouns from all sub-documents, and for each source language proper noun, use the target language proper noun obtained from the first translation to ensure consistency:

[0098]

[0099] Where P1 is the initial global proper noun set; L MergeProperNouns This is a proper noun merging module, specifically a large language model; Let P be the set of source language proper nouns for all sub-documents, including the source language proper noun P of the i-th sub-document. i , where i ranges from 1 to n, and n is the number of sub-documents.

[0100] Add the target language proper noun obtained from the first translation of each source language proper noun in the initial global proper noun set P1 to the initial global proper noun set P1, and you get the global proper noun set P.

[0101] Proper nouns are the exclusive names of specific people, places, organizations, things, etc.

[0102] This embodiment can also employ rule-based proper noun extraction to generate bilingual proper nouns. It uses more precise alignment tools and scripts to extract bilingual proper nouns instead of relying on a large language model. The implementation involves using Named Entity Recognition (NER) tools (such as spaCy or BERT-based NER) to extract source language proper nouns (such as names of people, places, and organizations) from sub-documents. This is combined with a bilingual dictionary or alignment tool (such as Awesome-Align) to generate translations of the source language proper nouns, resulting in target language proper nouns. The source language proper nouns are then merged using rules (such as the highest frequency translation), and the target language proper nouns obtained from the first translation of each retained source language proper noun are added, resulting in a global set of proper nouns. The advantages are: more efficient than large language model extraction and lower computational overhead (no need for multiple calls to the large language model). Its limitations include: reliance on the quality of pre-trained NER tools and bilingual dictionaries; decreased accuracy when handling low-resource languages ​​or complex proper nouns (such as culture-specific terms); lack of contextual reasoning ability of large language models; potential omission of non-standard proper nouns; and lower consistency than large language models.

[0103] 3) Topic description generation:

[0104] For the i-th subdocument C i Generate topic descriptions, such as "social issues 50%, economy 30%, international relations 20%":

[0105] T i =L Theme (C i );

[0106] Among them, T i L is the topic description of the i-th sub-document; Theme For large language models.

[0107] The topic description is a concise summary of the core content of a sub-document, designed to quickly convey the main topic, focus, and key information of the sub-document.

[0108] The topic descriptions of all sub-documents are merged to form a global topic description:

[0109]

[0110] Where T represents the global topic description; L MergeTheme This is a topic merging module, specifically a large language model; The set of topic descriptions for all sub-documents, including the topic description T of the i-th sub-document. i , where i ranges from 1 to n, and n is the number of sub-documents.

[0111] By extracting global knowledge, document-level context (bilingual summaries), terminology consistency (bilingual proper nouns), and domain guidance (topic descriptions) can be provided to ensure global consistency in translation.

[0112] (2) Local knowledge extraction can be completed by the local knowledge extraction module of the computing device.

[0113] 1) Core topic generation:

[0114] For the i-th subdocument C i Generate core topic O i :

[0115] O i =L Topics (C i );

[0116] Among them, O i For the i-th sub-document C i The core topic; L Topics For large language models.

[0117] Core topics are not merged, and specific semantics of sub-documents are preserved.

[0118] The core topic refers to the most important and central theme or issue in a text, dialogue, discussion, or study. It is usually the main focus of the text or discussion, and the content surrounding it is often crucial for understanding the overall meaning.

[0119] This embodiment can also employ a keyword extraction-based topic and core topic generation method to complete topic description and core topic generation. Keyword extraction algorithms (such as TextRank and RAKE) are used instead of a large language model to generate topic descriptions and core topics. The implementation is as follows: for sub-documents, TextRank is used to extract high-frequency keywords, which are then directly used as topic descriptions and core topics, eliminating the need for large language model inference. When merging topic descriptions, a global topic description is generated based on keyword frequency weighting. Advantages include: high computational efficiency, no need for large language model calls, suitability for real-time translation scenarios, and mature and easy-to-implement keyword extraction algorithms. Limitations include: keyword extraction lacks semantic depth, potentially failing to accurately capture the topic distribution of sub-documents, affecting the domain adaptability of the translation; the core topic granularity is relatively coarse, unable to provide the fine-grained semantic guidance offered by large language models, resulting in decreased translation quality.

[0120] 2) Transition prompt generation:

[0121] For the i-th subdocument C i (i>1), generate a subdocument C that is the same as the previous subdocument C. i-1 Clues to logical relationships (such as cause and effect, progression):

[0122] H i =L Hint (C i-1 C i );

[0123] Among them, H i For the i-th sub-document C i Transition prompts; L Hint For large language models; C i-1 This is the (i-1)th sub-document.

[0124] Since the first subdocument does not have a previous subdocument, no transition hint is generated for the first subdocument; in effect, the transition hint for the first subdocument is empty.

[0125] By extracting local knowledge, we can enhance the semantic accuracy (core topics) within sub-documents and the connection between paragraphs (transition prompts).

[0126] In this embodiment, for each sub-document, a large language model is used to extract the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues. Transition cues are used to indicate the logical relationship between the sub-document and its predecessor. The large language model is then used to merge the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all sub-documents to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description. The global set of proper nouns includes the source language proper nouns and their corresponding target language proper nouns.

[0127] Specifically, this involves using a large language model to extract source language summaries, target language summaries, source language proper nouns, target language proper nouns, topic descriptions, core topics, and transition cues from sub-documents.

[0128] 1) Using a sub-document as input, extract the source language summary and target language summary of the sub-document using a large language model. The source language summary is a summary using the source language, and the target language summary can be understood as a summary obtained by translating the source language summary.

[0129] 2) Using the sub-document and global source language summary as input, the source language proper nouns of the sub-document are extracted using the large language model, and the source language proper nouns are translated to extract the target language proper nouns of the sub-document. The source language proper nouns are proper nouns using the source language, and the target language proper nouns are proper nouns using the target language.

[0130] 3) Using sub-documents as input, extract the topic description of the sub-documents using a large language model.

[0131] 4) Using sub-documents as input, extract the core topics of the sub-documents using a large language model.

[0132] 5) Using the sub-document and its previous sub-document as input, extract transition cues from the sub-document using a large language model.

[0133] Specifically, a large language model is used to merge the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all sub-documents to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description, which specifically include:

[0134] 1) Use a large language model to merge the source language summaries of all sub-documents to obtain a global source language summary.

[0135] 2) The target language summaries of all sub-documents are merged using a large language model to obtain a global target language summary.

[0136] 3) Use the large language model to merge the source language proper nouns of all sub-documents to obtain an initial global proper noun set. For each source language proper noun in the initial global proper noun set, select the target language proper noun obtained from the first translation of the source language proper noun as the target language proper noun corresponding to the source language proper noun. Combine the source language proper noun and the target language proper noun corresponding to the source language proper noun to form a global proper noun set.

[0137] 4) Use a large language model to merge the topic descriptions of all sub-documents to obtain a global topic description.

[0138] (iii) Knowledge-Augmented Translation can be performed by the translation module of a computing device.

[0139] (1) For the i-th sub-document C i Integrate global knowledge (Global Source Language Summary A) s Global Target Language Summary A t The global set of proper nouns P, the global topic description T, and local knowledge (the i-th sub-document C) i The core topic O i The i-th sub-document C i Transition prompt H i Generate translation sub-document T i :

[0140] T i =L Translate (C i A s A t ,P,T,O i H i );

[0141] Among them, T i For the i-th sub-document C i The translated sub-document obtained through translation; L Translate For large language models.

[0142] (2) A sentence alignment strategy is adopted to ensure a one-to-one correspondence between the source sentence and the target sentence. That is, the large language model outputs sentences in a form where each sentence in the sub-document corresponds to a sentence in the translated sub-document. If the sentences can be output in a one-to-one correspondence, the sentence alignment is successful, and the translated sub-document is output. If the sentences cannot be output in a one-to-one correspondence, the sentence alignment is unsuccessful, and translation and sentence alignment need to be performed again. The maximum number of retries is r. maxFor example, the maximum number of repetitions r max =20, if r is repeated max If sentence alignment fails, the final translated sub-document is manually adjusted before being output.

[0143] (3) Remove overlapping sentences:

[0144] T i1 =RemoveOverlap(T i ,o);

[0145] Among them, T i1 The first translated sub-document is the deduplicated sub-document; RemoveOverlap means to remove; o is the number of overlapping sentences. The first translated sub-document does not need to be removed. From the second translated sub-document to the last translated sub-document, the overlapping sentences at the beginning of each translated sub-document (i.e., sentences that overlap with the previous translated sub-document) are removed.

[0146] (4) Concatenate all deduplicated sub-documents T i1 This generates a complete translated target document in the target language.

[0147] High-quality, coherent translations are generated through multi-granular knowledge enhancement and sentence alignment.

[0148] In this embodiment, for each sub-document, the large language model is used as input, taking the sub-document, global source language summary, global target language summary, global proper noun set, global topic description, and the sub-document's core topic and transition cues. This translates the sub-document into the target language, and the sub-document and the translated sub-document are then aligned sentence-to-sentence. If alignment is successful, the translated sub-document is output. For each translated sub-document, the large language model removes sentences that overlap with the previous translated sub-document, resulting in a deduplicated sub-document. All deduplicated sub-documents are then concatenated to obtain the translated target document in the target language.

[0149] If sentence alignment fails, the process repeats the steps of "using the sub-document, global source language summary, global target language summary, global proper noun set, global topic description, and core topics and transition prompts of the sub-document as input, translating the sub-document using a large language model to obtain a translated sub-document in the target language, and aligning the sub-document and the translated sub-document with sentences" until sentence alignment is successful or the maximum number of repetitions is reached. If the sentences are not aligned after reaching the maximum number of repetitions, the translated sub-document obtained after manual adjustment of the last translated sub-document is output.

[0150] This embodiment relies on a large language model, enabling plug-and-play functionality. Therefore, it provides a plug-and-play document-level machine translation method based on multi-granularity knowledge enhancement, which has the following advantages:

[0151] (1) High translation quality: On the IWSLT2017 dataset, the sCOMET score is improved by about 2 points (e.g., under the DeepSeek-R1:32B model, the sCOMET score of this embodiment is 84.88, and the sCOMET score of related technologies is 83.39), and the dCOMET score is improved by 0.1-0.5 points.

[0152] This advantage stems from the technical aspects of "sub-document segmentation and multi-granularity knowledge enhancement." Sub-document segmentation preserves contextual coherence, while multi-granularity knowledge (bilingual summaries, bilingual proper nouns, topic descriptions, core topics, and transition prompts) enhances the semantic accuracy and global consistency of the translation.

[0153] (2) High consistency: The terminology consistency (LTCR-1) is improved by about 6 points (e.g., in the direction of En (English) → Xx (any target language), the LTCR-1 of this embodiment is 86.05, and the LTCR-1 of related technologies is 80.01), and the consistency of proper noun translation is significantly improved.

[0154] This advantage stems from the technical aspect of "extracting global knowledge (bilingual summaries, bilingual proper nouns, and topic descriptions) and local knowledge (core topics and transition prompts) to enhance the coherence and consistency of the translation." In particular, the extraction and merging of proper nouns and the inclusion of core topics ensure the uniformity of terminology throughout the document.

[0155] The main experimental results on the IWSLT2017 dataset are shown in Table 1. Performance was evaluated using quality and terminology consistency metrics. For quality, two neural-based COMET metrics were used: sentence-level COMET score (sCOMET) and document-level COMET score (dCOMET). For terminology consistency, LTCR-1 and LTCR-12 were used. f .

[0156] Table 1 Performance evaluation indicators for quality and terminology consistency

[0157]

[0158] Table 1 shows the experimental results on the IWSLT2017 dataset. NLLB and GooGLE are both translation models, and their translation results are included as evaluation benchmarks. NLLB can be specifically NLLB-3.3B. The LLM+Sentence method processes each sentence independently without considering the document-level context. The LLM+Context method adds three preceding source-target language sentence pairs to the prompts to improve local coherence. The LLM+Doc2Doc method prompts the large language model to translate 10 sentences simultaneously in one dialogue. The DELTA method uses sentence-by-sentence translation and uses multi-level memory prompts to guide the consistency and fluency of the translation. SubDocTrans is the method in this embodiment. Since the translation generated by the LLM+Doc2Doc method is not aligned with the original text at the sentence level, the sCOMET score of this method is not reported. The best performance in each block is highlighted in bold, and the second best performance is marked with an underline.

[0159] (3) Low omission rate: The sentence omission rate was reduced from 8.75% to 0.75%, and the sentence alignment strategy ensured complete translation.

[0160] This advantage stems from the technical point of "generating high-quality translations through sentence alignment strategies, reducing omissions and illusions." The sentence alignment strategy ensures the complete translation of all source sentences through mandatory one-to-one translation and retry mechanisms.

[0161] Table 2 shows that SubDocTrans significantly reduces the missing sentences compared to LLM+Doc2Doc, with a missing sentence rate of 0.75 compared to 8.75 for LLM+Doc2Doc. This improvement stems from the use of a sentence alignment strategy that enforces a one-to-one mapping between source and target sentences. Table 2 also reports the average number of retries (Avg. Retries), measuring the average number of retries required for the method in this embodiment to generate valid output, as well as the translation time. LLM+Doc2Doc achieves the fastest translation time (0.21) by translating multiple sentences (without alignment and retry mechanisms), while SubDoc-Trans completes the translation in 0.48 hours with only 0.40 retries, demonstrating its ability to ensure high-quality translation at minimal cost.

[0162] Table 2 Omitted Performance Evaluation Indicators

[0163]

[0164] Table 2 shows the impact of sentence alignment strategies on omission errors. Since the LLM+Doc2Doc method does not require retries, the average number of retries is not reported.

[0165] (4) Low illusion: The unaligned translation word (UTW) score is reduced (e.g., in the En→Xx direction, the UTW in this embodiment is 23.31, while the UTW in related technologies is a higher value than the baseline), reducing the generation of irrelevant content.

[0166] This advantage stems from the technical points of "sub-document segmentation and multi-granularity knowledge enhancement" and "generating high-quality translations through sentence alignment strategies to reduce omissions and illusions." Multi-granularity knowledge provides accurate semantic guidance for translation, while sentence alignment strategies reduce the possibility of generating irrelevant content.

[0167] Figure 3 To use DeepSeek-R1:14B on the IWSLT2017 dataset to analyze four language pairs (English) UTW scores for (Chinese, German, French, and Japanese language tracks) Figure 3 In this context, Sentence is LLM+Sentence, Doc2Doc is LLM+Doc2Doc, and Context is LLM+Context. SubDocTrans in... The UTW score in SubDocTrans is 23.31, lower than the UTW scores of Context and Doc2Doc, and consistently lower than the UTW score of DELTA. This suggests that SubDocTrans helps reduce illusions, thereby improving translation quality.

[0168] (5) High efficiency: In Figure 4 In the text, DeepSeek-R1:14B and DeepSeek-R1:32B were used to extract English text. Document translation in Chinese, German, French, and Japanese. Figure 4 In this context, Doc2Doc is equivalent to LLM+Doc2Doc, Sentence is equivalent to LLM+Sentence, and Context is equivalent to LLM+Context. Since the Doc2Doc method can translate multiple sentences simultaneously without any additional input, it is the most efficient. Besides Doc2Doc, the method in this embodiment is superior to other methods.

[0169] This advantage stems from the technique of "segmenting the source document into semantically coherent sub-documents while preserving contextual coherence," which reduces translation complexity.

[0170] This application also provides an application scenario in which the above-described document-level machine translation method based on multi-granularity knowledge enhancement is applied. Specifically, the document-level machine translation method based on multi-granularity knowledge enhancement provided in this embodiment can be applied to document translation scenarios. Document translation scenarios include a translation stage and a presentation stage. The translation stage is used to translate a source document using the source language to obtain a target document using the target language. The presentation stage is used to display the target document using the target language to the user. The document-level machine translation method based on multi-granularity knowledge enhancement provided in this embodiment belongs to the translation stage.

[0171] Example 2

[0172] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a document-level machine translation method based on multi-granularity knowledge enhancement.

[0173] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0174] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the document-level machine translation method based on multi-granularity knowledge enhancement in Embodiment 1.

[0175] Example 3

[0176] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the document-level machine translation method based on multi-granularity knowledge enhancement in Embodiment 1.

[0177] Example 4

[0178] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the document-level machine translation method based on multi-granularity knowledge enhancement in Embodiment 1.

[0179] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0180] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0181] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A document-level machine translation method based on multi-granularity knowledge enhancement, characterized in that, The document-level machine translation method based on multi-granularity knowledge enhancement includes: Obtain the source document to be translated, which uses the source language. The source document to be translated is segmented to obtain multiple sub-documents; each sub-document includes multiple sentences, and there are several overlapping sentences between adjacent sub-documents; For each sub-document, the source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topic, and transition cues are extracted using a large language model; the transition cues are used to indicate the logical relationship between the sub-document and its previous sub-document. The source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all the sub-documents are merged using a large language model to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description; the global set of proper nouns includes the source language proper nouns and the corresponding target language proper nouns. For each sub-document, the sub-document, the global source language summary, the global target language summary, the global proper noun set, the global topic description, and the core topic and transition cues of the sub-document are used as input. The sub-document is translated using a large language model to obtain a translated sub-document in the target language. Sentence alignment is performed between the sub-document and the translated sub-document. If the sentence alignment is successful, the translated sub-document is output. For each translated sub-document, a large language model is used to remove sentences in the translated sub-document that overlap with the previous translated sub-document, resulting in a deduplicated sub-document. All the deduplicated sub-documents are concatenated to obtain the translated target document in the target language.

2. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 1, characterized in that, The source document to be translated is segmented into multiple sub-documents. Specifically, the source document to be translated is segmented into multiple sub-documents according to the principle that each sub-document contains c sentences and there are o overlapping sentences between adjacent sub-documents; where c and o are positive integers.

3. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 1, characterized in that, The source document to be translated is segmented into multiple sub-documents. Specifically, this includes: establishing an objective function with the goal of maximizing the sum of the semantic coherence quality of all sub-documents; and optimizing and solving the objective function to segment the source document to be translated into multiple sub-documents.

4. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 3, characterized in that, The objective function is: Where n is the number of sub-documents; q(C i ) represents the i-th sub-document C i The quality of semantic coherence; p j For the i-th sub-document C i The j-th paragraph, which consists of several sentences; SIM(p j Z i ) is p j and Z i The semantic similarity between them, Z i For the i-th sub-document C i The centroid vector.

5. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 1, characterized in that, The source language summary, target language summary, source language proper nouns, target language proper nouns, topic description, core topics, and transition cues of the sub-document are extracted using a large language model, specifically including: Using the sub-document as input, a large language model is used to extract the source language summary and the target language summary of the sub-document; the source language summary is a summary using the source language, and the target language summary is a summary using the target language; Using the sub-document and the global source language summary as input, the source language proper nouns of the sub-document are extracted using a large language model, and the source language proper nouns are translated to extract the target language proper nouns of the sub-document; the source language proper nouns are proper nouns using the source language, and the target language proper nouns are proper nouns using the target language. Using the sub-document as input, a large language model is used to extract the topic description of the sub-document; Using the sub-document as input, the core topics of the sub-document are extracted using a large language model; Using the sub-document and its previous sub-document as input, a large language model is used to extract transition cues from the sub-document.

6. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 1, characterized in that, Using a large language model, the source language summary, target language summary, source language proper nouns, target language proper nouns, and topic description of all the aforementioned sub-documents are merged to obtain a global source language summary, a global target language summary, a global set of proper nouns, and a global topic description, specifically including: The source language summaries of all the sub-documents are merged using a large language model to obtain a global source language summary; The target language summaries of all the sub-documents are merged using a large language model to obtain a global target language summary; The source language proper nouns of all the sub-documents are merged using a large language model to obtain an initial global proper noun set. For each source language proper noun in the initial global proper noun set, the target language proper noun obtained from the first translation of the source language proper noun is selected as the target language proper noun corresponding to the source language proper noun. The source language proper noun and the target language proper noun corresponding to the source language proper noun are combined to form a global proper noun set. The topic descriptions of all the sub-documents are merged using a large language model to obtain a global topic description.

7. The document-level machine translation method based on multi-granularity knowledge enhancement according to claim 1, characterized in that, If sentence alignment fails, the process repeats the process of "using the sub-document, the global source language summary, the global target language summary, the global proper noun set, the global topic description, and the core topic and transition prompts of the sub-document as input, translating the sub-document using a large language model to obtain a translated sub-document in the target language, and then aligning the sub-document and the translated sub-document with sentences" until sentence alignment is successful or the maximum number of repetitions is reached. If sentences are not aligned after the maximum number of repetitions is reached, the translated sub-document obtained after manual adjustment of the last translated sub-document is output.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the document-level machine translation method based on multi-granularity knowledge enhancement as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the document-level machine translation method based on multi-granularity knowledge enhancement as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the document-level machine translation method based on multi-granularity knowledge enhancement as described in any one of claims 1-7.