A method, system, device and medium for enhancing large-model machine translation based on thought chain
By building a domain knowledge base and enhancing the knowledge of large language models, combined with self-comparison optimization of translation results, the problem of poor translation results of large language models in low-resource areas has been solved, and efficient translation performance has been improved, especially in professional fields. .
Patent Information
- Application Number
- CN202410157029.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-02-04
AI Technical Summary
When large language models perform translation tasks outside of training data or with low resources or special fields, the translation effect is poor, and model fine-tuning leads to excessive consumption of computing resources and is difficult to implement.
The large model machine translation enhancement method based on the thinking chain is adopted. By constructing a domain knowledge base, the original text to be translated is input and domain knowledge is obtained, the knowledge of the large language model is enhanced, prompts are constructed for translation, and self-comparison is used to optimize the translation results and reduce the consumption of computing resources. .
Without training the fine-tuned model, the translation performance is improved and the translation quality is improved, especially in professional fields. It performs well, significantly increases the Bleu value, and reduces the need for users' professional knowledge.
Smart Images

Figure CN118114686B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine translation, and in particular relates to a translation enhancement technology. Background Art
[0002] With the continuous development of neural network models, large language models have emerged. Although there has not been a major breakthrough in the structure of the model, the increase in the number of parameters and data has made it a huge breakthrough in practicality. The knowledge contained in the model can be applied to untrained downstream tasks to a certain extent, which brings a lot of convenience to users. Among them, machine translation is a large application field.
[0003] The large language model can effectively translate general corpora. Although its performance cannot beat professional commercial translation models and specialized supervised machine translation models, its performance has reached a usable state for most users.
[0004] However, when a large language model performs translation tasks outside of training data or in low-resource or special fields, its translation effect will be greatly reduced. In this case, we can usually fine-tune the model to make it continue to adapt to the needs, but this method consumes too much computing resources and is difficult to implement. Summary of the invention
[0005] The present invention proposes a large-model machine translation enhancement method, system, device and medium based on thought chain, which aims to solve the problem that the large language model has poor translation effect when performing translation tasks outside of training data or in low resources or special fields. If the model is fine-tuned to continue to adapt to the needs, it will bring more massive computing resources and be difficult to implement.
[0006] The invention proposes a method for enhancing large-model machine translation based on thought chain, which includes:
[0007] S1: construct a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge;
[0008] S2: constructing a large language model, inputting the original text to be translated and the domain knowledge into the large language model, enhancing the domain knowledge, and obtaining enhanced domain knowledge;
[0009] S3: Construct prompts based on the original text to be translated and the enhanced domain knowledge;
[0010] S4: using the large language model and the prompt to translate the original text to obtain multiple translation results.
[0011] Furthermore, a preferred solution is provided:
[0012] The S1 includes:
[0013] S11: Convert the language sequence of the original text to be translated into a vector embedding representation;
[0014] S12: Text clustering using vector embedding representations.
[0015] Furthermore, a preferred solution is provided:
[0016] The S11 includes:
[0017] S111: Obtaining corpus to be classified according to the original text to be translated;
[0018] S112: Dividing the corpus to be classified into multiple groups of corpora according to fields and languages;
[0019] S113: Use the tokenizer of the m-bert model to convert each group of corpus into token sequences;
[0020] S114: average the number of tokens in each group of transformed corpus;
[0021] S115: Use each group of corpora after quantitative averaging to train the embedding layer of the M-BERT model, fix the other layers of the M-BERT model, and generate a vector embedding representation.
[0022] Furthermore, a preferred solution is provided:
[0023] The S12 includes:
[0024] S121: Based on all vector embedding representations, k text categories are obtained using the k-means algorithm;
[0025] S122: Use k-means algorithm to cluster texts for each text category to obtain multiple sub-fields;
[0026] S123: Input the texts in the multiple subdivided fields into the large language model to obtain subdivided field knowledge;
[0027] S124: Combining the segmented domain knowledge and the k-means model to obtain the domain knowledge base.
[0028] Furthermore, a preferred solution is provided:
[0029] The method further comprises:
[0030] S5: taking the multiple translation results as a translation library, using a large language model, and extracting the best translation result from the translation library as the mother sentence;
[0031] S6: Continue to extract a plurality of translation results from the translation library, and input them into the large language model together with the mother sentence;
[0032] S7: Analyze the differences, advantages and disadvantages of the mother sentence in combination with the enhanced domain knowledge to obtain an analysis result;
[0033] S8: Optimizing the mother sentence by combining the enhanced domain knowledge, the analysis results and the translation library to obtain an optimized mother sentence;
[0034] S9: looping S6 to S8 until all translation results in the translation library are extracted.
[0035] Furthermore, a preferred solution is provided: in S7, the number of the translation results continuously extracted from the translation library is no less than 6.
[0036] Furthermore, a preferred solution is provided:
[0037] The S4 further comprises:
[0038] S41: modify the temperature parameter of the large language model, and generate and obtain the initial n translation groups multiple times;
[0039] S42: Perform similarity analysis on the n translation groups and screen them to obtain m translation groups.
[0040] The present invention also proposes a large model machine translation enhancement system based on thought chain, comprising:
[0041] Domain knowledge acquisition module: used to build a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge;
[0042] Domain knowledge enhancement module: used to build a large language model, input the original text to be translated and the domain knowledge into the large language model, enhance the domain knowledge, and obtain enhanced domain knowledge;
[0043] Prompt construction module: used to build prompts based on the original text to be translated and the enhanced domain knowledge;
[0044] Translation module: used to use the large language model and the prompt to translate the original text to be translated to obtain multiple translation results.
[0045] The present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes a large-model machine translation enhancement method based on a thought chain that is a combination of any of the above-mentioned schemes.
[0046] The present invention also provides a computer-readable storage medium, which is used to store a computer program, and the computer program executes a large-model machine translation enhancement method based on a thought chain in combination with any one of the above-mentioned schemes.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The present invention proposes a large-model machine translation enhancement method based on thought chaining, which improves translation performance through thought chaining without training a fine-tuning model.
[0049] The specific idea of the method described in the present invention is to retrieve knowledge related to the original text in an external domain knowledge base, use a large language model to enhance the knowledge, inject the enhanced domain knowledge into the knowledge, generate a language environment and knowledge background that is more suitable for the original text to be translated, make the translation domain-based, and then use the self-comparison method to further correct the translation result to improve the quality of the translation.
[0050] The thought chain method adopted in the present invention includes the self-generation injection technology of domain knowledge and the translation optimization technology based on self-comparison. It can improve the translation results of the large language model while ensuring low cost, and can better explore and utilize the deep knowledge related to the large language model and the current original text, and effectively improve the effect of the large language model machine translation. It is a technical solution that is different from the existing similar technical concepts, especially in professional fields, and this solution has a good performance.
[0051] The method proposed in the present invention makes maximum use of the knowledge contained in the large language model. It is difficult to extract domain knowledge related to the language model by direct machine translation, and generally a literal translation will be obtained. Compared with the direct translation method, the method proposed in the present invention can make the translation structure more domain-based and professional.
[0052] According to experimental data verification, the Bleu value of the machine translation result in the medical field using the method proposed in the present invention is 0.643, which is 0.061 higher than the Bleu value of the translation result without using this method, which is 0.528. The Bleu value of the translation result in the deep learning field is 0.614, while the result without using this method is 0.571, which is 0.043 higher. In the field of translation, the method proposed in this scheme has a large improvement.
[0053] The present invention is applicable to large-scale text translation scenarios in various specific fields. The method proposed in the present invention of automatically retrieving professional domain knowledge and mining various translation results of a large language model can greatly enhance the professional domain translation capability of the large language model and reduce the demand for professional knowledge of users. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flowchart of a large model machine translation enhancement method based on thought chain described in Implementation Method 1;
[0055] Figure 2 This is a flow chart of domain knowledge retrieval described in implementation mode 1;
[0056] Figure 3 This is a flowchart of iterative optimization of translations described in Implementation Method 1. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Implementation Method 1
[0059] Reference Figure 1 , Figure 2 , Figure 3 This embodiment will be described.
[0060] The method for enhancing large-model machine translation based on thought chain described in this embodiment includes:
[0061] S1: construct a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge;
[0062] S2: constructing a large language model, inputting the original text to be translated and the domain knowledge into the large language model, enhancing the domain knowledge, and obtaining enhanced domain knowledge;
[0063] S3: Construct prompts based on the original text to be translated and the enhanced domain knowledge;
[0064] S4: Using the large language model and the prompt, the original text to be translated is translated to obtain multiple translation results. This embodiment uses the enhanced domain knowledge and the original text to be translated to construct a prompt for the model, so that the large language model translates the original text in the language environment of the domain knowledge.
[0065] Furthermore, the S1 includes:
[0066] S11: Convert the language sequence of the original text to be translated into a vector embedding representation;
[0067] S12: Text clustering using vector embedding representations.
[0068] The S11 includes:
[0069] S111: Obtaining corpus to be classified according to the original text to be translated;
[0070] S112: Dividing the corpus to be classified into multiple groups of corpora according to fields and languages;
[0071] S113: Use the tokenizer of the m-bert model to convert each group of corpus into token sequences;
[0072] S114: average the number of tokens in each group of transformed corpus;
[0073] S115: Use each group of corpora after quantitative averaging to train the embedding layer of the M-BERT model, fix the other layers of the M-BERT model, and generate a vector embedding representation.
[0074] The S12 includes:
[0075] S121: Obtain k text categories based on all vector embedding representations;
[0076] S122: Use k-means algorithm to cluster texts for each text category to obtain multiple sub-fields;
[0077] S123: Input the texts in the multiple subdivided fields into the large language model to obtain subdivided field knowledge;
[0078] S124: Combining the segmented domain knowledge and the k-means model to obtain the domain knowledge base.
[0079] The following is a further explanation of S1:
[0080] like Figure 2 As shown, the main purpose of the above S11 and S12 is to build a domain knowledge base for domain knowledge retrieval. It is necessary to classify the corpus into domains. The direct representation of language is not conducive to mathematical calculations during retrieval. This implementation method converts the language sequence into a vector embedding representation through the embedding layer of M-BERT, and uses the vector embedding representation to perform text clustering.
[0081] First, the corpora of different fields and languages are divided into different languages, and the corpora of the same language are grouped into the same group.
[0082] Secondly, use the tokenizer of the M-BERT model to convert token sequences for different languages, that is, to segment the original natural language sequence and convert it into a token sequence. Averaging the number of tokens in different language corpora, that is, making the number of tokens in each language the same, can reduce the imbalance of language resources.
[0083] Finally, the multilingual mixed corpus with averaged token numbers is used to train the embedding layer of the M-BERT model. The other layers of the M-BERT model are fixed, and only the embedding layer parameters are trained for embedding vector representation generation.
[0084] In view of the very detailed division of the domain of the corpus, it is very difficult to classify the text directly by text clustering. This embodiment adopts a two-step text clustering method to complete the domain clustering of the corpus. After two-step text clustering using multilingual corpora in various fields, large-category domains and subdivided small-category domains within the domains are obtained. The small-category domain corpus is used to generate relevant domain knowledge through a large language model, and the domain knowledge and large-category domains and subdivided domains are combined into a tree-like domain knowledge base.
[0085] Specifically:
[0086] First, the methods from S111 to S115 are used to convert all corpora into embedded vector representations. Then, the k-means algorithm (k-means clustering algorithm) is used for all embedded vector representations of each language to obtain k text categories.
[0087] After all the corpora are classified, the k-means algorithm is used again to cluster the text for each text category to obtain multiple small sub-fields.
[0088] The text in the segmented domain is input into the large language model to generate segmented domain knowledge, and finally the domain knowledge and two k-means clustering models are merged into a domain knowledge base, which can automatically retrieve the domain knowledge of the text.
[0089] The following is an example of using the domain knowledge base proposed in this embodiment to perform domain retrieval on a sentence:
[0090] Original text: No statistically significant difference of donor and recipientage, number of mismatches, cold ischemia time was found between case and control groups.
[0091] Domain analysis results: This sentence is related to clinical research in the medical field, specifically focusing on organ transplantation. The following is a brief introduction to this field:
[0092] Organ Transplantation Research:
[0093] 1. Definition: Organ transplantation is a medical procedure that saves the patient's life or improves his or her quality of life by transferring a healthy organ from one person (donor) to another person in need (recipient).
[0094] 2. Research direction: The field of organ transplantation focuses on studying how to perform organ transplantation most effectively, including donor and recipient matching, surgical techniques, immunosuppression and other aspects.
[0095] 3. Important factors:
[0096] Donor and recipient characteristics: including age, matching degree, etc.
[0097] Mismatches: Mismatches in tissue or blood type.
[0098] Cold ischemia time: The time from when the transplanted organ is removed from the donor to when it is transplanted to the recipient, which affects the quality and function of the organ.
[0099] 4. Objective: The goal of the research is to optimize the success rate of organ transplantation, reduce rejection reactions, and improve the survival rate and quality of life of the recipient.
[0100] In general, organ transplantation research in the medical field is dedicated to gaining a deeper understanding of factors related to surgery in order to improve the effectiveness of organ transplantation and patient outcomes.
[0101] It can be seen that the accuracy and retrieval effect of the field search using this implementation are extremely detailed and precise.
[0102] Furthermore, S4 in this embodiment further includes:
[0103] S41: modify the temperature parameter of the large language model, and generate and obtain the initial n translation groups multiple times;
[0104] S42: Perform similarity analysis on the n translation groups and screen them to obtain m translation groups.
[0105] The following is a further explanation of S4:
[0106] In the field of translation, there is no standard answer to translation. Different translators have different styles, and all of these translations are valid. Similarly, the translation of a large model can also obtain multiple results. This implementation method simulates the translation results of translators with different styles by screening different translation results of a large language model to obtain translation results with different styles.
[0107] The temperature parameter can regulate the creativity and randomness of the results generated by the large language model. Its value is between 0 and 1. A higher temperature parameter represents a higher creativity. This embodiment modifies the temperature parameter of the large language model from 0.7 to 0.9, with an interval of 0.05. Under different temperature parameters, the large language model is used to generate different translations multiple times, and at least one translation is obtained under each temperature, thereby obtaining the initial n translation groups tgt 1…n , and take this part of the translation as the object of subsequent screening.
[0108] Use the bert model's tokenizer to group the initial n translated texts into tgt 1…n Convert it into a token sequence (the tokenizer of the bert model can convert token sequences in multiple languages).
[0109] The obtained token sequence is screened in the following way: starting from the first token sequence, the comparison operation is performed sequentially. Specifically, the similarity is first calculated with all the translation results in the current translation library using the edit distance, and the highest similarity with all the translation results in the library is calculated. If the similarity is higher than a certain threshold, it will be discarded, and if it is lower than a certain threshold, it will be included in the library. In this way, a translation library with a large difference from the current original text is obtained.
[0110] The similarity calculation formula is:
[0111]
[0112] Where a and b are two translations, and distance(a, b) is the Levenshtein distance between them. Levenshtein distance refers to the minimum number of editing operations required to convert one string into another. The specific operations include:
[0113] (1) Replace one character with another character (Substitutions).
[0114] (2) Insert a character (Insertions).
[0115] (3) Delete a character (Deletions).
[0116] Len(a) and Len(b) represent the token lengths of the two translations a and b.
[0117] The similarity calculation formula between the current translation and the translation library is:
[0118]
[0119] Where B is the current translation library, that is, the maximum similarity is taken as the similarity between the current translation and the translation library. If it exceeds the threshold, the current translation is discarded.
[0120] The method described in this embodiment also includes:
[0121] S5: taking the multiple translation results as a translation library, using a large language model, and extracting the best translation result from the translation library as the mother sentence;
[0122] S6: Continue to extract several translation results from the translation library, and input them into the large language model together with the mother sentence;
[0123] S7: Analyze the differences, advantages and disadvantages of the mother sentence in combination with the enhanced domain knowledge to obtain an analysis result;
[0124] S8: Optimizing the mother sentence by combining the enhanced domain knowledge, the analysis results and the translation library to obtain an optimized mother sentence;
[0125] S9: looping S6 to S8 until all translation results in the translation library are extracted.
[0126] It is worth noting that in S7, the number of the translation results continuously extracted from the translation library is no less than 3.
[0127] The following is a further explanation of S5 to S9:
[0128] The translation libraries obtained through the above steps each have their own characteristics. At this time, the translations in the translation library are handed over to the large language model for analysis and summary, to identify the differences and advantages and disadvantages, to stimulate the large language model to reflect and optimize the translation results.
[0129] like Figure 3 As shown, the specific implementation steps are as follows:
[0130] 1. Use a large language model to extract the best translation result from the screened translation library as the mother sentence X.
[0131] 2. Continue to extract sentences from the screened translation library, input them into the large language model together with the mother sentence, and perform difference, advantages and disadvantages analysis in combination with the enhanced domain knowledge, and give the analysis result R.
[0132] 3. Combining the analysis result R, the enhanced domain knowledge and the translation library, the translation result is optimized to obtain the optimized translation result, and the optimized translation result is used as the new mother sentence X'.
[0133] Repeat steps 2 and 3 until all sentences in the translation library have been extracted.
[0134] The thought chain method adopted in this embodiment includes the self-generation injection technology of domain knowledge and the translation optimization technology based on self-comparison. It can improve the translation results of the large language model while ensuring low cost, and can better mine and utilize the large language model and the deep knowledge related to the current original text, and effectively improve the effect of the large language model machine translation. Especially in professional fields, the method described in this embodiment has a good performance.
[0135] Implementation Method 2
[0136] This embodiment is a further example of the large-model machine translation enhancement method based on thought chain described in the first embodiment.
[0137] The following is an example of translation in the medical field, where the intermediate result is the translation in the translation library:
[0138] Original text: No statistically significant difference of donor and recipientage, number of mismatches, cold ischemia time was found between case and control groups.
[0139] Intermediate results:
[0140] Result 1: No statistically significant differences were found between the case group and the control group in terms of donor and recipient age, number of mismatches, and cold ischemia time.
[0141] Result 2: There were no statistically significant differences in the age, matching status, and cold ischemia time of donors and recipients between the case group and the control group.
[0142] Result 3: No statistically significant differences were observed between the case group and the control group in terms of donor and recipient age, number of mismatches, and cold ischemia time.
[0143] Result 4: There were no significant statistical differences between the case and control groups in terms of donor or recipient age, matching, or even cold ischemia time.
[0144] Results: No statistically significant differences were found between the case and control groups in terms of donor and recipient age, number of mismatches, and cold ischemia time.
[0145] Direct translation results: No statistically significant differences in donor and recipient age, number of mismatches, and cold ischemia time were found between the case and control groups.
[0146] The following is an example of deep learning translation, where the intermediate result is the translation in the translation library:
[0147] Original text: From the perspective of information theory, a random dropping method with the capability of keeping information diversity can preserve more information and theoretically perform better than those without such capability.
[0148] Intermediate results:
[0149] Result 1: From the perspective of information theory, a random dropout method with the ability to maintain information diversity can retain more information and theoretically perform better than those methods that lack this ability.
[0150] Result 2: Based on information theory, a random dropout method with the ability to maintain information diversity can fully retain information and, in theory, perform better than those methods without this ability.
[0151] Result 3: From the perspective of information theory, a random dropout method with the ability to maintain information diversity can more effectively preserve information and, in theory, outperforms methods that lack this ability.
[0152] The end result: From an information theory perspective, a random dropout method that has the ability to maintain information diversity can more effectively preserve information and theoretically outperform methods that lack this ability.
[0153] Direct translation of the results: From the perspective of information theory, random dropout methods with the ability to maintain information diversity can retain more information and theoretically perform better than those without this ability.
[0154] It can be seen that the translation result obtained by adopting the method described in Implementation Method 1 is accurate and complete. It is combined with the domain knowledge base proposed in Implementation Method 1 and can be applied to translation scenarios in various fields. In addition, it combines the advantages of different translation results of the large language model to obtain a very complete translation result.
[0155] Implementation Method 3
[0156] The large model machine translation enhancement system based on thought chain described in this embodiment includes:
[0157] Domain knowledge acquisition module: used to build a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge;
[0158] Domain knowledge enhancement module: used to build a large language model, input the original text to be translated and the domain knowledge into the large language model, enhance the domain knowledge, and obtain enhanced domain knowledge;
[0159] Prompt construction module: used to build prompts based on the original text to be translated and the enhanced domain knowledge;
[0160] Translation module: used to use the large language model and the prompt to translate the original text to be translated to obtain multiple translation results.
Claims
1. A large model machine translation enhancement method based on thought chain, characterized in that: The method comprises: S1: construct a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge; S2: constructing a large language model, inputting the original text to be translated and the domain knowledge into the large language model, enhancing the domain knowledge, and obtaining enhanced domain knowledge; S3: Construct prompts based on the original text to be translated and the enhanced domain knowledge; S4: using the large language model and the prompt to translate the original text to obtain multiple translation results; The S1 includes: S11: Convert the language sequence of the original text to be translated into a vector embedding representation; S12: Text clustering using vector embedding representation; The S11 includes: S111: Obtaining corpus to be classified according to the original text to be translated; S112: Dividing the corpus to be classified into multiple groups of corpora according to fields and languages; S113: Use the tokenizer of the m-bert model to convert each group of corpus into token sequences; S114: average the number of tokens in each group of transformed corpus; S115: Use each group of corpora after averaging to train the embedding layer of the M-BERT model, fix the other layers of the M-BERT model, and generate vector embedding representation; The S12 includes: S121: Based on all vector embedding representations, k text categories are obtained using the k-means algorithm; S122: Use k-means algorithm to cluster texts for each text category to obtain multiple sub-fields; S123: Input the texts in the multiple subdivided fields into the large language model to obtain subdivided field knowledge; S124: Combining the segmented domain knowledge and the k-means model to obtain the domain knowledge base; The method further comprises: S5: taking the multiple translation results as a translation library, using a large language model, and extracting the best translation result from the translation library as the mother sentence; S6: Continue to extract a plurality of translation results from the translation library, and input them into the large language model together with the mother sentence; S7: Analyze the differences, advantages and disadvantages of the mother sentence in combination with the enhanced domain knowledge to obtain an analysis result; S8: Optimizing the mother sentence by combining the enhanced domain knowledge, the analysis results and the translation library to obtain an optimized mother sentence; S9: looping S6 to S8 until all translation results in the translation library are extracted.
2. According to claim 1, a large model machine translation enhancement method based on thought chain is characterized in that: In S7, the number of translation results continuously extracted from the translation library is no less than 6.
3. The method for enhancing large-scale machine translation based on thought chain according to claim 1 is characterized in that: The S4 further comprises: S41: modify the temperature parameter of the large language model, and generate and obtain the initial n translation groups multiple times; S42: Perform similarity analysis on the n translation groups and screen them to obtain m translation groups.
4. A large-model machine translation enhancement system based on thought chain, characterized in that: The system comprises: Domain knowledge acquisition module: used to build a domain knowledge base, input the original text to be translated into the domain knowledge base, and obtain domain knowledge: Convert the language sequence of the original text to be translated into a vector embedding representation, including: Obtain the corpus to be classified according to the original text to be translated; Dividing the to-be-classified corpus into multiple groups of corpora according to fields and languages; Use the tokenizer of the M-BERT model to convert each group of corpus into a token sequence; Average the number of tokens in each group of transformed corpus; Use the averaged number of corpora in each group to train the embedding layer of the M-BERT model, fix the other layers of the M-BERT model, and generate vector embedding representations; Use vector embedding representation for text clustering, including: According to all vector embedding representations, k-means algorithm is used to obtain k text categories; The k-means algorithm is used to cluster texts for each text category to obtain multiple sub-fields; Inputting the texts in the multiple subdivided fields into the large language model to obtain subdivided field knowledge; Combining the segmented domain knowledge with the k-means model to obtain the domain knowledge base; Domain knowledge enhancement module: used to build a large language model, input the original text to be translated and the domain knowledge into the large language model, enhance the domain knowledge, and obtain enhanced domain knowledge; Prompt construction module: used to build prompts based on the original text to be translated and the enhanced domain knowledge; Translation module: used to use the large language model and the prompt to translate the original text to be translated to obtain multiple translation results; The system further comprises: Result extraction module: used to use the multiple translation results as a translation library, adopt a large language model, and extract the best translation result from the translation library as the mother sentence; Result input module: used to continue to extract several translation results from the translation library and input them into the large language model together with the mother sentence; Mother sentence analysis module: used to analyze the differences, advantages and disadvantages of the mother sentence in combination with the enhanced domain knowledge to obtain analysis results; Mother sentence optimization module: used to optimize the mother sentence by combining the enhanced domain knowledge, analysis results and translation library to obtain an optimized mother sentence; Repeated extraction module: used to loop S6 to S8 until all translation results in the translation library are extracted.
5. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes a large model machine translation enhancement method based on a thought chain according to any one of claims 1-3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program executes a large-model machine translation enhancement method based on thought chain according to any one of claims 1 to 3.
Citation Information
Cited By
Multi-field machine translation method based on large language model
CN121212170A
