Text translation method, device and system, electronic equipment and storage medium
By introducing knowledge bases and terminology databases into the large language model, professional background knowledge and terminology information are obtained to assist the translation process, solving the problem of time-consuming fine-tuning of the large language model and achieving efficient and accurate translation.
Patent Information
- Application Number
- CN202411392007.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-04-07
AI Technical Summary
Large language models need to be fine-tuned for translation tasks in different professional fields, which is time-consuming and consumes a lot of computing resources, thus reducing translation efficiency.
By pre-setting up knowledge bases and terminology databases, the target professional background knowledge information and terminology translation information of the text to be translated are obtained to assist the large language model in translation and avoid fine-tuning.
It improved translation accuracy and efficiency while saving computing resources.
Smart Images

Figure CN121809493A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to text translation methods, apparatus, systems, electronic devices, and storage media. Background Technology
[0002] With the development of computer technology, interdisciplinary communication and cooperation are becoming increasingly frequent, and language translation is playing an increasingly important role. While traditional machine translation technology has made significant progress in processing large-scale text data, it is often limited by its static model knowledge and the inability to update information sources in real time. Large language models (LLMs), deep learning models trained on massive amounts of text data to acquire broad general knowledge, are capable of deeply understanding the meaning of text and can be used to handle complex language understanding tasks.
[0003] While large language models contain enough knowledge to meet the basic requirements of text translation tasks, their translation performance may be limited by a lack of knowledge in specific professional domains, resulting in poor performance when performing translation tasks in professional domains outside of the training data.
[0004] In related technologies, to improve the translation accuracy of large language models, it is usually necessary to fine-tune the large language model by adding training data from different professional fields for translation tasks in different professional fields, so that it can adapt to different professional fields. However, this approach requires a large amount of professional field-customized labeled data, which is time-consuming and costly. The fine-tuning process is also time-consuming and consumes a lot of computing resources, thereby reducing translation efficiency. Summary of the Invention
[0005] To address the problem that fine-tuning large language models for translation tasks across different professional fields is time-consuming and consumes a large amount of computational resources, thus reducing translation efficiency, embodiments of this application provide a text translation method, apparatus, system, electronic device, and storage medium.
[0006] In a first aspect, embodiments of this application provide a text translation method, including:
[0007] A computing device acquires the text to be translated and the target translation language; determines the target professional field based on at least one keyword in the text to be translated, and acquires target professional background knowledge information of the target professional field from a knowledge base, the knowledge base storing the professional background knowledge information of the target professional field; identifies at least one term contained in the text to be translated based on a terminology database, and determines the translation information of the at least one term based on the terminology database and the target translation language, the terminology database storing terms of different languages of the target professional field; and translates the text to be translated into the translated text of the target translation language based on the target professional background knowledge information, the translation information of the at least one term, and a large language model, the large language model being used to translate the text to be translated according to the target translation language.
[0008] This method involves pre-setting a knowledge base and a terminology database. The knowledge base stores professional background knowledge information from different professional fields, while the terminology database stores professional terms from different languages within those fields. The computing device can retrieve relevant target professional background knowledge information for the target professional field corresponding to the text to be translated from the knowledge base, and standard translation information for the target translation language of the terms contained in the text to be translated from the terminology database. By using the retrieved target professional background knowledge information and the standard translation information for the target translation language of the terms contained in the text to be translated, the pre-trained large language model can be assisted in translating the text to be translated without the need for fine-tuning the large language model. Thus, translation accuracy and efficiency are improved while saving computational resources.
[0009] In one possible implementation, obtaining target professional background knowledge information of the target professional field from a knowledge base specifically includes: in the text to be translated, determining the text sub-segment to which each of the at least one keyword belongs; and based on the text sub-segment to which each of the at least one keyword belongs, obtaining the target professional background knowledge information of the target professional field stored in the knowledge base.
[0010] Through this implementation, the computing device can retrieve target professional background knowledge information corresponding to the target professional field of the text to be translated from an external knowledge base based on the text segment to which each keyword in the text to be translated belongs, as auxiliary translation information for the large language model.
[0011] In one possible implementation, the professional background knowledge information of the target professional field includes multiple professional background knowledge fragments; based on the text sub-fragment to which each keyword belongs in the at least one keyword, the target professional background knowledge information is obtained from the professional background knowledge information of the target professional field stored in the knowledge base, specifically including: performing the following steps on the text sub-fragment to which each keyword belongs: determining the similarity between the text sub-fragment to which the first keyword belongs and each professional background knowledge fragment in the multiple professional background knowledge fragments; wherein, the first keyword is any keyword in the at least one keyword; if there is a first professional background knowledge fragment in the multiple professional background knowledge fragments whose similarity to the text sub-fragment to which the first keyword belongs is greater than a first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed; the selected target professional background knowledge fragment is taken as the target professional background knowledge information.
[0012] In this implementation, the computing device uses retrieval-enhanced generation technology to obtain the target professional background knowledge fragments from the knowledge base that are closest to the text sub-fragments of the keywords in the text to be translated. It then filters out the relevant target professional background knowledge information that is closest to the text to be translated. Thus, retrieval-enhanced generation is combined with a large language model, relying not only on the translation capabilities of the large language model itself, but also on external knowledge sources to enhance the quality of generation.
[0013] In one possible implementation, identifying at least one term contained in the text to be translated based on a terminology database specifically includes: identifying multiple entity words in the text to be translated; and using at least one entity word contained in the terminology database as the at least one term in the text to be translated.
[0014] In this implementation, the computing device can identify terms contained in the text to be translated by matching entity words contained in the text to be translated with entity words in the database.
[0015] In one possible implementation, the terminology database stores terms with different semantics in different languages of the target professional field; based on the terminology database and the target translation language, the translation information of the at least one term is determined, specifically including: performing the following steps for each of the at least one term: determining the target semantics of a first term based on the target professional background knowledge information; determining the translation information of the target semantics of the first term in the target translation language from the terminology database; wherein, the first term is any one of the at least one terms.
[0016] In this implementation, the terminology database pre-stores terms with different semantics in different languages of the target professional field. Since a term may contain multiple semantics, the corresponding translation information for the target translation language is also multiple. The computing device, combined with the background knowledge information of the target professional field, can determine the more accurate target semantics of each term contained in the text to be translated. The translation information for the target translation language of each term obtained from the terminology database based on the target semantics is even more accurate.
[0017] In one possible implementation, based on the target professional background knowledge information, the translation information of the at least one term, and a large language model, the text to be translated is translated into the target target language. Specifically, this includes: for each of the at least one sentence to be translated in the text to be translated, performing the following steps to determine at least one auxiliary historical translation sentence sample: determining the similarity between the first sentence to be translated and each of the multiple historical translation sentence samples in the translation library; the multiple historical translation sentence samples are in the same language as the text to be translated; if there is a first historical translation sentence sample among the multiple historical translation sentence samples whose similarity to the first sentence to be translated is greater than a second preset threshold... In this case, the first historical translation sentence sample is used as the auxiliary historical translation sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed; wherein, the first sentence to be translated is any one of the at least one sentence to be translated; according to the target translation language, the translation information of the at least one auxiliary historical translation sentence sample is determined from the translation library; then, the text to be translated, the target translation language, the target professional background knowledge information, the translation information of the at least one term, the at least one auxiliary historical translation sentence sample and the translation information of the at least one auxiliary historical translation sentence sample are input into the large language model to obtain the translated text of the target translation language.
[0018] In this implementation, the translation library stores historical translation sample statements in different languages. The computing device can also obtain historical translation sample statements with high similarity to the statements to be translated in the text from the translation library as auxiliary historical translation sample statements. The target professional background knowledge information, the translation information of the target translation language of the terms contained in the text to be translated, and the obtained auxiliary historical translation sample statements and the translation information of the target translation language of the auxiliary historical translation sample statements are used to assist the large language model in translating the text to be translated. With the help of the above-mentioned auxiliary translation information, the large language model learns the text characteristics in the auxiliary translation information and translates the text to be translated, which can improve the accuracy of the translation.
[0019] In one possible implementation, the translation library further includes feature vectors of the plurality of historical translated sentence samples; determining the similarity between the first sentence to be translated and the plurality of historical translated sentence samples in the translation library specifically includes: obtaining the feature vector of the first sentence to be translated; calculating the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample; and using the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample as the similarity between the first sentence to be translated and each historical translated sentence.
[0020] In this implementation, the computing device can calculate the similarity between the feature vector of the sentence to be translated and the feature vector of the historical translated sentence samples, and use the similarity between the feature vector of the sentence to be translated and the feature vector of the historical translated sentence samples as the similarity between the sentence to be translated and the historical translated sentences.
[0021] In one possible implementation, the method further includes: performing grammatical correction on the translated text based on preset grammatical rules.
[0022] In this implementation, the computing device can also perform grammatical correction on the translated text based on preset grammatical rules, further improving the fluency and accuracy of the translated text.
[0023] Secondly, embodiments of this application provide a text translation device, including:
[0024] The acquisition module is used to acquire the text to be translated and the target language.
[0025] The domain knowledge identification module is used to determine the target professional domain based on at least one keyword in the text to be translated, and to obtain the target professional background knowledge information of the target professional domain from the knowledge base, wherein the knowledge base stores the professional background knowledge information of the target professional domain.
[0026] The terminology recognition module is used to identify at least one term contained in the text to be translated based on a terminology database, and to determine the translation information of the at least one term based on the terminology database and the target translation language. The terminology database stores terms from different languages in the target professional field.
[0027] The translation module is used to translate the text to be translated into the target language based on the target professional background knowledge information, the translation information of at least one term, and a large language model. The large language model is used to translate the text to be translated according to the target language.
[0028] In one possible implementation, the domain knowledge identification module is specifically used to determine the text sub-fragment to which each of the at least one keyword belongs in the text to be translated; and to obtain the target professional background knowledge information from the professional background knowledge information of the target professional field stored in the knowledge base based on the text sub-fragment to which each of the at least one keyword belongs.
[0029] In one possible implementation, the professional background knowledge information of the target professional field includes multiple professional background knowledge fragments;
[0030] The domain knowledge recognition module is specifically used to perform the following steps on the text sub-fragment to which each keyword belongs: determining the similarity between the text sub-fragment to which the first keyword belongs and each of the plurality of professional background knowledge fragments; wherein, the first keyword is any keyword among the at least one keyword; if there is a first professional background knowledge fragment among the plurality of professional background knowledge fragments whose similarity to the text sub-fragment to which the first keyword belongs is greater than a first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed; and the selected target professional background knowledge fragment is taken as the target professional background knowledge information.
[0031] In one possible implementation, the terminology recognition module is specifically used to identify multiple entity words in the text to be translated; and to use at least one entity word contained in the terminology database as the at least one term in the text to be translated.
[0032] In one possible implementation, the terminology database stores terms with different semantics in different languages for the target professional field;
[0033] The terminology recognition module is specifically used to perform the following steps for each of the at least one terminology: determining the target semantics of the first term based on the target professional background knowledge information; determining the translation information of the target semantics of the first terminology in the target translation language from the terminology database; wherein, the first terminology is any one of the at least one terminology.
[0034] In one possible implementation, the translation module is specifically configured to perform the following steps for each of at least one sentence to be translated in the text to be translated: determining at least one auxiliary historical translation sentence sample; determining the similarity between the first sentence to be translated and each of a plurality of historical translation sentence samples in the translation library; the plurality of historical translation sentence samples are in the same language as the text to be translated; if there is a first historical translation sentence sample among the plurality of historical translation sentence samples whose similarity to the first sentence to be translated is greater than a second preset threshold, then the first historical translation sentence sample is used as the auxiliary historical translation sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed; wherein, the first sentence to be translated is any one of the at least one sentence to be translated; determining the translation information of the at least one auxiliary historical translation sentence sample from the translation library according to the target translation language; inputting the text to be translated, the target translation language, the target professional background knowledge information, the translation information of the at least one term, the at least one auxiliary historical translation sentence sample, and the translation information of the at least one auxiliary historical translation sentence sample into the large language model to obtain the translated text in the target translation language.
[0035] In one possible implementation, the translation library also includes feature vectors of the plurality of historical translated sentence samples;
[0036] The translation module is specifically used to obtain the feature vector of the first statement to be translated; calculate the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample; and use the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample as the similarity between the first statement to be translated and each historical translated statement.
[0037] In one possible implementation, the device further includes:
[0038] The correction module is used to perform grammatical correction on the translated text based on preset grammatical rules.
[0039] Thirdly, embodiments of this application provide a text translation system, including:
[0040] A domain expert intelligent agent is used to acquire the text to be translated and the target translation language; determine the target professional domain based on at least one keyword in the text to be translated; and acquire the target professional background knowledge information of the target professional domain from a knowledge base, wherein the knowledge base stores the professional background knowledge information of the target professional domain.
[0041] A terminology expert agent is used to identify at least one term contained in the text to be translated based on a terminology database, and to determine the translation information of the at least one term based on the terminology database and the target translation language. The terminology database stores terms from different languages in the target professional field.
[0042] The translator agent is used to translate the text to be translated into the target language based on the target professional background knowledge information, the translation information of at least one term, and a large language model.
[0043] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the text translation method described in this application.
[0044] Fifthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the text translation method described in this application.
[0045] The technical effects that can be achieved by any of the second to fifth aspects mentioned above can be described with reference to the technical effects that can be achieved by any possible design in the first aspect mentioned above. The repetition will not be discussed.
[0046] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0047] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0048] Figure 1 This is a schematic diagram illustrating an application scenario of the text translation method provided in the embodiments of this application;
[0049] Figure 2 A schematic diagram illustrating another application scenario of the text translation method provided in this application embodiment;
[0050] Figure 3 A schematic diagram illustrating the implementation process of the text translation method provided in this application embodiment;
[0051] Figure 4A schematic diagram illustrating the implementation process for obtaining target professional background knowledge information from a knowledge base in a target professional field, as provided in this application embodiment;
[0052] Figure 5 This is a schematic diagram illustrating the specific implementation process of obtaining target professional background knowledge information from professional background knowledge information of the target professional field stored in the knowledge base, based on the text sub-fragments to which each keyword belongs in at least one keyword, as provided in the embodiments of this application.
[0053] Figure 6 A schematic diagram illustrating the implementation process for identifying at least one term contained in the text to be translated, provided as an embodiment of this application;
[0054] Figure 7 A schematic diagram illustrating the implementation process for determining translation information for at least one term, as provided in this application embodiment;
[0055] Figure 8 This is a schematic diagram illustrating the implementation process of translating a text to be translated into a target language, as provided in an embodiment of this application.
[0056] Figure 9 A schematic diagram illustrating the implementation process for determining at least one auxiliary historical translation sentence sample and the translation information of the target language of at least one auxiliary historical translation sentence sample, as provided in the embodiments of this application;
[0057] Figure 10 A schematic diagram illustrating the implementation process for determining the similarity between a first sentence to be translated and multiple historical translated sentence samples in a translation library, provided for an embodiment of this application;
[0058] Figure 11 A schematic diagram of the structure of the text translation device provided in the embodiments of this application;
[0059] Figure 12 A schematic diagram of the structure of the text translation system provided in the embodiments of this application;
[0060] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0061] This application provides a text translation method, apparatus, system, electronic device, and storage medium. A computing device acquires a text to be translated and a target translation language. Based on at least one keyword in the text to be translated, a target professional field is determined. Background knowledge information of the target professional field is obtained from a knowledge base, which stores such background knowledge information. Based on a terminology database, at least one term contained in the text to be translated is identified. Based on the terminology database and the target translation language, translation information for the at least one term is determined. The terminology database stores terms from different languages within the target professional field. Based on the target professional background knowledge information, the translation information of the at least one term, and a large language model, the text to be translated is translated into a text in the target translation language. The large language model is used to translate the text to be translated according to the target translation language. In this application, a knowledge base and a terminology base are pre-set. The knowledge base stores professional background knowledge information from different professional fields, and the terminology base stores professional terms from different languages in different professional fields. The computing device can obtain relevant target professional background knowledge information of the target professional field corresponding to the text to be translated from the knowledge base, and can obtain standard translation information of the target translation language of the terms contained in the text to be translated from the terminology base. By obtaining the target professional background knowledge information and the standard translation information of the target translation language corresponding to the terms contained in the text to be translated, the pre-trained large language model is assisted in translating the text to be translated without the need for fine-tuning the large language model. Thus, the translation accuracy and efficiency are improved while saving computing resources.
[0062] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0063] In the embodiments of this application, descriptions such as "when," "under the circumstances," "if," and "if" all refer to the electronic device making corresponding processing under certain objective circumstances. They are not time limits, nor do they require the electronic device to make a judgment action when implementing it, nor do they imply any other limitations.
[0064] Furthermore, it should be understood that in the description of this application, terms such as "first" and "second" are used only to distinguish the objects being described, and should not be construed as indicating or implying the relative importance of the objects being described, nor as indicating or implying an order. For example, "first preset threshold" and "second preset threshold" are used to distinguish different preset thresholds, rather than describing a specific order or importance of the preset thresholds.
[0065] In this summary of embodiments, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. The use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0066] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0067] In this document, it is important to understand that the technical terms used in this application refer to:
[0068] An intelligent agent is generally considered to be an agent capable of autonomously achieving predetermined goals. It can take the form of software, hardware, or other entities. Its goal is to recognize and simulate intelligent human behavior, such as learning, reasoning, decision-making, and execution capabilities. An intelligent agent can be viewed as a computational entity that can continuously and autonomously function and interact with its environment.
[0069] A multi-agent system (MAS) is a computing system consisting of multiple agents interacting in an environment.
[0070] Retrieval-Augmented Generation (RAG) is a natural language processing architecture that combines search retrieval and generation capabilities. RAG models can retrieve relevant information from authoritative, pre-defined knowledge sources to enhance the accuracy and reliability of generative AI (Artificial Intelligence) models. This approach allows developers to provide generative models with up-to-date research, statistics, or news information, enabling large language models (LLMs) to directly connect to real-time social information. In this application, RAG is combined with a large language model. In the process of generating translated text using the large language model, it not only relies on the capabilities of the large language model itself but also incorporates external knowledge sources to enhance the quality of the generated text.
[0071] First refer to Figure 1 This is a schematic diagram illustrating an application scenario of the text translation method provided in the embodiments of this application, such as... Figure 1 The text translation system shown may include a computing device 101 and a cloud server 102. The cloud server 102 is equipped with a knowledge base 103, a terminology database 104, and a translation database 105. The knowledge base 103 stores professional background knowledge information from different professional fields; the terminology database 104 stores professional terminology information from different languages within different professional fields; and the translation database 105 stores historical translated sentence samples in different languages. The computing device 101 and the cloud server 102 are connected via a network. For example, this network may include, but is not limited to, mobile communication networks, local area networks, wide area networks, and the Internet of Things (IoT).
[0072] In this embodiment, the computing device 101 can translate texts from different vertical professional fields, such as medical, legal, and scientific texts. The computing device 101 includes a pre-trained large language model. After acquiring the text to be translated and the target language, the computing device 101 determines the target professional field based on at least one keyword in the text, retrieves target professional background knowledge information from the knowledge base 103, identifies at least one term in the text based on the terminology database 104, and determines the translation information of at least one term based on the terminology database and the target language. The translation information is the translation information of the target language for the terminology. Then, based on the translation library 105, auxiliary historical translation sample sentences corresponding to the sentence to be translated are obtained, along with the translation information of the target language for these auxiliary historical translation sample sentences. The obtained target professional background knowledge information, terminology translation information, auxiliary historical translation sample sentences, and their target language translation information are used as auxiliary translation information for the large language model to translate the text, resulting in a translated text. This eliminates the need for fine-tuning the large language model, thereby improving translation accuracy and efficiency while saving computational resources. To further improve the fluency and accuracy of the translated text, the computing device 101 can also calibrate the translated text based on preset grammatical rules to correct grammatical errors.
[0073] In this embodiment of the application, the computing device 101 can also be replaced by any other device with computing capabilities, such as a computer or a server. The server can be an independent physical server or a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, and cloud storage. This embodiment of the application does not limit this.
[0074] In another implementation, multiple intelligent agents can be embedded in the computing device 101, and the text translation method of this application can be implemented through the cooperation of multiple intelligent agents. For example... Figure 2 In the text translation system shown, multiple intelligent agents can be embedded in the computing device 101 to generate a multi-agent system: domain expert agent 101-1, terminology expert agent 101-2, translator agent 101-3, and proofreader agent 101-4. Domain expert agent 101-1 and terminology expert agent 101-2 are connected via a network, terminology expert agent 101-2 and translator agent 101-3 are connected via a network, and translator agent 101-3 and proofreader agent 101-4 are connected via a network.
[0075] Domain expert agent 101-1 is connected to knowledge base 103 via a network, terminology expert agent 101-2 is connected to terminology base 104 via a network, and translator agent 101-3 is connected to translation base 105 via a network.
[0076] based on Figure 2 The application scenarios shown below will be explained with reference to the appendix. Figures 3-10 The exemplary embodiments of this application are described in more detail below. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the implementation methods of this application are not limited in any way. On the contrary, the implementation methods of this application can be applied to any applicable scenario.
[0077] like Figure 3 The diagram shown illustrates the implementation flow of the text translation method provided in this application embodiment. This text translation method may include the following steps:
[0078] S21. Obtain the text to be translated and the target language.
[0079] In practice, the text to be translated can be in any language, such as Chinese, English, Spanish, Korean, Russian, etc., and this application does not limit this. The text to be translated can be from any professional field, such as medicine, law, science, etc.
[0080] The text to be translated can be input by the user into the domain expert agent 101-1, or it can be sent to the domain expert agent 101-1 from other devices, such as through a user terminal device, or it can be text obtained by the domain expert agent 101-1 through other means. The target language for translation can be input by the user into the domain expert agent 101-1.
[0081] S22. Determine the target professional field based on at least one keyword in the text to be translated, and obtain the target professional background knowledge information of the target professional field from the knowledge base, which stores the professional background knowledge information of the target professional field.
[0082] In practice, the domain expert agent 101-1 performs global management of knowledge in different professional fields, including but not limited to: maintaining professional background knowledge information such as industry standards and the latest research trends in different professional fields. By continuously monitoring information sources in different professional fields, such as professional papers, literature, news, and the latest research results in different professional fields, the knowledge base 103 is automatically updated to ensure that the domain expert agent 101-1 can access the most cutting-edge professional background knowledge information in different professional fields. The domain expert intelligent agent 101-1, based on natural language processing and information extraction technology, can extract keywords and summary information from professional background knowledge information in different professional fields. It stores the professional background knowledge information corresponding to the keywords and summary information in different professional fields in a knowledge base 103. To ensure structured storage of professional background knowledge and facilitate rapid retrieval, it can also store word vectors of keywords in different professional fields, text vectors corresponding to summary information, and professional background knowledge fragment vectors in the knowledge base 103. When storing professional background knowledge information and its corresponding text vectors, the professional background knowledge information can first be segmented. Multiple segmented professional background knowledge fragments and their corresponding vectors are then stored accordingly. The professional background knowledge fragment vector is the vector representation of a professional background knowledge fragment. When segmenting professional background knowledge information, it can be segmented according to complete sentences, multiple sentences, or complete paragraphs; this embodiment does not limit this. Thus, the domain expert agent 101-1 can use retrieval enhancement generation technology to retrieve relevant target professional background knowledge information from the knowledge base based on at least one text sub-fragment of each keyword in the text to be translated.
[0083] In one implementation, to improve retrieval efficiency, the domain expert agent 101-1 can also maintain a corresponding knowledge base for different professional fields, storing the professional background knowledge information corresponding to each professional field in the knowledge base corresponding to each professional field.
[0084] In this embodiment of the application, when determining the word vector of a keyword, the keyword can be input into a word vector recognition model to obtain the word vector of the keyword. The word vector recognition model can be, but is not limited to, the ELMo model (Embedding from Language Model) or the GloVe (Global Vectors for word representation) model, and this embodiment of the application does not limit it.
[0085] When determining the vector of a professional background knowledge fragment, each sentence in the fragment can be input into the sentence vector recognition model in the order of arrangement to obtain the feature vector of each sentence (i.e., the sentence vector of each sentence). The feature vectors of each sentence are then concatenated first and last in the order of arrangement to obtain the vector of the professional background knowledge fragment. The sentence vector recognition model can use a pre-trained model, such as the BERT model, etc., and this embodiment of the application does not limit it.
[0086] In practice, after the domain expert agent 101-1 obtains the text to be translated and the target language, it extracts at least one keyword from the text using a keyword extraction model. The extracted keyword is then matched with keywords stored in the knowledge base 103, and the professional domain to which the matched keyword belongs is determined as the target professional domain of the text to be translated. The keyword extraction model can be pre-trained using a deep learning model on training sample texts, such as CNN (Convolutional Neural Networks) or RNN (Recurrent Neural Networks).
[0087] In one implementation, other keyword extraction algorithms can also be used to extract keywords from the text to be translated, such as TF-IDF (Term Frequency-Inverse Document Frequency) algorithm, TextRank algorithm, etc., but this application embodiment does not limit this.
[0088] In one implementation, the user can also input the target professional domain into the domain expert agent 101-1.
[0089] After extracting at least one keyword from the text to be translated, the domain expert agent 101-1 can proceed as follows: Figure 4 The process shown retrieves target professional background knowledge information from a knowledge base, and may include the following steps:
[0090] S31. In the text to be translated, identify the text sub-fragment to which each keyword belongs in at least one keyword.
[0091] In practice, the domain expert agent 101-1 uses retrieval enhancement generation technology to retrieve relevant target professional background knowledge information from the knowledge base based on the text sub-fragment to which at least one keyword in the text to be translated belongs.
[0092] In implementation, the domain expert agent 101-1 can take a complete sentence containing a keyword in the text to be translated as a text sub-segment to which the keyword belongs, or take a complete sentence containing a keyword and the surrounding sentences of the complete sentence as a text sub-segment to which the keyword belongs, or take a complete paragraph containing the keyword as a text sub-segment to which the keyword belongs. This application embodiment does not limit this, thereby obtaining a text sub-segment to which each keyword in at least one keyword in the text to be translated belongs.
[0093] S32. Based on the text sub-fragments to which each keyword belongs in at least one keyword, obtain the target professional background knowledge information from the professional background knowledge information of the target professional field stored in the knowledge base.
[0094] In specific implementation, it can be done according to the following: Figure 5 The process shown involves retrieving target professional background knowledge information from the professional background knowledge information stored in the knowledge base for each keyword within at least one keyword, based on the text fragments associated with that keyword. This includes the following steps:
[0095] Specifically, for each keyword's text sub-segment, steps S41 and S42 are performed to determine the target professional background knowledge segment:
[0096] S41. Determine the similarity between the text sub-fragment to which the first keyword belongs and each professional background knowledge fragment among multiple professional background knowledge fragments.
[0097] In specific implementation, the domain expert agent 101-1, for each text segment to which a keyword belongs in the text to be translated, inputs each sentence in the text segment to which the keyword belongs into the sentence vector recognition model to obtain the feature vector of each sentence in the text segment to which the keyword belongs. The feature vectors of each sentence are then concatenated in the order of arrangement to obtain the text segment vector corresponding to the text segment to which the keyword belongs. Thus, the text segment vector corresponding to the text segment to which each keyword belongs in at least one keyword in the text to be translated can be obtained.
[0098] After obtaining the text segment vector corresponding to each text segment belonging to at least one keyword in the text to be translated, the domain expert agent 101-1 determines the similarity between the text segment vector to which the first keyword belongs and the vector of each of the multiple professional background knowledge segments in the target professional domain. Here, the first keyword is any one of the at least one keywords. The multiple professional background knowledge segments are in the same language as the text to be translated.
[0099] In implementation, the similarity between the text sub-vector of the first keyword and each of the multiple professional background knowledge fragment vectors in the target professional field can be calculated by calculating the Hamming distance, Euclidean distance, or cosine similarity between them. Alternatively, any other method for calculating similarity can be used. This application does not limit the specific method used.
[0100] S42. If among multiple professional background knowledge fragments there is a first professional background knowledge fragment whose similarity to the text sub-fragment to which the first keyword belongs is greater than the first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed.
[0101] In specific implementation, if among multiple professional background knowledge fragment vectors there exists a first professional background knowledge fragment vector whose similarity to the text sub-fragment vector to which the first keyword belongs is greater than a first preset threshold, the domain expert agent 101-1 will take the first professional background knowledge fragment corresponding to the first professional background knowledge fragment vector as the target professional background knowledge fragment; otherwise, the next keyword will be processed. The first preset threshold can be set arbitrarily, for example, it can be set to 80%, but this embodiment does not limit this setting.
[0102] S43. Select the selected background knowledge fragments of the target major as background knowledge information of the target major.
[0103] In practice, the domain expert agent 101-1 uses the selected target professional background knowledge fragments as target professional background knowledge information.
[0104] In this embodiment, the retrieval-enhanced generation technology can retrieve the latest target professional background knowledge information related to the text to be translated from the constantly updated knowledge base. Combining search and generation capabilities, the retrieved target professional background knowledge information is used as one of the auxiliary translation information for the large language model to translate the text to be translated, which can improve the accuracy and timeliness of the translation.
[0105] Then, the domain expert agent 101-1 sends the text to be translated, the target translation language, the target professional field, and the target professional background knowledge information obtained in the target professional field to the terminology expert agent 101-2.
[0106] S23. Identify at least one term contained in the text to be translated based on the terminology database, and determine the translation information of at least one term based on the terminology database and the target translation language. The terminology database stores terms in different languages of the target professional field.
[0107] In practice, the terminology expert agent 101-2 identifies at least one term in the text to be translated based on the terminology database 104. Based on the target professional background knowledge, the terminology database 104, and the target translation language, it determines the translation information of at least one term. This translation information is the translation information of the term in the target translation language. The terminology database 104 stores professional terminology information in different languages from different professional fields, including professional terminology information in different languages from the target professional field.
[0108] The terminology expert agent 101-2 can continuously collect professional terms from different professional fields, and relevant professionals can translate these professional terms into standard professional terms in different languages. The terminology information from different professional fields and languages is categorized and stored in the terminology database 104 according to different professional fields, and the terminology information in the terminology database 104 is automatically updated to ensure the accuracy of professional terms in different professional fields and languages and to ensure access to the latest standard professional terminology information in the industry. Since the same professional term may have different semantics, a professional term in one language can correspond to translation information in multiple other languages with different semantics. Based on this, the terminology database 104 can store professional terminology information with different semantics in different languages from different professional fields, and can further store vector representations of professional terminology information with different semantics in different languages from different professional fields, that is, word vectors corresponding to each professional term. The terminology database 104 stores terms with different semantics in different languages from the target professional field.
[0109] When implementing, it can be done according to the following: Figure 6 The process shown identifies at least one term in the text to be translated based on a terminology database, and includes the following steps:
[0110] S51. Identify multiple entity words in the text to be translated.
[0111] In specific implementation, the terminology expert agent 101-2 can extract entities from the text to be translated using Named Entity Recognition (NER) to obtain multiple entity words in the text. It can also extract entities from the text to be translated using a pre-trained large language model. This embodiment of the application does not limit the specific implementation of this method. The large language model can understand and generate natural language text or understand the meaning of language text. The terminology expert agent 101-2 can be pre-trained using large-scale text data. The large language model can be, but is not limited to, ChatGPT (Chat Generative Pre-trained Transformer), GPT-3, GPT-4, or BLOOM models, etc. This embodiment of the application does not limit the specific implementation of this method. In this embodiment, the large language model can be trained using a large amount of natural language text data. By learning the language patterns, syntax, and semantics of the text data, the large language model can understand and generate natural language. The pre-trained large language model is also used for subsequent semantic recognition and text translation.
[0112] S52. Include at least one entity word in the terminology database as at least one term in the text to be translated.
[0113] In practice, the terminology expert agent 101-2 will identify at least one entity word contained in the terminology database as at least one term in the text to be translated.
[0114] In one implementation, the terminology expert agent 101-2 can also input each entity word from the multiple entity words extracted from the text to be translated into a word vector recognition model to obtain the word vector of each entity word.
[0115] For each entity word in a set of multiple entity words, perform the following processing:
[0116] The similarity between the word vector of the first entity word and the word vector of each professional term corresponding to the target professional field in the terminology database 104 is calculated. The first entity word can be any entity word among multiple entity words. The similarity can be calculated by Hamming distance, Euclidean distance, or cosine similarity between the word vector of the first entity word and the word vector of each professional term corresponding to the target professional field in the terminology database 104. This embodiment of the application does not limit this method. If the word vector of the first entity word has a similarity greater than a specified threshold among the word vectors of the multiple professional terms corresponding to the target professional field, then the first entity word can be determined as a term in the text to be translated. Otherwise, the next entity word is processed. The specified threshold can be set by the user, for example, it can be set to 90%.
[0117] After identifying at least one term in the text to be translated, the terminology expert agent 101-2 can retrieve translation information for each different semantic meaning of each term in the target language from the terminology database 104. For example, assuming the text to be translated is in English and the target language is Chinese, that is, translating the English text into Chinese, if a certain English term identified in the text has two corresponding Chinese terms with different meanings stored in the terminology database, then the two corresponding Chinese terms with different meanings are retrieved.
[0118] Furthermore, the terminology expert agent 101-2, for each term in at least one term in the text to be translated, can, according to... Figure 7 The process shown determines translation information for at least one term, and performs the following steps for each of the at least one term:
[0119] S61. Based on the target professional background knowledge information, determine the target semantics of the first term.
[0120] The first term is any one of at least one terms contained in the text to be translated.
[0121] In this step, the terminology expert agent 101-2 inputs the first term and the professional background knowledge information of the target professional field into the pre-trained large language model for the first term in the text to be translated. This allows the large language model to perform in-depth analysis of the first term in the text to be translated based on the semantics of the professional background knowledge information, thereby obtaining the target semantics of the first term.
[0122] S62. Determine the translation information of the target semantics of the target translation language of the first term from the terminology database.
[0123] In this step, after the terminology expert agent 101-2 determines the target semantics of the first term, it retrieves the translation information of the target semantics of the first term in the target translation language from the terminology database. Thus, it can obtain accurate translation information of the target translation language for each term in at least one term contained in the text to be translated, ensuring that the translated terminology is both professional and context-appropriate.
[0124] Then, the terminology expert agent 101-2 sends the text to be translated, the target translation language, the target professional field, the acquired target professional background knowledge information, and the translation information of the target translation language of at least one term contained in the text to be translated to the translator agent 101-3.
[0125] S24. Based on the target professional background knowledge information, translation information of at least one term, and a large language model, translate the text to be translated into the target language.
[0126] In specific implementation, translator agent 101-3 can follow the following... Figure 8 The process shown translates the text to be translated into the target language, including the following steps:
[0127] S71. Based on at least one sentence to be translated in the text to be translated and the translation library, determine at least one auxiliary historical translation sentence sample, and obtain the translation information of the target language of at least one auxiliary historical translation sentence sample.
[0128] In practice, the translation database stores historical translated sentence samples in multiple languages. The translation database also contains feature vectors of multiple historical translated sentence samples, that is, sentence vectors of multiple historical translated sentence samples.
[0129] Specifically, for each sentence to be translated in the text to be translated, at least one sentence to be translated, the translator agent 101-3 can perform the following actions: Figure 9 The process shown identifies at least one auxiliary historical translation sample and its target language translation information, specifically including the following steps:
[0130] S81. Determine the similarity between the first sentence to be translated and each historical translation sample in the translation database; the multiple historical translation samples are in the same language as the text to be translated.
[0131] The first statement to be translated is any one of at least one statements to be translated.
[0132] In specific implementation, translator agent 101-3 can follow the following... Figure 10 The process shown determines the similarity between the first sentence to be translated and multiple historical translated sentence samples in the translation library, specifically including the following steps:
[0133] S91. Obtain the feature vector of the first sentence to be translated.
[0134] In specific implementation, the translator agent 101-3 inputs at least one sentence to be translated from the text to be translated into the sentence vector recognition model to obtain the feature vector of at least one sentence in the text to be translated (that is, the sentence vector of at least one sentence). The feature vector of the first sentence to be translated is the feature vector of any one of the at least one sentences to be translated.
[0135] S92. Calculate the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample.
[0136] In specific implementation, the translator agent 101-3 calculates the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample in the target professional field. The similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample in the target professional field can be determined by calculating the Hamming distance, Euclidean distance or cosine similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample in the target professional field. Other arbitrary methods for calculating similarity can also be used to calculate the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence. This application embodiment does not limit this.
[0137] S93. The similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample is used as the similarity between the first sentence to be translated and each historical translated sentence.
[0138] In practice, the translator agent 101-3 uses the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample as the similarity between the first sentence to be translated and each historical translated sentence.
[0139] S82. If among multiple historical translation sentence samples there is a first historical translation sentence sample whose similarity to the first sentence to be translated is greater than the second preset threshold, then the first historical translation sentence sample is used as the auxiliary historical translation sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed.
[0140] In specific implementation, if among multiple historical translated sentence samples in the target professional field there is a first historical translated sentence sample whose similarity to the first sentence to be translated is greater than a second preset threshold, the translator agent 101-3 can use the first historical translated sentence sample as an auxiliary historical translated sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed. Thus, at least one auxiliary historical translated sentence sample can be obtained. The second preset threshold can be set arbitrarily, for example, it can be set to 80%, but this embodiment does not limit this setting.
[0141] S83. Based on the target language, determine the translation information of at least one auxiliary historical translation sentence sample from the translation database.
[0142] In practice, after obtaining at least one auxiliary historical translation sentence sample, the translator agent 101-3 retrieves the translation information of the target language of at least one auxiliary historical translation sentence sample from the translation library.
[0143] S72. Input the text to be translated, the target language, the target professional background knowledge information, the translation information of at least one term, at least one auxiliary historical translation sentence sample, and the translation information of the target language of at least one auxiliary historical translation sentence sample into the large language model to obtain the translated text in the target language.
[0144] In specific implementation, the translator agent 101-3 uses the target translation language, target professional background knowledge information, translation information of at least one term in the target translation language contained in the text to be translated, at least one auxiliary historical translation sentence sample, and translation information of the target translation language of at least one auxiliary historical translation sentence sample as auxiliary translation information. The auxiliary translation information is used to provide translation prompts to the large language model. The text to be translated and the auxiliary translation information are input into the large language model to obtain the translation text in the target translation language, that is, the initial translation text corresponding to the text to be translated. The large language model is used to translate the text to be translated according to the target translation language.
[0145] In specific implementation, the translator agent 101-3 can collectively label all the information input to the large language model, excluding the text to be translated, as "auxiliary translation information." This labeling can be done through textual descriptions. For example, when inputting the above information into the large language model, the agent can input "text to be translated," "auxiliary translation information includes: target language, target professional background knowledge information, translation information of at least one term in the text to be translated, at least one auxiliary historical translation sentence sample, and translation information of the target language of at least one auxiliary historical translation sentence sample," so that the large language model knows that "target language, target professional background knowledge information, translation information of at least one term in the text to be translated, at least one auxiliary historical translation sentence sample, and translation information of the target language of at least one auxiliary historical translation sentence sample" constitutes the auxiliary translation information for the text to be translated. Simultaneously, the agent can also input "purpose is text translation" to indicate that the purpose of the input is to translate the text to be translated. The large language model can learn the text characteristics within the auxiliary translation information and translate the text to be translated, thus improving translation accuracy.
[0146] In one implementation, the above-mentioned information input into the large language model can be labeled separately. For example, when inputting the above-mentioned information into the large language model, the following can be input: "text to be translated", "translation language: target translation language", "domain knowledge: target professional background knowledge information", "term translation: translation information of the target translation language of at least one term contained in the text to be translated", and "auxiliary historical translation: translation information of the target translation language of the auxiliary historical translation sentence sample and the auxiliary historical translation sentence sample", so that the large language model knows what each piece of information is. At the same time, "purpose is text translation" can also be input into the large language model.
[0147] In this embodiment, the domain expert agent 101-1 can retrieve the latest target professional background knowledge information related to the text to be translated through retrieval enhancement generation technology. The target professional background knowledge information retrieved by the domain expert agent 101-1, the translation information of the target translation language of the terms contained in the text to be translated obtained by the terminology expert agent 101-2, and the auxiliary historical translation sentence samples and their target translation language translation information obtained by the translator agent 101-3 are used together as auxiliary translation information to provide translation prompts to the large language model. The large language model learns the text characteristics in the auxiliary translation information and translates the text to be translated to obtain the translated text, thereby improving the accuracy and timeliness of the translation and ensuring the cutting-edge nature of the translated text.
[0148] To further improve the accuracy of the translation, the translator agent 101-3 can also send the translated text and the target language to the proofreading agent 101-4, which will then perform grammatical correction on the translated text.
[0149] Furthermore, the proofreading agent 101-4 performs grammatical correction on the translated text based on preset grammatical rules to obtain the target translated text corresponding to the text to be translated.
[0150] In practice, the proofreading agent 101-4 performs grammatical correction on the initial translation text based on preset grammatical rules and a pre-trained large language model to obtain the target translation text corresponding to the text to be translated.
[0151] Specifically, the proofreading agent 101-4 inputs the initial translation text and preset grammar rules into the pre-trained large language model to obtain the target translation text corresponding to the corrected translation text.
[0152] In this embodiment, pre-set grammatical rules corresponding to different languages are configured by technical personnel and embedded in the proofreading agent 101-4. After receiving the initial translation text and target translation language from the translator agent 101-3, the proofreading agent 101-4 obtains the corresponding pre-set grammatical rules according to the target translation language and inputs the initial translation text and the pre-set grammatical rules corresponding to the target translation language into a pre-trained large language model. The large language model can learn the pre-set grammatical rules corresponding to the target translation language by means of the pre-set grammatical rules corresponding to the target translation language, and perform grammatical correction on the initial translation text to obtain the corrected target translation text. This further improves the fluency and accuracy of the translation, enhances the translation quality, and ensures a high standard of translation.
[0153] The text translation system provided in this application employs a multi-agent collaborative mechanism to ensure the effective integration and use of auxiliary translation information from different sources during the text translation process. This reduces reliance on large amounts of domain-specific labeled data, eliminates the need for fine-tuning of pre-trained large language models, and improves translation accuracy and efficiency while conserving computational resources. Furthermore, by incorporating retrieval-enhanced generation techniques, the agents can retrieve updated professional background knowledge information in real time, overcoming the static knowledge limitations of traditional large language models, enhancing flexibility and adaptability, while maintaining the general capabilities of large language models and strengthening domain specialization.
[0154] The following example illustrates this:
[0155] For example, translating an English server technical manual into Chinese, where the text to be translated is: English Server Technical Manual, and the target language is: Chinese.
[0156] First, the user can send the English server technical manual and the target translation language to the domain expert agent 101-1 via the user terminal. After receiving the English server technical manual, the domain expert agent 101-1 identifies at least one keyword in the English server technical manual. Based on the at least one keyword, the target professional field can be determined to be the server technology field. In the English server technical manual, the text sub-fragment to which each keyword belongs is identified. The similarity between the text sub-fragment to which each keyword belongs and each professional background knowledge fragment in the server technology knowledge base is determined. Professional background knowledge fragments with a similarity greater than a first preset threshold to the text sub-fragment to which the keyword belongs are used as target professional background knowledge information, such as the latest server hardware specifications, software protocols, troubleshooting guides, and other professional background knowledge information, providing a basic context for subsequent translation.
[0157] Furthermore, the terminology expert agent 101-2 extracts multiple entity words contained in the English server technical manual to be translated, and uses at least one entity word contained in the terminology database as at least one term in the English server technical manual. Based on the latest professional background knowledge information such as server hardware specifications, software protocols, and troubleshooting guides, it identifies the target semantics of each term in the at least one term to ensure that its exact semantics in the context of server technology are understood, and extracts the translation information of the target semantics of the Chinese for each term in the at least one term from the terminology database.
[0158] Furthermore, the translator agent 101-3 retrieves historical translation sample data from the translation library that has a similarity to the sentence to be translated in the English server technical manual that exceeds a second preset threshold, as auxiliary historical translation sample data. The target translation language "Chinese", the latest server hardware specifications, software protocols, troubleshooting guides, and other professional background knowledge information, the Chinese translation information of at least one term contained in the English server technical manual, at least one auxiliary historical translation sample, and the Chinese translation information of at least one auxiliary historical translation sample are used as auxiliary translation information to provide translation prompts to the large language model. The English server technical manual and the auxiliary translation information are then input into the large language model to obtain the initial Chinese server technical manual.
[0159] Furthermore, proofreading agent 101-4 reviews the generated initial Chinese server technical manual to ensure the fluency of language expression, the consistency of logic, and the correct use of technical terminology. Proofreading agent 101-4 utilizes its built-in rule engine to perform grammatical correction on the initial Chinese server technical manual based on preset grammatical rules, identifying and correcting possible grammatical errors, and outputting a high-quality Chinese server technical manual.
[0160] Based on the same inventive concept, this application also provides a text translation device. Since the principle of the text translation device in solving the problem is similar to that of the text translation method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0161] like Figure 11 As shown, it is a structural schematic diagram of the text translation device provided in the embodiments of this application, which may include:
[0162] Module 1001 is used to acquire the text to be translated and the target language.
[0163] Domain knowledge recognition module 1002 is used to determine the target professional domain based on at least one keyword in the text to be translated, and to obtain the target professional background knowledge information of the target professional domain from a knowledge base, wherein the knowledge base stores the professional background knowledge information of the target professional domain;
[0164] The terminology recognition module 1003 is used to identify at least one term contained in the text to be translated based on a terminology database, and to determine the translation information of the at least one term based on the terminology database and the target translation language. The terminology database stores terms from different languages in the target professional field.
[0165] The translation module 1004 is used to translate the text to be translated into the target language based on the target professional background knowledge information, the translation information of the at least one term, and a large language model.
[0166] In one possible implementation, the domain knowledge identification module 1002 is specifically used to determine the text sub-fragment to which each of the at least one keyword belongs in the text to be translated; and to obtain the target professional background knowledge information from the professional background knowledge information of the target professional field stored in the knowledge base based on the text sub-fragment to which each of the at least one keyword belongs.
[0167] In one possible implementation, the professional background knowledge information of the target professional field includes multiple professional background knowledge fragments;
[0168] The domain knowledge recognition module 1002 is specifically used to perform the following steps on the text sub-fragment to which each keyword belongs: determining the similarity between the text sub-fragment to which the first keyword belongs and each of the plurality of professional background knowledge fragments; wherein, the first keyword is any keyword among the at least one keyword; if there is a first professional background knowledge fragment among the plurality of professional background knowledge fragments whose similarity to the text sub-fragment to which the first keyword belongs is greater than a first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed; and the selected target professional background knowledge fragment is taken as the target professional background knowledge information.
[0169] In one possible implementation, the terminology recognition module 1003 is specifically used to identify multiple entity words in the text to be translated; and to use at least one entity word contained in the terminology database as the at least one term in the text to be translated.
[0170] In one possible implementation, the terminology database stores terms with different semantics in different languages for the target professional field;
[0171] The terminology recognition module 1003 is specifically used to perform the following steps for each of the at least one terminology: determining the target semantics of the first term based on the target professional background knowledge information; determining the translation information of the target semantics of the first terminology in the target translation language from the terminology database; wherein, the first terminology is any one of the at least one terminology.
[0172] In one possible implementation, the translation module 1004 is specifically configured to perform the following steps for each of at least one sentence to be translated in the text to be translated: determining at least one auxiliary historical translation sentence sample; determining the similarity between the first sentence to be translated and each of a plurality of historical translation sentence samples in the translation library; the plurality of historical translation sentence samples are in the same language as the text to be translated; if there is a first historical translation sentence sample among the plurality of historical translation sentence samples whose similarity to the first sentence to be translated is greater than a second preset threshold, then the first historical translation sentence sample is used as the auxiliary historical translation sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed; wherein, the first sentence to be translated is any one of the at least one sentence to be translated; determining the translation information of the at least one auxiliary historical translation sentence sample from the translation library according to the target translation language; inputting the text to be translated, the target translation language, the target professional background knowledge information, the translation information of the at least one term, the at least one auxiliary historical translation sentence sample, and the translation information of the at least one auxiliary historical translation sentence sample into the large language model to obtain the translated text in the target translation language.
[0173] In one possible implementation, the translation library also includes feature vectors of the plurality of historical translated sentence samples;
[0174] The translation module 1004 is specifically used to obtain the feature vector of the first statement to be translated; calculate the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample; and use the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample as the similarity between the first statement to be translated and each historical translated statement.
[0175] In one possible implementation, the device further includes:
[0176] The correction module is used to perform grammatical correction on the translated text based on preset grammatical rules.
[0177] Based on the same inventive concept, this application also provides a text translation system. Since the principle of the text translation system in solving the problem is similar to that of the text translation method, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be described again.
[0178] like Figure 12The diagram shown is a structural schematic of the text translation system 1100 provided in this application embodiment. The text translation system may include a multi-agent system 1101 and a cloud server 1102. The multi-agent system 1101 includes a domain expert agent 1101-1, a terminology expert agent 1101-2, and a translator agent 1101-3. Domain expert agent 1101-1 and terminology expert agent 1101-2 are connected via a network, and terminology expert agent 1101-2 and translator agent 1101-3 are connected via a network. The cloud server 1102 includes a knowledge base 1102-1 and a terminology database 1102-2. Domain expert agent 1101-1 and knowledge base 1102-1 are connected via a network, and terminology expert agent 1101-2 and terminology database 1102-2 are connected via a network. Wherein:
[0179] Domain expert agent 1101-1 is used to acquire the text to be translated and the target translation language; determine the target professional domain based on at least one keyword in the text to be translated; and acquire the target professional background knowledge information of the target professional domain from the knowledge base 1102-1, which stores the professional background knowledge information of the target professional domain.
[0180] The terminology expert agent 1101-2 is used to identify at least one term contained in the text to be translated based on the terminology database 1102-2, and to determine the translation information of the at least one term based on the terminology database 1102-2 and the target translation language. The terminology database 1102-2 stores terms in different languages of the target professional field.
[0181] Translator agent 1101-3 is used to translate the text to be translated into the target language based on the target professional background knowledge information, the translation information of at least one term, and a large language model.
[0182] In one possible implementation, the domain expert agent 1101-1 is specifically used to determine the text sub-fragment to which each of the at least one keyword belongs in the text to be translated; and to obtain the target professional background knowledge information from the professional background knowledge information of the target professional field stored in the knowledge base 1102-1 based on the text sub-fragment to which each of the at least one keyword belongs.
[0183] In one possible implementation, the professional background knowledge information of the target professional field includes multiple professional background knowledge fragments;
[0184] The domain expert agent 1101-1 is specifically used to perform the following steps on each text sub-fragment to which a keyword belongs: determining the similarity between the text sub-fragment to which the first keyword belongs and each of the plurality of professional background knowledge fragments; wherein, the first keyword is any keyword among the at least one keyword; if there is a first professional background knowledge fragment among the plurality of professional background knowledge fragments whose similarity to the text sub-fragment to which the first keyword belongs is greater than a first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed; and the selected target professional background knowledge fragment is taken as the target professional background knowledge information.
[0185] In one possible implementation, the terminology expert agent 1101-2 is specifically used to identify multiple entity words in the text to be translated; and to use at least one entity word contained in the terminology database 1102-2 as the at least one term in the text to be translated.
[0186] In one possible implementation, the terminology database 1102-2 stores terms with different semantics in different languages of the target professional field;
[0187] The terminology expert agent 1101-2 is specifically used to perform the following steps for each of the at least one terminology: determining the target semantics of the first term based on the target professional background knowledge information; determining the translation information of the target semantics of the first terminology in the target translation language from the terminology database 1102-2; wherein, the first terminology is any one of the at least one terminology.
[0188] In one possible implementation, the cloud server 1102 further includes a translation library 1102-3, and the translator agent 1101-3 is connected to the translation library 1102-3 via a network;
[0189] The translator agent 1101-3 is specifically configured to perform the following steps for each of at least one sentence to be translated in the text to be translated, determining at least one auxiliary historical translation sentence sample: determining the similarity between the first sentence to be translated and each of the multiple historical translation sentence samples in the translation library 1102-3; the multiple historical translation sentence samples are in the same language as the text to be translated; if there is a first historical translation sentence sample among the multiple historical translation sentence samples whose similarity to the first sentence to be translated is greater than a second preset threshold, then the first historical translation sentence sample is used as the first sentence to be translated. The corresponding auxiliary historical translation sentence sample is obtained; otherwise, the next sentence to be translated is processed; wherein, the first sentence to be translated is any one of the at least one sentences to be translated; according to the target translation language, the translation information of the at least one auxiliary historical translation sentence sample is determined from the translation library 1102-3; the text to be translated, the target translation language, the target professional background knowledge information, the translation information of the at least one term, the at least one auxiliary historical translation sentence sample and the translation information of the at least one auxiliary historical translation sentence sample are input into the large language model to obtain the translated text of the target translation language.
[0190] In one possible implementation, the translation library 1102-3 further includes feature vectors of the plurality of historical translated sentence samples;
[0191] The translator agent 1101-3 is specifically used to obtain the feature vector of the first statement to be translated; calculate the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample; and use the similarity between the feature vector of the first statement to be translated and the feature vector of each historical translated statement sample as the similarity between the first statement to be translated and each historical translated statement.
[0192] In one possible implementation, the multi-agent system 1101 further includes a proofreading agent 1101-4, with the translator agent 1101-3 connected to the proofreading agent 1101-4;
[0193] The proofreading agent 1101-4 is used to perform grammatical correction on the translated text based on preset grammatical rules.
[0194] Based on the same technical concept, this application also provides an electronic device 1200, referring to... Figure 13As shown, the electronic device 1200 is used to implement the text translation method described in the above-described method embodiments. The electronic device 1200 in this embodiment may include: a memory 1201, a processor 1202, and a computer program, such as a text translation program, stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various text translation method embodiments described above.
[0195] This application embodiment does not limit the specific connection medium between the memory 1201 and the processor 1202. This application embodiment... Figure 13 The memory 1201 and the processor 1202 are connected via a bus 1203, and the bus 1203 is in Figure 13 The connections between other components are shown in bold and are for illustrative purposes only, not as limiting information. The bus 1203 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 13 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0196] Memory 1201 may be volatile memory, such as random-access memory (RAM); memory 1201 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1201 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1201 may be a combination of the above-described memories.
[0197] The processor 1202 is used to implement the text translation method provided in the embodiments of this application.
[0198] This application also provides a computer-readable storage medium storing computer-executable instructions required to execute the processor, including a program required to execute the processor.
[0199] In some possible implementations, various aspects of the text translation method provided in this application may also be implemented as a program product comprising program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps in the text translation method according to the various exemplary embodiments of this application described above.
[0200] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0201] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0202] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0203] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0204] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0205] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A text translation method, characterized in that, include: Obtain the text to be translated and the target language; The target professional field is determined based on at least one keyword in the text to be translated, and the target professional background knowledge information of the target professional field is obtained from the knowledge base, which stores the professional background knowledge information of the target professional field. The terminology database identifies at least one term contained in the text to be translated, and the translation information of the at least one term is determined based on the terminology database and the target translation language. The terminology database stores terms from different languages in the target professional field. Based on the target professional background knowledge information, the translation information of the at least one term, and the large language model, the text to be translated is translated into the target translation language, wherein the large language model is used to translate the text to be translated according to the target translation language.
2. The method as described in claim 1, characterized in that, Retrieve target professional background knowledge information from the knowledge base, specifically including: In the text to be translated, determine the text sub-segment to which each of the at least one keyword belongs; Based on the text sub-fragment to which each of the at least one keyword belongs, the target professional background knowledge information is obtained from the professional background knowledge information of the target professional field stored in the knowledge base.
3. The method as described in claim 2, characterized in that, The professional background knowledge information in the target professional field includes multiple professional background knowledge fragments; Based on the text fragment to which each of the at least one keyword belongs, the target professional background knowledge information is obtained from the professional background knowledge information of the target professional field stored in the knowledge base, specifically including: Perform the following steps on each text segment containing a keyword: Determine the similarity between the text sub-fragment to which the first keyword belongs and each of the plurality of professional background knowledge fragments; wherein, the first keyword is any one of the at least one keywords; If among the plurality of professional background knowledge fragments there is a first professional background knowledge fragment whose similarity to the text sub-fragment to which the first keyword belongs is greater than a first preset threshold, then the first professional background knowledge fragment is taken as the target professional background knowledge fragment; otherwise, the next keyword is processed. The selected fragments of target professional background knowledge are used as the target professional background knowledge information.
4. The method as described in claim 1, characterized in that, Based on a terminology database, at least one term is identified in the text to be translated, specifically including: Identify multiple entity words in the text to be translated; The at least one entity word contained in the terminology database is used as the at least one term in the text to be translated.
5. The method as described in claim 1 or 4, characterized in that, The terminology database stores terms with different semantic meanings in different languages for the target professional field; Based on the terminology database and the target translation language, the translation information of the at least one term is determined, specifically including: Perform the following steps for each of the at least one term: Based on the target professional background knowledge information, determine the target semantics of the first term; The translation information of the target semantics of the target translation language of the first term is determined from the terminology database; Wherein, the first term is any one of the at least one terms.
6. The method as described in claim 1, characterized in that, Based on the target professional background knowledge information, the translation information of at least one term, and the large language model, the text to be translated is translated into the target language, specifically including: For each sentence to be translated in the text to be translated, perform the following steps to determine at least one sample of auxiliary historical translation sentences: Determine the similarity between the first sentence to be translated and each of the multiple historical translated sentence samples in the translation library; the multiple historical translated sentence samples are in the same language as the text to be translated. If among the plurality of historical translated sentence samples there is a first historical translated sentence sample whose similarity to the first sentence to be translated is greater than a second preset threshold, then the first historical translated sentence sample is used as the auxiliary historical translated sentence sample corresponding to the first sentence to be translated; otherwise, the next sentence to be translated is processed. Wherein, the first statement to be translated is any one of the at least one statements to be translated; Based on the target translation language, determine the translation information of the at least one auxiliary historical translation sentence sample from the translation library; The text to be translated, the target language, the target professional background information, the translation information of at least one term, the at least one auxiliary historical translation sentence sample, and the translation information of the at least one auxiliary historical translation sentence sample are input into the large language model to obtain the translated text in the target language.
7. The method as described in claim 6, characterized in that, The translation library also contains feature vectors of the multiple historical translated sentence samples; Determine the similarity between the first sentence to be translated and multiple historical translated sentence samples in the translation database, specifically including: Obtain the feature vector of the first sentence to be translated; Calculate the similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample; The similarity between the feature vector of the first sentence to be translated and the feature vector of each historical translated sentence sample is used as the similarity between the first sentence to be translated and each historical translated sentence.
8. The method as described in claim 1, characterized in that, Also includes: The translated text is grammatically corrected based on preset grammar rules.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the text translation method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the text translation method as described in any one of claims 1 to 8.
