Intelligent machine translation method and device based on pre-trained large language model

Through an intelligent machine translation method based on pre-trained large language model, using professional knowledge graphs to identify and correct translation ambiguity, the shortcomings of the existing technology in the professional field of translation are solved, and efficient translation results are achieved.

CN119227699APending Publication Date: 2024-12-31SHANGHAI YOUSE NET INFORMATION TECH HOLIDNGS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411265295.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing translation system based on rules, phrases and statistical models has limitations in dealing with complex syntactic structures, industry-specific terms and contextual understanding. It is difficult to ensure accuracy and consistency in translation in professional fields and cannot meet professional technology. Efficient translation needs of personnel.

Method used

Using an intelligent machine translation method based on pre-trained large language model, by inputting the phrase set in the short corpus of short essays for traversal, judging the co-occurrence frequency value of the translated short sentences, identifying and correcting the translation ambiguity, replacing the term phrases, and calculating similarity Repeat the correct translation until the accurate translation is obtained.

Benefits of technology

It significantly improves the accuracy and reliability of translation, especially in short essay corpus and professional field terminology scenarios, meeting the efficient translation needs of professional and technical personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227699A_ABST
    Figure CN119227699A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of translation processing, and discloses an intelligent machine translation method and device based on a pre-trained large language model.The intelligent machine translation method comprises the steps that a large language model is used for translating a short text corpus to obtain a first translated text, and a phrase set in a translated short sentence is extracted; inputting the combined entity to be tested into the professional knowledge graph for traversal, and judging whether the corresponding translation short sentence has translation ambiguity or not according to a co-occurrence frequency value obtained after traversal; when translation ambiguity exists, ambiguous term words are obtained, replacement phrases are searched out, the ambiguous term words are replaced according to the replacement phrases, and replacement short sentences are obtained; calculating the similarity between each replacement short sentence after back translation and the corresponding original short sentence, and obtaining a corrected translation according to the similarity; repeating the steps until the corrected translations of the original short sentences are obtained, and fusing the corrected translations of the original short sentences into a second translated text; according to the method, translation errors of the terminology can be effectively recognized and corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of translation processing technology, and more specifically, to an intelligent machine translation method and device based on a pre-trained large language model. Background Art

[0002] With the acceleration of globalization, the importance of cross-language communication has become increasingly prominent. Machine translation, as a key technology to eliminate language barriers, has been widely used in various industries. However, existing translation systems based on rules, phrases and statistical models show obvious limitations in dealing with complex syntactic structures, industry-specific terminology and contextual understanding. These systems often find it difficult to ensure the accuracy and coherence of translation when dealing with multi-language, multi-domain and multi-scenario translation tasks. In particular, when faced with tasks in professional fields such as technical literature, legal documents or medical documents that are highly dependent on the accuracy of terminology, the shortcomings of traditional translation methods are more prominent.

[0003] With the rapid development of artificial intelligence technology, the emergence of pre-trained large language models has brought new breakthroughs in the field of machine translation. Through unsupervised learning on large-scale corpora, pre-trained large language models have demonstrated strong semantic understanding and language generation capabilities, and can better capture complex contextual relationships and generate translations that are more in line with the target language habits. However, when these large language models translate short text corpora and professional terminology scenarios, they are often unable to effectively identify and correct translation errors in professional terminology, resulting in a lack of professionalism and accuracy in the translation of short texts in proprietary fields, and the reliability and consistency of translation or error correction cannot be guaranteed, making it difficult to meet the efficient translation needs of professional technicians. Summary of the invention

[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides an intelligent machine translation method and device based on a pre-trained large language model.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, an intelligent machine translation method based on a pre-trained large language model is provided, the method comprising:

[0007] Translating a short text corpus using a pre-trained large language model to obtain a first translated text containing at least one translated short sentence, and extracting a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object;

[0008] After the subject and object in the translation short sentence are merged into the combination entity to be tested, they are input into the preset professional knowledge map for traversal, and the co-occurrence frequency value of the combination entity to be tested is obtained according to the traversal result, and it is judged whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value;

[0009] When there is translation ambiguity, the subject and the object in the corresponding translation sentence are used as ambiguous terms, and multiple replacement phrases are searched out based on the phrase set in the corresponding translation sentence, and the ambiguous terms in the translation sentence are replaced according to the replacement phrases to obtain multiple replacement sentences;

[0010] After back-translating each replacement short sentence, the similarity between each back-translated replacement short sentence and the corresponding original short sentence is calculated, and the revised translation of the corresponding original short sentence is obtained according to the similarity;

[0011] Repeat the above steps until the revised translation of each original short sentence is obtained, and merge the revised translation of each original short sentence into the second translation text.

[0012] Furthermore, the generation logic of the preset professional knowledge graph is as follows:

[0013] Extracting the subject-predicate-object structure of each sentence from a parallel corpus in a professional field to obtain knowledge data, wherein the knowledge data includes a subject, a predicate and an object;

[0014] The relationship between the subject and object in each sentence as a single entity, and the predicate in each sentence as a single entity;

[0015] Based on the relationship between single entities, a triple containing <single entity, relationship, single entity> is constructed, and the single entity in the triple is used as the initial node of the graph, and the relationship between the single entities is used as the initial edge between the nodes in the graph to form an initial knowledge graph;

[0016] The subject and object in each sentence are fused as a composite entity, and the co-occurrence frequency value of the composite entity is obtained, and the co-occurrence frequency value is used as the attribute value of the composite entity;

[0017] According to the predefined relationship between a single entity and a composite entity and the attribute rules of the composite entity, a new triple containing <single entity, relationship, composite entity> and <composite entity, attribute, attribute value> is constructed;

[0018] The combined entity in the new triple is used as a new node, and the relationship between the single entity and the combined entity in the new triple is used as a new edge;

[0019] The initial knowledge graph is expanded according to the newly added nodes and edges, and the attributes of the combined entities are supplemented according to the attribute values ​​in the new triples to form a professional knowledge graph.

[0020] Further, the obtaining of the co-occurrence frequency value of the combination entity to be tested according to the traversal result includes:

[0021] Extract traversal results;

[0022] If the traversal result returns a composite entity in the professional knowledge graph, the attributes of the corresponding composite entity are obtained, and the corresponding attribute values ​​are retrieved according to the attributes of the corresponding composite entity to obtain the co-occurrence frequency value of the composite entity to be tested;

[0023] If the traversal result returns an empty set, the co-occurrence frequency value of the combined entity to be tested is output as zero.

[0024] Furthermore, the determining whether there is translation ambiguity in the corresponding translated sentence includes:

[0025] Obtaining a co-occurrence frequency value of the combined entity to be tested, and comparing the co-occurrence frequency value with a preset co-occurrence frequency threshold;

[0026] If the co-occurrence frequency value is greater than the co-occurrence frequency threshold, it is determined that the corresponding translation phrase to which the tested combined entity belongs does not have translation ambiguity;

[0027] If the co-occurrence frequency value is less than or equal to the co-occurrence frequency threshold, it is determined that the corresponding translation phrase to which the tested combined entity belongs has translation ambiguity.

[0028] Furthermore, searching for multiple replacement phrases based on the phrase set in the corresponding translated short sentence includes:

[0029] Extracting the subject and predicate in the corresponding translated sentence; or extracting the predicate and object in the corresponding translated sentence;

[0030] Treat the subject and predicate as one phrase pair X, or treat the predicate and object as another phrase pair Y;

[0031] Input phrase pair X or phrase pair Y into the professional knowledge graph for retrieval, and obtain knowledge data matching phrase pair X or phrase pair Y, wherein the knowledge data includes a single entity identical to the subject, a relationship between single entities matching the predicate, and multiple single entities related to the subject; or includes a single entity identical to the object, a relationship between single entities matching the predicate, and multiple single entities related to the object;

[0032] Each single entity related to the subject is used as a replacement phrase, or each single entity related to the subject is used as a replacement phrase to obtain multiple replacement phrases.

[0033] Furthermore, obtaining a corrected translation of the original short sentence according to the similarity includes:

[0034] Retrieving the similarity between each back-translated replacement sentence and the corresponding original sentence to obtain multiple similarities;

[0035] Filtering out similarities greater than a preset similarity threshold from multiple similarities, taking the similarities greater than the preset similarity threshold as credible similarities, and obtaining multiple credible similarities;

[0036] The multiple credible similarities are sorted from large to small according to the numerical values, and the replacement short sentence before back-translation corresponding to the first credible similarity ranking is used as the revised translation of the corresponding original short sentence.

[0037] In a second aspect, an intelligent machine translation device based on a pre-trained large language model is provided, comprising:

[0038] A model translation module is used to translate a short text corpus using a pre-trained large language model to obtain a first translation text containing at least one translated short sentence, and extract a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object;

[0039] The translation detection module is used to fuse the subject and object in the translation short sentence into a combination entity to be tested, input it into a preset professional knowledge map for traversal, obtain the co-occurrence frequency value of the combination entity to be tested according to the traversal result, and judge whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value;

[0040] A search and replace module is used for, when there is translation ambiguity, taking the subject and object in the corresponding translation sentence as ambiguous terms, searching for multiple replacement phrases based on the phrase set in the corresponding translation sentence, and replacing the ambiguous terms in the translation sentence according to the replacement phrases to obtain multiple replacement sentences;

[0041] A back-translation discrimination module is used to calculate the similarity between each back-translated replacement sentence and the corresponding original sentence after back-translation of each replacement sentence, and obtain a revised translation of the corresponding original sentence according to the similarity;

[0042] The translation correction module is used to repeat the above steps until a corrected translation of each original short sentence is obtained, and the corrected translation of each original short sentence is merged into a second translation text.

[0043] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the intelligent machine translation method based on the pre-trained large language model described in any one of the above items is implemented.

[0044] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the intelligent machine translation method based on the pre-trained large language model described in any one of the above items is implemented.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] The present application discloses an intelligent machine translation method and device based on a pre-trained large language model, comprising: using a large language model to translate a short text corpus to obtain a first translation text, and extracting a phrase set in the translation short sentence; inputting the combination entity to be tested into the professional knowledge map for traversal, and judging whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value obtained after the traversal; when there is translation ambiguity, obtaining ambiguous terminology and searching for replacement phrases, replacing the ambiguous terminology according to the replacement phrases, and obtaining a replacement short sentence; calculating the similarity between each replacement short sentence after back translation and the corresponding original short sentence, and obtaining a corrected translation according to the similarity; repeating the above steps until the corrected translation of each original short sentence is obtained, and fusing the corrected translation of each original short sentence into a second translation text; based on the above technical features, the present invention can effectively identify and correct the translation errors of professional terms, especially in the short text corpus and professional field terminology scenarios, significantly improve the accuracy of translation, and can ensure the reliability and consistency of translation or error correction, thereby helping to meet the efficient translation needs of professional and technical personnel to a great extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of the intelligent machine translation method based on a pre-trained large language model provided by the present invention;

[0048] Figure 2 A module structure diagram of an intelligent machine translation device based on a pre-trained large language model provided by the present invention;

[0049] Figure 3 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Example 1

[0052] See also Figure 1As shown, this embodiment discloses an intelligent machine translation method based on a pre-trained large language model, the method comprising:

[0053] S101: using a pre-trained large language model to translate a short text corpus to obtain a first translated text containing at least one translated short sentence, and extracting a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object;

[0054] It should be understood that: the short article corpus is formed after the user actively inputs the pre-trained large language model; wherein, the pre-trained large language model is an existing large language model, such as OpenAI's GPT series, Google's BERT, T5 and Meta's LLaMA, etc. Such pre-trained models have billions to hundreds of billions of parameters, so they are called "large language models"; most of them are based on the Transformer architecture, and the Transformer architecture model captures the contextual relationship in the sentence through the self-attention mechanism, which can effectively handle long-distance dependencies, especially in complex sentence structures, and thus gradually replaces the traditional rule-based or statistical-based translation methods; although the above-mentioned pre-trained large language model has a good performance in the translation scenario of long texts, when professionals apply it to the translation scenario of short articles related to professional terms, terminology translation errors frequently occur;

[0055] It should be noted that: the phrase set (i.e., subject, predicate, and object) in each translated short sentence is obtained by performing word segmentation processing and part-of-speech tagging on each translated short sentence; wherein, the word segmentation processing is implemented by an existing word segmentation tool, such as JIEBA word segmentation, etc.;

[0056] For example, suppose there is a short text corpus, and it only contains one original short sentence, which is "Apple has launched a new foldable phone". After translating the original short sentence using the pre-trained large language model, the Chinese version "Apple has launched a new foldable phone" is obtained. After word segmentation processing is performed on the translated short sentence, "Apple / released / a / new / foldable phone" is obtained; finally, after part-of-speech tagging is performed on the translated short sentence after word segmentation processing, the subject "Apple", the predicate "released" and the object "foldable phone" are obtained; therefore, by extracting "Apple", "released" and "foldable phone", the phrase set in the translated short sentence is obtained.

[0057] S102: After the subject and the object in the translation short sentence are merged into a combination entity to be tested, the combination entity to be tested is input into a preset professional knowledge map for traversal, and the co-occurrence frequency value of the combination entity to be tested is obtained according to the traversal result, and whether the corresponding translation short sentence has translation ambiguity is determined according to the co-occurrence frequency value;

[0058] Specifically, the generation logic of the preset professional knowledge graph is as follows:

[0059] Extracting the subject-predicate-object structure of each sentence from a parallel corpus in a professional field to obtain knowledge data, wherein the knowledge data includes a subject, a predicate and an object;

[0060] It should be noted that the parallel corpus is collected and selected by the user according to his or her own professional field, such as the parallel corpus JRC-Acquis in the field of law, the parallel corpus UMLS in the field of medicine, etc.

[0061] It should also be noted that: similar to the logic of extracting phrase sets from the translated short sentences, each sentence will be segmented and tagged before extracting the subject-predicate-object structure of each sentence. After the segmentation and POS tagging, the subject, predicate and object will be extracted using existing extraction tools, including but not limited to spaCy, StanfordNER, etc.

[0062] The relationship between the subject and object in each sentence as a single entity, and the predicate in each sentence as a single entity;

[0063] Based on the relationship between single entities, a triple containing <single entity, relationship, single entity> is constructed, and the single entity in the triple is used as the initial node of the graph, and the relationship between the single entities is used as the initial edge between the nodes in the graph to form an initial knowledge graph;

[0064] The subject and object in each sentence are fused as a composite entity, and the co-occurrence frequency value of the composite entity is obtained, and the co-occurrence frequency value is used as the attribute value of the composite entity;

[0065] The logic for obtaining the co-occurrence frequency value of the composite entity must ensure that the subject and object in the composite entity are in the same sentence, and only then will the composite entity be counted as co-occurring once;

[0066] For example, suppose the user's professional field is the field of electronic products, and there are two sentences in the parallel corpus in the field of electronic products, namely "Apple has released a new folding phone" and "The latest bionic chip is installed on this folding phone"; after word segmentation, part-of-speech tagging and extraction of each sentence, it is found that the subject in the first sentence is "Apple", the predicate is "released", and the object is "Apple"; and the subject in the second sentence is "bionic chip", the predicate is "installed", and the object is "folding phone"; although the first sentence and the second sentence are in the same text segment, the co-occurrence frequency value is It can be seen from the limited acquisition logic that when collecting the co-occurrence frequency values ​​of "Apple" and "folding phone", the combined entity only co-occurs once in the first sentence. Although "folding phone" also appears once in the second sentence, "Apple" in the first sentence and "folding phone" in the second sentence cannot be counted as co-occurrence once; therefore, according to the acquisition logic, the co-occurrence times of "Apple" and "folding phone" in other sentences are obtained to obtain the co-occurrence frequency value of the combined entity; for example, in the parallel corpus in the field of electronic products, "Apple" and "folding phone" appear in 5 sentences, and the co-occurrence frequency value of the combined entity is counted as 5;

[0067] According to the predefined relationship between a single entity and a composite entity and the attribute rules of the composite entity, a new triple containing <single entity, relationship, composite entity> and <composite entity, attribute, attribute value> is constructed;

[0068] The relationship between the predefined single entity and the combined entity includes but is not limited to a co-occurrence relationship and a containment relationship, etc.; the attribute rules of the predefined combined entity at least include the attribute aspect of co-occurrence frequency;

[0069] The combined entity in the new triple is used as a new node, and the relationship between the single entity and the combined entity in the new triple is used as a new edge;

[0070] The initial knowledge graph is expanded according to the newly added nodes and edges, and the attributes of the combined entities are supplemented according to the attribute values ​​in the new triples to form a professional knowledge graph.

[0071] In implementation, the step of obtaining the co-occurrence frequency value of the combination entity to be tested according to the traversal result includes:

[0072] Extract traversal results;

[0073] If the traversal result returns a composite entity in the professional knowledge graph, the attributes of the corresponding composite entity are obtained, and the corresponding attribute values ​​are retrieved according to the attributes of the corresponding composite entity to obtain the co-occurrence frequency value of the composite entity to be tested;

[0074] If the traversal result returns an empty set, the co-occurrence frequency value of the combined entity to be tested is output as zero;

[0075] It can be understood that: when the subject and object in the translation sentence are merged into the composite entity to be tested, and after being input into the preset professional knowledge graph for traversal, no composite entity consistent with it is found in the professional knowledge graph (that is, the traversal result returns an empty set), it means that there is no combination of the subject and the object, and the co-occurrence frequency value of the composite entity to be tested is assigned to zero; on the contrary, if the traversal result returns a composite entity in the professional knowledge graph, it means that there is a composite entity consistent with it in the professional knowledge graph, and the attribute value of the composite entity consistent with it is retrieved, that is, the co-occurrence frequency value of the composite entity to be tested is obtained; wherein, "consistent" means that the input composite entity to be tested is exactly the same as the retrieved composite entity; for example, the input composite entity to be tested is "Apple" and "folding phone", and the traversed composite entities are also "Apple" and "folding phone", which means they are consistent; if the traversed composite entities are "Apple" and "folding phone", it means they are inconsistent;

[0076] Exemplarily, assuming that the combined entities to be tested that are traversed in the preset professional knowledge graph are "Apple" and "foldable phone", and the combined entities to be tested exist in the professional knowledge graph, and the attribute values ​​of "Apple" and "foldable phone" in the professional knowledge graph are 5, then the co-occurrence frequency value of the combined entity to be tested is output as 5; assuming that the combined entities to be tested that are traversed in the preset professional knowledge graph are "Apple" and "foldable phone", and the combined entities to be tested do not exist in the professional knowledge graph, then the co-occurrence frequency value of the combined entity to be tested is assigned to zero;

[0077] It is worth noting that: when the combined entity to be tested is input into the preset professional knowledge graph for traversal, the principle of language consistency is followed; for example, if the input combined entity to be tested is in Chinese, only combined entities in Chinese will be retrieved when searching in the professional knowledge graph.

[0078] In implementation, the step of determining whether there is translation ambiguity in the corresponding translated sentence includes:

[0079] Obtaining a co-occurrence frequency value of the combined entity to be tested, and comparing the co-occurrence frequency value with a preset co-occurrence frequency threshold;

[0080] If the co-occurrence frequency value is greater than the co-occurrence frequency threshold, it is determined that the corresponding translation phrase to which the tested combined entity belongs does not have translation ambiguity;

[0081] If the co-occurrence frequency value is less than or equal to the co-occurrence frequency threshold, it is determined that the corresponding translation sentence to which the tested combined entity belongs has translation ambiguity;

[0082] Exemplarily, following the above assumption, there is a short text corpus, and it only contains one original short sentence, which is "Apple has released a new foldable phone". After translating the original short sentence using the pre-trained large language model, the Chinese "Apple has released a new foldable phone" is obtained. According to the above example, "Apple" is the subject, "release" is the predicate, and "foldable phone" is the object. Therefore, "Apple" and "foldable phone" are used as the combined entities to be tested; continuing, assuming that the combined entity to be tested is input into the preset professional knowledge map (that is, the professional knowledge map in the field of electronic products) for traversal, it is found that the traversal result is an empty set, then the co-occurrence frequency value of "Apple" and "foldable phone" is assigned to zero, and after comparing the co-occurrence frequency value of "Apple" and "foldable phone" with the co-occurrence frequency threshold, it is found that the co-occurrence frequency value of "Apple" and "foldable phone" is less than or equal to the preset co-occurrence frequency threshold, then it is determined that the corresponding translated short sentence to which the combined entity to be tested belongs (that is, "Apple has released a new foldable phone") has translation ambiguity; this is because, in the field of electronic products, In the professional knowledge graph, "Apple" is a company name, not a fruit name. Therefore, it cannot be directly translated, and then the corresponding translated sentence, that is, the translation "Apple released a new folding phone", is determined to be an incorrect translation; if after translating the original sentence, the Chinese "Apple Inc. released a new folding phone" is obtained, then "Apple Inc." and "folding phone" are used as the combined entity to be tested, and then the combined entity to be tested is input into the preset professional knowledge graph (that is, the professional knowledge graph in the field of electronic products) for traversal, and it is found that the traversal result is a combined entity of "Apple Inc." and "folding phone", and the co-occurrence frequency value of the combined entity in the professional knowledge graph is 5. After comparing it with the co-occurrence frequency threshold, it is found that its co-occurrence frequency value is greater than the preset co-occurrence frequency threshold, then it is determined that the corresponding translated sentence to which the combined entity to be tested belongs (that is, "Apple released a new folding phone") has no translation ambiguity, that is, it is the correct translation.

[0083] S103: when there is translation ambiguity, taking the subject and the object in the corresponding translation sentence as ambiguous terms, searching for multiple replacement phrases based on the phrase set in the corresponding translation sentence, and replacing the ambiguous terms in the translation sentence according to the replacement phrases to obtain multiple replacement sentences;

[0084] It can be understood that: professional terms are nouns, so they appear in the subject and object positions in the original short sentence. When the corresponding translated short sentence has translation ambiguity, it means that the professional terms in the subject or object position have translation errors. Therefore, the subject and object in the corresponding translated short sentence are regarded as ambiguous terms.

[0085] In implementation, the step of searching for multiple replacement phrases based on the phrase set in the corresponding translated short sentence includes:

[0086] Extracting the subject and predicate in the corresponding translated sentence; or extracting the predicate and object in the corresponding translated sentence;

[0087] Treat the subject and predicate as one phrase pair X, or treat the predicate and object as another phrase pair Y;

[0088] Input phrase pair X or phrase pair Y into the professional knowledge graph for retrieval, and obtain knowledge data matching phrase pair X or phrase pair Y, wherein the knowledge data includes a single entity identical to the subject, a relationship between single entities matching the predicate, and multiple single entities related to the subject; or includes a single entity identical to the object, a relationship between single entities matching the predicate, and multiple single entities related to the object;

[0089] Taking each single entity related to the subject as a replacement phrase, or taking each single entity related to the subject as a replacement phrase to obtain multiple replacement phrases;

[0090] It can be understood that: multiple professional terms (i.e., single entities) are pre-stored in the professional knowledge graph, and each professional term is associated and bound through the relationship between the pre-extracted single entities; then, for the combination of the subject and the predicate in the corresponding translation sentence (forming a phrase pair X), or for the combination of the object and the predicate (forming a phrase pair Y), then, the phrase pair X or the phrase pair Y formed after the combination is input into the professional knowledge graph for search, so that multiple single entities associated with the professional terms can be found, and the multiple single entities are used as replacement phrases, and then, they are replaced with the subject or object in the corresponding translation sentence to form a replacement sentence, and finally, by back-translating the replacement sentence and performing a similarity comparison after the back-translation, the correct translation of the original sentence, i.e., the revised translation of the original sentence, can be determined; thereby, the translation correction of the pre-trained large language model can be realized, the shortcomings of the pre-trained large language model in the translation of short articles related to professional terms can be overcome, and the translation accuracy and efficiency of the pre-trained large language model can be improved;

[0091] Exemplarily, continuing with the above assumption, after translating "Apple has released a new foldable phone", the Chinese version "Apple has released a new foldable phone" is obtained. According to the above example, the translated sentence is ambiguous, that is, the translation is wrong, and the subject is "Apple", the predicate is "release", and the object is "foldable phone". Therefore, combining "Apple" and "release" will result in phrase pair X, and combining "release" and "foldable phone" will result in phrase pair Y. Regardless of whether phrase pair X or phrase pair Y is input into the professional knowledge map for search, according to the relationship between a single entity and a monomer entity defined in phrase pair X or phrase pair Y, multiple corresponding knowledge data will be found. For example, according to "release" and "foldable phone", "Samsung (single entity) releases (relationship between single entities) foldable phone ( Single entity)", "Xiaomi (single entity) released (relationship between single entities) folding phone (single entity)" and "Apple (single entity) released (relationship between single entities) folding phone (single entity)" and other matching knowledge data. Since "Samsung", "Xiaomi" and "Apple" are single entities related to "folding phone", "Samsung", "Xiaomi" and "Apple" are used as replacement phrases, that is, multiple replacement phrases are obtained; finally, each replacement phrase is used to replace the ambiguous terminology in the translated sentence, and multiple replacement sentences are obtained, for example: "Samsung has released a new folding phone", "Xiaomi has released a new folding phone" and "Apple has released a new folding phone".

[0092] S104: after back-translating each replacement short sentence, calculating the similarity between each back-translated replacement short sentence and the corresponding original short sentence, and obtaining a revised translation of the corresponding original short sentence according to the similarity;

[0093] It should be noted that the similarity between each back-translated replacement sentence and the corresponding original sentence is calculated using an existing similarity algorithm, including but not limited to a cosine similarity algorithm and an Euclidean distance algorithm;

[0094] It should be understood that back-translating each replacement sentence means translating the replacement sentence in reverse order to make the replacement sentence have the same language as the original sentence;

[0095] For example, according to the above example, the original sentence is in English "Apple has released a new foldable phone", while the replacement sentences include Chinese "Samsung has released a new foldable phone", "Xiaomi has released a new foldable phone" and "Apple has released a new foldable phone", etc. Therefore, if the Chinese version of "Samsung has released a new foldable phone" is translated back into English, the replacement sentence with the same language as the original sentence is obtained.

[0096] In implementation, the step of obtaining a corrected translation of the original short sentence according to the similarity includes:

[0097] Retrieving the similarity between each back-translated replacement sentence and the corresponding original sentence to obtain multiple similarities;

[0098] Filtering out similarities greater than a preset similarity threshold from multiple similarities, taking the similarities greater than the preset similarity threshold as credible similarities, and obtaining multiple credible similarities;

[0099] It is understandable that: after calculating the similarity between each back-translated replacement sentence and the corresponding original sentence, although multiple similarities are obtained, if the corresponding (before back-translation) replacement sentences in multiple back-translated replacement sentences are not correct translations, then if the similarity is directly sorted and screened, the corrected translation will be incorrect. Therefore, screening by similarity can avoid the occurrence of incorrect corrected translations.

[0100] Sort the multiple credible similarities in descending order, and use the replacement short sentence before back-translation corresponding to the first credible similarity as the revised translation of the corresponding original short sentence;

[0101] For example, continuing with the above example, after the replacement sentences in Chinese form "Samsung has released a new foldable phone", "Xiaomi has released a new foldable phone" and "Apple has released a new foldable phone" are back-translated into English form, three replacement sentences in English form are obtained, among which the similarity of the English form of "Apple has released a new foldable phone" is greater than the preset similarity threshold, and its ranking is ranked first, which means that the replacement sentence before back translation, that is, the Chinese form of "Apple has released a new foldable phone" is the correct revised translation of the original sentence ("Apple has released a new foldable phone").

[0102] S105: repeat the above steps until a revised translation of each original short sentence is obtained, and merge the revised translation of each original short sentence into a second translation text;

[0103] It can be understood that: by processing each translated sentence according to the above processing logic, it is possible to determine whether there is translation ambiguity in each translated sentence, and to obtain the ambiguous terms in each translated sentence. Further, by correcting each translated sentence according to the ambiguous terms, a corrected translation of each original sentence can be obtained. The corrected translations of each original sentence are integrated, thus realizing the translation correction of the first translated text, so that the obtained second translated text is an accurate translation of the information actively input by the user.

[0104] By integrating the pre-trained large language model and knowledge graph, the present invention can effectively identify and correct translation errors of professional terms, especially in the scenarios of short text corpus and professional field terminology, significantly improving the accuracy of translation.

[0105] Example 2

[0106] See also Figure 2 As shown, based on the same inventive concept, this embodiment discloses an intelligent machine translation device based on a pre-trained large language model. For details not provided in this embodiment, please refer to the relevant part of the above embodiment 1. The device includes:

[0107] The model translation module 201 is used to translate the short text corpus using the pre-trained large language model to obtain a first translation text containing at least one translated short sentence, and extract a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object;

[0108] The translation detection module 202 is used to fuse the subject and object in the translation short sentence into a combination entity to be tested, input it into a preset professional knowledge map for traversal, obtain the co-occurrence frequency value of the combination entity to be tested according to the traversal result, and determine whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value;

[0109] A search and replacement module 203 is used for, when there is translation ambiguity, taking the subject and the object in the corresponding translation sentence as ambiguous terms, searching for multiple replacement phrases based on the phrase set in the corresponding translation sentence, and replacing the ambiguous terms in the translation sentence according to the replacement phrases to obtain multiple replacement sentences;

[0110] The back-translation determination module 204 is used to calculate the similarity between each back-translated replacement sentence and the corresponding original sentence after back-translation of each replacement sentence, and obtain the corrected translation of the corresponding original sentence according to the similarity;

[0111] The translation correction module 205 is used to repeat the above steps until a corrected translation of each original short sentence is obtained, and the corrected translation of each original short sentence is merged into a second translation text.

[0112] Example 3

[0113] See also Figure 3 As shown, this embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the intelligent machine translation method based on a pre-trained large language model provided by any of the above methods.

[0114] Since the electronic device introduced in the content of this embodiment is an electronic device used to implement an intelligent machine translation method based on a pre-trained large language model in the embodiment of the present application, based on the intelligent machine translation method based on a pre-trained large language model introduced in the embodiment of the present application, the technical personnel of the field can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the technical personnel of the field implement the electronic device used in the intelligent machine translation method based on a pre-trained large language model in the embodiment of the present application, it belongs to the scope of protection of this application.

[0115] Example 4

[0116] This embodiment discloses a computer-readable storage medium, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the intelligent machine translation method based on a pre-trained large language model provided by any of the above methods.

[0117] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0118] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

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

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

[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0123] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0124] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent machine translation method based on a pre-trained large language model, characterized in that: The method comprises: Translating a short text corpus using a pre-trained large language model to obtain a first translated text containing at least one translated short sentence, and extracting a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object; After the subject and object in the translation short sentence are merged into the combination entity to be tested, they are input into the preset professional knowledge map for traversal, and the co-occurrence frequency value of the combination entity to be tested is obtained according to the traversal result, and it is judged whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value; When there is translation ambiguity, the subject and the object in the corresponding translation sentence are used as ambiguous terms, and multiple replacement phrases are searched out based on the phrase set in the corresponding translation sentence, and the ambiguous terms in the translation sentence are replaced according to the replacement phrases to obtain multiple replacement sentences; After back-translating each replacement short sentence, the similarity between each back-translated replacement short sentence and the corresponding original short sentence is calculated, and the revised translation of the corresponding original short sentence is obtained according to the similarity; Repeat the above steps until the revised translation of each original short sentence is obtained, and merge the revised translation of each original short sentence into the second translation text.

2. The intelligent machine translation method based on a pre-trained large language model according to claim 1, characterized in that: The generation logic of the preset professional knowledge graph is as follows: Extracting the subject-predicate-object structure of each sentence from a parallel corpus in a professional field to obtain knowledge data, wherein the knowledge data includes a subject, a predicate and an object; The relationship between the subject and object in each sentence as a single entity, and the predicate in each sentence as a single entity; Based on the relationship between single entities, a triple containing <single entity, relationship, single entity> is constructed, and the single entity in the triple is used as the initial node of the graph, and the relationship between the single entities is used as the initial edge between the nodes in the graph to form an initial knowledge graph; The subject and object in each sentence are fused as a composite entity, and the co-occurrence frequency value of the composite entity is obtained, and the co-occurrence frequency value is used as the attribute value of the composite entity; According to the predefined relationship between a single entity and a composite entity and the attribute rules of the composite entity, a new triple containing <single entity, relationship, composite entity> and <composite entity, attribute, attribute value> is constructed; The combined entity in the new triple is used as a new node, and the relationship between the single entity and the combined entity in the new triple is used as a new edge; The initial knowledge graph is expanded according to the newly added nodes and edges, and the attributes of the combined entities are supplemented according to the attribute values ​​in the new triples to form a professional knowledge graph.

3. The intelligent machine translation method based on a pre-trained large language model according to claim 2, characterized in that: The step of obtaining the co-occurrence frequency value of the combined entity to be tested according to the traversal result includes: Extract traversal results; If the traversal result returns a composite entity in the professional knowledge graph, the attributes of the corresponding composite entity are obtained, and the corresponding attribute values ​​are retrieved according to the attributes of the corresponding composite entity to obtain the co-occurrence frequency value of the composite entity to be tested; If the traversal result returns an empty set, the co-occurrence frequency value of the combined entity to be tested is output as zero.

4. The intelligent machine translation method based on a pre-trained large language model according to claim 3, characterized in that: The determining whether there is translation ambiguity in the corresponding translated sentence includes: Obtaining a co-occurrence frequency value of the combined entity to be tested, and comparing the co-occurrence frequency value with a preset co-occurrence frequency threshold; If the co-occurrence frequency value is greater than the co-occurrence frequency threshold, it is determined that the corresponding translation phrase to which the tested combined entity belongs does not have translation ambiguity; If the co-occurrence frequency value is less than or equal to the co-occurrence frequency threshold, it is determined that the corresponding translation phrase to which the tested combined entity belongs has translation ambiguity.

5. The intelligent machine translation method based on a pre-trained large language model according to claim 4, characterized in that: The step of searching for multiple replacement phrases based on the phrase set in the corresponding translated short sentence includes: Extracting the subject and predicate in the corresponding translated sentence; or extracting the predicate and object in the corresponding translated sentence; Treat the subject and predicate as one phrase pair X, or treat the predicate and object as another phrase pair Y; Input phrase pair X or phrase pair Y into the professional knowledge graph for retrieval, and obtain knowledge data matching phrase pair X or phrase pair Y, wherein the knowledge data includes a single entity identical to the subject, a relationship between single entities matching the predicate, and multiple single entities related to the subject; or includes a single entity identical to the object, a relationship between single entities matching the predicate, and multiple single entities related to the object; Each single entity related to the subject is used as a replacement phrase, or each single entity related to the subject is used as a replacement phrase to obtain multiple replacement phrases.

6. The intelligent machine translation method based on a pre-trained large language model according to claim 5, characterized in that: The step of obtaining a corrected translation of the original short sentence according to the similarity includes: Retrieving the similarity between each back-translated replacement sentence and the corresponding original sentence to obtain multiple similarities; Filtering out similarities greater than a preset similarity threshold from multiple similarities, taking the similarities greater than the preset similarity threshold as credible similarities, and obtaining multiple credible similarities; The multiple credible similarities are sorted from large to small according to the numerical values, and the replacement short sentence before back-translation corresponding to the first credible similarity ranking is used as the revised translation of the corresponding original short sentence.

7. An intelligent machine translation device based on a pre-trained large language model, characterized in that: include: A model translation module is used to translate a short text corpus using a pre-trained large language model to obtain a first translation text containing at least one translated short sentence, and extract a phrase set from each translated short sentence; the short text corpus contains at least one original short sentence, and the phrase set contains a subject, a predicate, and an object; The translation detection module is used to fuse the subject and object in the translation short sentence into a combination entity to be tested, input it into a preset professional knowledge map for traversal, obtain the co-occurrence frequency value of the combination entity to be tested according to the traversal result, and judge whether the corresponding translation short sentence has translation ambiguity according to the co-occurrence frequency value; A search and replace module is used for, when there is translation ambiguity, taking the subject and the object in the corresponding translation sentence as ambiguous terms, searching for multiple replacement phrases based on the phrase set in the corresponding translation sentence, and replacing the ambiguous terms in the translation sentence according to the replacement phrases to obtain multiple replacement sentences; A back-translation discrimination module is used to calculate the similarity between each back-translated replacement sentence and the corresponding original sentence after back-translation of each replacement sentence, and obtain a revised translation of the corresponding original sentence according to the similarity; The translation correction module is used to repeat the above steps until a corrected translation of each original short sentence is obtained, and the corrected translation of each original short sentence is merged into a second translation text.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the intelligent machine translation method based on the pre-trained large language model described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the intelligent machine translation method based on the pre-trained large language model according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Translation semantic correction method and system based on large language model

    CN120258014A