Translation method and device, computer equipment and storage medium

By calling the adaptive target agent and performing evaluation and labeling optimization, the problem of difficult to translate the cultural connotation of a specific language in the existing technology is solved, and more local characteristics and high-quality translation results are achieved.

CN120106102APending Publication Date: 2025-06-06GUANGZHOU QUCHUANG NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510321022.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing technology is difficult to translate the unique cultural connotations contained in a specific language, resulting in a stiff translation result.

Method used

By obtaining the text to be translated and determining the original language and target language, calling the appropriate target agent for translation, and optimizing the translation results through evaluation and annotation, ensuring that the translation results are more local.

Benefits of technology

It achieves more coherent and smooth translation results, which can better capture the cultural connotation of specific languages ​​and improve the quality and reliability of translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106102A_ABST
    Figure CN120106102A_ABST
Patent Text Reader

Abstract

The invention provides a translation method and device, computer equipment and a storage medium. The method comprises the steps of firstly obtaining a to-be-translated text, determining an original language and a target language, then calling an adaptive target agent from a plurality of to-be-selected agents according to the two languages, and finally inputting the to-be-translated text into the target agent to obtain a target translation result. The selected target agent is more matched with the translation task, so that the target agent can translate more coherently and smoothly by virtue of the specialty and knowledge reserve of the target agent, and a translation result with more local characteristics is obtained. In addition, the scheme has high flexibility and expandability, different intelligent agents can be quickly called according to different translation requirements, new language pairs and translation scenes can be adapted by adding new intelligent agents, and the overall practicability and reliability of the translation system are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a translation method, apparatus, computer device and storage medium. Background Art

[0002] In today's era of accelerating globalization, the demand for cross-language communication is growing. As a key means to break down language barriers, text translation is of great importance. Early machine translation was mainly based on rules and statistical methods. However, these methods have great limitations in dealing with complex language structures and semantic understanding. With the rise of deep learning technology, machine translation models based on neural networks, such as recurrent neural networks (RNN), long short-term memory networks (LSTM) and their variants, have become mainstream translation technologies. These models can automatically learn the mapping relationship between languages, which improves the accuracy and fluency of translation to a certain extent. However, traditional translation solutions often have difficulty translating the unique cultural connotations contained in a specific language, and the sentences are also relatively stiff. Summary of the invention

[0003] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the defects in the prior art that it is difficult to translate the unique cultural connotations contained in a specific language and the sentences are relatively stiff.

[0004] In a first aspect, the present application provides a translation method, comprising:

[0005] Obtain the text to be translated and determine the original language and target language;

[0006] Calling an adapted target agent from multiple candidate agents according to the original language and the target language;

[0007] Input the text to be translated into the target agent to obtain the target translation result.

[0008] In one embodiment, a text to be translated is input into a target agent to obtain a target translation result, including:

[0009] Input the text to be translated into the target agent to obtain a preliminary translation result;

[0010] Obtain evaluation annotations of preliminary translation results; the evaluation annotations include evaluation results and evaluation reasons;

[0011] If the evaluation result is lower than the quality threshold, the target agent is instructed to translate again according to the preliminary translation result and its corresponding evaluation annotation to obtain an updated preliminary translation result, and the process returns to the step of obtaining the evaluation annotation of the preliminary translation result to continue execution;

[0012] If the evaluation result exceeds the quality threshold, the preliminary translation result is used as the target translation result.

[0013] In one embodiment, obtaining evaluation annotations of preliminary translation results includes:

[0014] The preliminary translation results are input into the evaluation agent to obtain evaluation annotations.

[0015] In one of the embodiments, the translation method further includes: storing the preliminary translation result whose evaluation result exceeds the quality threshold in the translation record;

[0016] Input the text to be translated into the target agent and obtain the target translation result, including:

[0017] Search in translation records based on the text to be translated;

[0018] If a matching translation record is retrieved, the preliminary translation result in the translation record is output as the target translation result;

[0019] Otherwise, the text to be translated is input into the target agent to obtain the target translation result.

[0020] In one embodiment, the translation method further comprises:

[0021] Output the preliminary translation results whose evaluation results are lower than the quality threshold to the proofreader, and add the corrected preliminary translation results to the iterative data set corresponding to the target agent;

[0022] The preliminary translation results whose evaluation results exceed the quality threshold are added to the iterative data set;

[0023] When the iteration conditions are met, the target agent is triggered to perform update iterations according to the iteration data set.

[0024] In one embodiment, the process of determining the original language includes:

[0025] Slide the text to be translated according to the set window width to obtain multiple text windows;

[0026] Perform language identification on each text window separately;

[0027] The language that appears most frequently in the recognition results is selected as the original language.

[0028] In one embodiment, after inputting the text to be translated into the target agent and obtaining the target translation result, the method further includes:

[0029] Obtain user feedback on target translation results;

[0030] Determine whether the feedback is a modification instruction;

[0031] If so, a modification prompt word is formed according to the modification instruction, and the modification prompt word is input into the target intelligent agent to obtain a modified target translation result.

[0032] In a second aspect, the present application provides a translation device, comprising:

[0033] The input module is used to obtain the text to be translated and determine the original language and the target language;

[0034] An agent selection module is used to call an adapted target agent from multiple candidate agents according to the original language and the target language;

[0035] The translation module is used to input the text to be translated into the target agent to obtain the target translation result.

[0036] In a third aspect, the present application provides a computer device comprising one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the translation method in any of the above embodiments are performed.

[0037] In a fourth aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the translation method in any of the above embodiments.

[0038] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0039] Based on the translation method in this embodiment, the text to be translated is first obtained, the original language and the target language are determined, and then the adapted target agent is called from multiple agents to be selected based on the two languages, and finally the text to be translated is input into the target agent to obtain the target translation result. Since the selected target agent is more compatible with the translation task, the target agent can translate more coherently and smoothly with its expertise and knowledge reserves, and obtain a translation result with more local characteristics. The solution also has a high degree of flexibility and scalability. It can quickly call different agents according to different translation needs, and can also adapt to new language pairs and translation scenarios by adding new agents, which enhances the overall practicality and reliability of the translation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 A flowchart of a translation method provided in one embodiment of the present application;

[0042] Figure 2 A schematic diagram of a process for obtaining a target translation result in one embodiment of the present application;

[0043] Figure 3 A schematic diagram of a process for obtaining an evaluation agent in one embodiment of the present application;

[0044] Figure 4 A schematic diagram of a process for selecting a target prompt word in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of a process of generating a new preferred prompt word similar to an original preferred prompt word in one embodiment of the present application;

[0046] Figure 6 A schematic diagram of a process for determining the original language in one embodiment of the present application;

[0047] Figure 7 A schematic diagram of a process of interacting with a user in one embodiment of the present application;

[0048] Figure 8 An internal structure diagram of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION

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

[0050] This application provides a translation method, see Figure 1 , including steps S102 to S106.

[0051] S102, obtaining the text to be translated, and determining the original language and the target language.

[0052] It can be understood that the text to be translated refers to the text content that needs to be converted into a language. Its source is wide, and it can come from documents, web pages, text after speech-to-text conversion, and other channels. This method is also applicable to the translation of subtitle documents. The original language is the language originally used in the text to be translated, and the target language is the language into which the text is expected to be translated. Determining the original language and the target language is the key basis for the correct execution of the subsequent translation process. This process ensures that the translation system can accurately call the adapted resources and models for translation operations. The target language can be determined during the interaction between the entire system and the user, such as when the user informs the system of the target language through a dialog box.

[0053] S104, calling an adapted target agent from a plurality of candidate agents according to the original language and the target language.

[0054] It can be understood that an agent is an entity in the field of artificial intelligence that has certain intelligent behaviors and interactive capabilities. In the translation system, each agent is endowed with specific language processing capabilities and can be optimized for different language pairs and translation scenarios. The candidate agents are pre-trained agents in the system with different translation capabilities, and the target agent is the agent that is selected from the candidate agents based on the original language and the target language and is the most suitable agent for performing the current translation task. The process of calling the target agent ensures that the translation task can be performed by the most suitable agent, thereby improving the accuracy and efficiency of the translation.

[0055] When maintaining and managing the agents in the system, the first label is configured for each agent according to the language pair it is applicable to. When matching, the language pair consisting of the target language and the original language can be matched with the first label of each agent. The label of the agent can also be set according to other attributes, such as setting a second label related to the scene in which the agent is good at, and a third label related to the profession in which the agent is good at. The special abilities of the agent are obtained by using different corpora during training. For example, for the short play scene translated from Chinese to Japanese, the agent is trained using a training set formed by the Chinese and Japanese translations of a large number of short play lines.

[0056] There can be multiple target agents, and each target agent can translate the fragments of the text to be translated separately, and then integrate them. Specifically, when there are multiple labels, you can first select the candidate agent with matching language ability according to the first label, and then find the candidate agent with other labels other than the first label that matches each sentence of the text to be translated as the target agent from these candidate agents, assign each sentence to the corresponding target agent for translation, and finally combine them according to the order of the sentences.

[0057] S106, inputting the text to be translated into the target intelligent agent to obtain a target translation result.

[0058] It can be understood that the target translation result is the translation text generated after being processed by the target agent, which is the final output of the translation task. As the core execution unit of the translation, the target agent contains a specific language model and translation algorithm, which is used to analyze, convert and generate the target language text for the input text to be translated.

[0059] Based on the translation method in this embodiment, the text to be translated is first obtained, the original language and the target language are determined, and then the adapted target agent is called from multiple agents to be selected based on the two languages, and finally the text to be translated is input into the target agent to obtain the target translation result. Since the selected target agent is more compatible with the translation task, the target agent can translate more coherently and smoothly with its expertise and knowledge reserves, and obtain a translation result with more local characteristics. The solution also has a high degree of flexibility and scalability. It can quickly call different agents according to different translation needs, and can also adapt to new language pairs and translation scenarios by adding new agents, which enhances the overall practicality and reliability of the translation system.

[0060] In one embodiment, the text to be translated is input into the target agent to obtain the target translation result. Figure 2 , including steps S202 to S208.

[0061] S202, input the text to be translated into the target agent to obtain a preliminary translation result.

[0062] It can be understood that the preliminary translation result is the translation result obtained before the target intelligent agent officially outputs it to the user, and is the basis for subsequent evaluation and optimization.

[0063] S204, obtaining evaluation annotations of the preliminary translation results. The evaluation annotations include evaluation results and evaluation reasons.

[0064] It can be understood that the evaluation annotation is the detailed information generated after a comprehensive quality assessment of the preliminary translation results, where the evaluation results are a quantitative or qualitative description of the quality of the preliminary translation results, usually expressed in the form of scores, grades, etc., which intuitively reflects the quality of the translation results. The evaluation reasons are a specific explanation of the evaluation results, pointing out in detail the problems in the preliminary translation results, such as grammatical errors, semantic deviations, inappropriate wording, and unsmooth expressions. These reasons provide a clear direction for subsequent translation optimization. The process of obtaining evaluation annotations can be done manually, but for efficiency reasons, a better solution is to evaluate based on machine learning. Specifically, it is to train an evaluation model or intelligent agent, take the preliminary translation results and the text to be translated as input, and output the evaluation results and evaluation reasons.

[0065] S206, if the evaluation result is lower than the quality threshold, the target agent is instructed to translate again according to the preliminary translation result and its corresponding evaluation annotation to obtain an updated preliminary translation result, and the process returns to the step of obtaining the evaluation annotation of the preliminary translation result to continue execution.

[0066] It can be understood that the quality threshold is a pre-set evaluation result standard, which is the dividing line for measuring whether the preliminary translation result is qualified. When the evaluation result is lower than this threshold, it means that the preliminary translation result has major quality problems and cannot meet actual needs, and needs to be re-translated. In this case, the target intelligent agent can interpret the information provided by the evaluation annotation with its own semantic understanding ability, correct the original translation process, and thus adjust and optimize the translation result of the target intelligent agent to obtain an updated preliminary translation result. After obtaining the updated preliminary translation result, it is necessary to return to step S204 and re-evaluate the preliminary translation result to determine whether it is still below the quality threshold. If so, it is necessary to continue to instruct the target intelligent agent to optimize the preliminary translation result.

[0067] S208: If the evaluation result exceeds the quality threshold, the preliminary translation result is used as the target translation result.

[0068] It can be understood that this step is the final decision of the entire translation process. The setting of the quality threshold is based on actual needs and application scenarios. When the evaluation result exceeds this threshold, it means that the quality of the translation result has reached an acceptable level. Therefore, the preliminary translation result is output as the target translation result to achieve high-quality completion of the translation task.

[0069] In one embodiment, obtaining the evaluation annotation of the preliminary translation result includes: inputting the preliminary translation result into an evaluation agent to obtain the evaluation annotation. The evaluation agent is an intelligent program specifically used to evaluate the quality of the translation result. It has the ability to analyze the translation text in multiple dimensions and can output the evaluation annotation including the evaluation result and the evaluation reason according to specific evaluation rules and models.

[0070] In one embodiment, the evaluation agent is obtained by the following process. Figure 3 , the process includes steps S302 to S308.

[0071] S302, obtaining a translation data set. The translation data set includes a plurality of translation samples and their corresponding first evaluation annotations, wherein the first evaluation annotations include evaluation results and evaluation reasons.

[0072] It can be understood that obtaining a translation dataset is to provide basic data for learning and evaluation in subsequent steps. By collecting a rich variety of translation samples and their corresponding evaluation annotations, the models involved in subsequent learning and evaluation can understand the pros and cons of different types of translations and the basis for judgment. Specifically, a translation dataset is a structured data set containing multilingual parallel corpora. Each translation sample includes the original text and the target text. For example, the translation of a sentence from English to Chinese, "The cat is on the mat" is translated as "The cat is on the mat". This pair of sentences is a translation sample. The first evaluation annotation contains the evaluation results of the translation sample and the evaluation reasons for the result. The evaluation results can be qualitative descriptions such as "excellent", "good", "average", "poor", or quantitative scores, such as values ​​between 0 and 10. The evaluation reasons elaborate on the basis for giving the evaluation results, such as considerations of grammatical accuracy, semantic completeness, and appropriate use of terminology.

[0073] The first evaluation annotation is usually done manually on the translation samples. In order to improve the annotation quality, each translation sample can be annotated by at least two different annotators. If the difference in the evaluation results exceeds the set conditions, the relevant multiple first evaluation annotations will be sent to another annotator for evaluation to obtain the final first evaluation annotation.

[0074] S304, generating training prompt words according to the translation data set, inputting the training prompt words into the target large model, and obtaining a plurality of candidate prompt words. The training prompt words are used to instruct the target large model to learn the evaluation method according to the translation data set, and to generate a plurality of candidate prompt words for instructing the target large model to evaluate the translation effect.

[0075] It can be understood that the target large model is an artificial intelligence model that has the ability to understand and process various natural language tasks after pre-training with massive data. The training prompt word is a text instruction specially designed to guide the target large model to learn specific tasks or knowledge. In this step, the training prompt word is used to instruct the target large model to learn the evaluation method based on the translation data set, and generate multiple candidate prompt words for instructing the target large model to evaluate the translation effect.

[0076] After receiving the training prompt words and the translation data set, the neural network structure inside the target large model will extract features and recognize patterns from the data. Guided by the training prompt words, the model attempts to summarize the rules and standards for evaluating translation effects from the translation data set, and then generates a series of candidate prompt words. The training prompt words can be instructions such as "analyze the relationship between translation samples and evaluation annotations in the translation data set, and generate multiple candidate prompt words for evaluating translation effects." The preprocessed translation data set and the training prompt words are input into the input layer of the target large model. The model processes the data in its internal multi-layer neural network through the forward propagation process, and finally generates multiple candidate prompt words at the output layer.

[0077] S306: Input the candidate prompt words and the translation samples into the target large model to obtain second evaluation annotations, obtain the first quality score corresponding to each second evaluation annotation, and obtain the target prompt word according to the first quality score.

[0078] It can be understood that the second evaluation annotation is the annotation result generated by the target large model after receiving the candidate prompt word and the translation sample, and evaluating the translation sample according to the evaluation method indicated by the candidate prompt word. The first quality score is a quantitative indicator used to measure the quality of the second evaluation annotation, which reflects the degree of closeness between the evaluation made by the target large model based on the candidate prompt word and the actual situation.

[0079] After receiving the candidate prompt words and the translation sample, the target large model analyzes and judges the translation sample according to the evaluation rules and standards set by the candidate prompt words, thereby generating a second evaluation annotation. For example, if the candidate prompt words require the model to evaluate the translation sample from aspects such as grammar, semantics, and terminology usage, the model will check these aspects of the translation sample and give corresponding evaluation annotations. Then, by evaluating the results obtained by the model, the quality of the prompt words used can be measured. The first quality score can be obtained by calculating the similarity between the second evaluation annotation and the first evaluation annotation. It can also be that the annotation personnel directly score the second evaluation standard.

[0080] The process of obtaining the target prompt word according to the first quality score is actually a process of screening and optimizing the candidate prompt words, and selecting the target prompt word that can enable the model to generate more accurate evaluation annotations based on multiple candidate prompt words. Specifically, it can be directly selecting the highest score as the target prompt word according to the first quality score. However, it can also be using the candidate prompt words to further generate more approximate samples, and further selecting the best from the best.

[0081] S308, solidify the target prompt word and the target large model to obtain an evaluation intelligent agent.

[0082] It can be understood that the target prompt words are solidified in the target large model, which essentially allows the target large model to always perform evaluation operations based on these specific prompt words when encountering problems with translation effect evaluation during operation. Specifically, the system prompt of the target large model can be set to the target prompt words. After the target prompt words are solidified in the target large model, it is equivalent to converting the target large model into an intelligent entity that can stably perform translation effect evaluation, and provide users with translation effect evaluation services in a long-term, efficient and accurate manner.

[0083] In one embodiment, the target prompt word is obtained according to the first quality score, see Figure 4 , including steps S402 to S406.

[0084] S402: Screen multiple candidate prompt words according to the first quality score to obtain multiple preferred prompt words.

[0085] It can be understood that this step is intended to conduct preliminary screening and identification of numerous candidate prompt words through the quantitative index of the first quality score. Since the first quality score intuitively reflects the effectiveness of the candidate prompt word guiding the model evaluation, a higher score means that the candidate prompt word can enable the model to generate a result closer to the real evaluation. Based on this, a certain number of candidate prompt words can be directly selected as preferred prompt words in the order of the first quality score from high to low. Its core purpose is to narrow the scope of subsequent evaluation, focus on those candidate prompt words that show the potential of guiding the model to accurately translate and evaluate in the preliminary evaluation, lay the foundation for further in-depth evaluation in the future, and improve the efficiency and pertinence of the entire screening process. It can also be to set a scoring threshold, select the candidate prompt words above the threshold, and form a preferred prompt word set. The scoring threshold here can be dynamically adjusted, specifically, it can be the discrete degree of calculating the first quality score, and the higher the discrete degree, the lower the corresponding scoring threshold. In this way, more candidate prompt words with potential value can be included when the scoring distribution is relatively dispersed, and will not be mistakenly omitted due to unreasonable threshold setting.

[0086] S404: Input the preferred prompt words and the translation samples into the target macro model to obtain a third evaluation annotation.

[0087] It can be understood that the translation sample here can be a sample extracted from the translation data set, and the third evaluation annotation is the result annotation output by the target large model after receiving the preferred prompt word and the translation sample, and re-evaluating the translation sample according to the evaluation rules and standards specified by the preferred prompt word. This step is to further verify and explore the ability of these preferred prompt words to guide the target large model to perform translation evaluation on the basis of screening out the preferred prompt words.

[0088] S406: Obtain the second quality scores corresponding to the third evaluation annotations, and select the preferred prompt word with the highest second quality score as the target prompt word.

[0089] It can be understood that the second quality score is a quantitative indicator introduced to further measure the quality of the third evaluation annotation generated by the target large model based on the preferred prompt word. This score is similar to the first quality score, but focuses on the result evaluation after a round of screening and re-evaluation. By calculating the second quality score corresponding to each third evaluation annotation, it is possible to clearly understand the actual performance of each preferred prompt word in guiding the target large model to perform translation evaluation. A higher second quality score means that the preferred prompt word can enable the target large model to generate a third evaluation annotation that is highly consistent with the real evaluation annotation, that is, the preferred prompt word has stronger ability and accuracy in guiding the model to evaluate the translation effect. Selecting the highest second quality score as the target prompt word among many preferred prompt words is based on the consideration of pursuing the best evaluation effect, ensuring that the final target prompt word can guide the target large model to the greatest extent when evaluating the subsequent translation to be evaluated, output the most accurate and reliable evaluation results, and optimize the performance of the entire translation evaluation system.

[0090] In one embodiment, before inputting the preferred prompt word and the translation sample into the target large model to obtain the third evaluation annotation, refer to Figure 5 , also includes steps S502 to S508.

[0091] S502: For any selected preferred prompt word, use the preferred prompt word as a root node.

[0092] It can be understood that this embodiment is to use the originally selected preferred prompt words to further generate a batch of similar preferred prompt words to select better target prompt words. For an original preferred prompt word, taking it as the root node means building a tree structure for exploring and optimizing prompt words with it as the starting point, and all subsequent node traversals, mutation operations, etc. are derived from this node.

[0093] S504, traversing from the root node, if the current node does not have a first number of child nodes, performing a first number of mutation operations on the current node, and using the results of the mutation operations as child nodes of the current node.

[0094] It can be understood that the first number is a pre-set key parameter, and its value is determined comprehensively based on the complexity of the actual evaluation task, the diversity of candidate prompt words, and computing resources. Node traversal is a common method in tree structure operation. Starting from the root node, the nodes in the tree are accessed in a certain order (such as breadth first or depth first). If the current result traversed does not have the first number of child nodes, it means that the child node has not yet branched out, and a mutation operation needs to be performed on it to generate a prompt word that is similar to but different from the current node. The mutation operation is carried out on the current node, and the text content of the prompt word is modified by natural language processing means such as adjusting the word order, replacing synonyms, and adding or removing specific words to generate new prompt word forms, which become the child nodes of the current node. This process is similar to performing a local search in the search space. By mutating the existing prompt words, more possible prompt word forms are explored in the hope of finding a better prompt word to guide the evaluation of the target large model.

[0095] S506, otherwise, select the target child node according to the exploration weight corresponding to each child node, and update the cumulative reward values ​​of all nodes along the path from the target child node to the root node according to the third quality score corresponding to the target child node, and return to the step of traversal starting from the root node to continue execution until the loop end condition is met.

[0096] It can be understood that the exploration weight sets a value for each child node, which is used to characterize the possibility of the child node being selected during the exploration process. The target child node is selected from multiple child nodes according to the exploration weight of the child node. The third quality score is used to measure the quality performance of the target child node in the translation evaluation task. This score is similar to the first quality score, but focuses on the performance of the new preferred prompt word generated based on the preferred prompt word. The cumulative reward value has a corresponding record on each node, reflecting the comprehensive performance of each node in the entire exploration process. The cumulative reward value of each child node is updated based on the root node. If the mutation operation causes the third quality score to decrease, the cumulative reward value of the child node will also decrease based on the parent node, and vice versa. The magnitude of the increase and decrease is determined by the difference between the third quality scores of the child node and the parent node. The greater the difference, the greater the magnitude. For other nodes on its path, as the child node is traced back to the root node, the update amplitude of the cumulative reward value will gradually decay for each node passed. The exploration weight can be dynamically changed based on the number of times the node has been traversed, the cumulative reward value of the node, etc. This exploration weight setting method can encourage the exploration of paths with higher reward values. The loop end conditions are pre-set, and may include reaching a preset number of traversals, the cumulative reward value converging to a certain range, the number of new prompt words generated meeting the requirements, etc. Specifically, it may be when the depth of any branch reaches the preset maximum exploration depth, or when the cumulative reward value growth rate in the current iteration cycle is less than the convergence threshold.

[0097] S508: Use the second number of nodes with the highest cumulative reward values ​​as newly generated preferred prompt words.

[0098] It is understandable that the second quantity is a preset value, which can be determined according to the demand for the number of new preferred prompt words in the actual application scenario. The cumulative reward value is constantly updated in the previous steps, reflecting the comprehensive performance of the prompt word form represented by the node in the whole exploration process. A higher cumulative reward value means that the prompt word form represented by the node has better potential in guiding the model to perform translation evaluation. In this step, the second number of nodes with the highest cumulative reward value are selected from all nodes, and the prompt words stored by these nodes are used as the newly generated preferred prompt words. For example, if the second quantity is set to 3, the nodes with the top three cumulative reward values ​​are selected, and the prompt words corresponding to them are used as new preferred prompt words, which are used for subsequent guiding target large models to perform translation evaluation, and it is expected that these new preferred prompt words can enable the model to generate more accurate and high-quality evaluation results.

[0099] In one embodiment, the mutation operation includes at least one of sentence reorganization, synonym replacement, and adding format-qualifying phrases. Sentence reorganization is to rearrange the grammatical structure of the prompt word text, for example, adjusting "evaluate the translation from the aspects of grammar, semantics and terminology accuracy" to "evaluate the translation from the aspects of terminology accuracy, grammar and semantics". Synonym replacement is to replace some words in the prompt word with other words with similar meanings, such as replacing "evaluate" with "evaluate". Adding format-qualifying phrases is to add descriptive phrases with specific format requirements to the prompt word, such as adding format-qualifying content such as "check according to the subject-verb-object structure" to the prompt word, so as to generate new prompt word forms, and these new forms serve as child nodes of the current node.

[0100] In one embodiment, the translation method further includes: storing the preliminary translation results whose evaluation results exceed the quality threshold in a translation record. The translation record is a database or data set that stores completed translation results that meet the quality standards, which includes the text to be translated and its corresponding translation results, to facilitate subsequent retrieval and reuse.

[0101] Inputting the text to be translated into the target intelligent agent to obtain the target translation result includes: searching in the translation record according to the text to be translated. If a matching translation record is retrieved, the preliminary translation result in the translation record is output as the target translation result. Otherwise, inputting the text to be translated into the target intelligent agent to obtain the target translation result.

[0102] It can be understood that retrieval refers to the operation of searching for records that match the text to be translated in the translation records. This step is to improve translation efficiency by using existing translation records. By retrieving the text to be translated in the translation records, the system can quickly determine whether there are already identical or similar translation results available for reuse. If a matching record is retrieved, the translation result in the record can be used directly, avoiding the process of re-calling the target agent for translation, thereby saving computing resources and time. The matching method can be an exact match or a fuzzy match based on semantic similarity. The previous text to be translated can be used as a key, and the preliminary translation result in the corresponding preliminary translation result with an evaluation result greater than the quality threshold can be used as a value. When performing an exact match, the query statement is directly written, and the WHERE clause is used in the translation record to match the "text to be translated" field. For fuzzy retrieval, some text processing tool libraries, such as the difflib library in Python, can be used to calculate text similarity to achieve it, and it is considered a match when the text similarity is greater than a certain threshold.

[0103] When a record matching the text to be translated is retrieved from the translation record, it means that similar texts have been processed before, and their translation results have been evaluated and met the quality requirements. Since the translation results in the translation record have met the quality requirements, direct output can save the time and computing resources required for translation. By reusing the results in the translation record, the platform can respond quickly and improve the user experience.

[0104] In one of the embodiments, before inputting the text to be translated into the target intelligent agent, it is also possible to determine whether there are proper nouns in the text to be translated, search the term library according to the contextual semantics, and input the retrieved term translation results into the target intelligent agent as suggestion information to assist the target intelligent agent in translating professional terms.

[0105] In one embodiment, the translation method further includes: outputting the preliminary translation results whose evaluation results are lower than the quality threshold to the proofreading end, and adding the revised preliminary translation results to the iteration data set corresponding to the target agent. Adding the preliminary translation results whose evaluation results exceed the quality threshold to the iteration data set. When the iteration condition is met, triggering the target agent to update and iterate according to the iteration data set.

[0106] It can be understood that the proofreading end is a special working interface or platform, usually used by professional translators or proofreaders to manually check and correct the translation results. When the evaluation result of the preliminary translation result is lower than the quality threshold, it indicates that the translation result has many problems and is difficult to use directly. Outputting it to the proofreading end and using manual professional knowledge and language skills to proofread and correct the translation can effectively improve the translation quality, so that the intelligent agent can be iteratively updated with high-quality corpus in the future.

[0107] The iterative dataset is a data set used for updating and iterating the target agent. It contains a large amount of text data and its corresponding correct translation, and is the basis for the target agent to learn and improve. The corrected preliminary translation results are added to the iterative dataset so that the target agent can learn more accurate translation knowledge. These corrected results represent the correct translation after manual proofreading, and contain richer language information and translation skills. In the subsequent iterations, the target agent can continuously adjust its own parameters and model structure to improve the accuracy and quality of translation by learning from these data. This is a process of continuous improvement. By continuously accumulating and utilizing high-quality translation data, the performance of the target agent will be gradually improved.

[0108] In addition, preliminary translation results that meet the quality requirements will also be added to the iterative dataset, allowing the target agent to consolidate its existing translation knowledge and learn more excellent translation expressions. These high-quality translation data can serve as positive examples for the target agent to learn, helping it to output results more stably and accurately in subsequent translation tasks. In addition, as language continues to develop and change, new expressions and vocabulary continue to emerge. Including these high-quality translation results in the iterative dataset will help the target agent keep up with language changes and maintain good translation performance.

[0109] Iteration conditions are pre-set rules for determining whether the target agent needs to be updated and iterated. These conditions can be set based on factors such as time, data volume, and changes in translation quality. When these conditions are met, the target agent will be triggered to update and iterate according to the iterative data set, that is, the model parameters of the target agent will be adjusted and optimized so that it can better adapt to new translation tasks. The translation ability of the target agent is not static. As new translation data accumulates and the language environment changes, it needs to be updated and iterated. The iterative data set contains a large amount of high-quality translation data. By allowing the target agent to learn these data, its internal model structure and parameters can be continuously optimized to improve the accuracy and quality of translation. Specifically, when iterating, if there is a limit on the amount of data used for the iteration, the evaluation results of all preliminary translation results can be recorded (for the revised preliminary translation results, the evaluation results of the version before the revision should be recorded), and the iterative data set can be screened in the order of evaluation results from low to high.

[0110] In one embodiment, see Figure 6 The process of determining the original language includes steps S602 to S606.

[0111] S602, sliding on the text to be translated according to the set window width to obtain multiple text windows.

[0112] It can be understood that the set window width is a predetermined value, which represents the length of the text segment selected when sliding on the text to be translated. The text window is a continuous text segment obtained by sliding on the text to be translated with the set window width as the length. This embodiment is to prevent the original language recognition error caused by the situation that the sample to be translated contains multiple languages.

[0113] S604: Perform language recognition on each text window.

[0114] It can be understood that language identification refers to the process of determining which natural language a given text belongs to through specific algorithms and technologies. For each text window, language identification needs to be performed independently to determine the language it most likely belongs to. The language identification here can use a mature language identification algorithm.

[0115] S606: Select the language that appears most frequently in the recognition results as the original language.

[0116] It can be understood that the recognition result refers to the language identification obtained after language recognition for each text window. After language recognition for multiple text windows, the language that appears most often is likely to be the main language used in the entire text to be translated. Because most of the local content in the text should be consistent with the overall language, even if there are a small number of other language references or interference, these interference factors can be effectively eliminated by counting the majority of results, and the original language can be determined more accurately.

[0117] In one embodiment, see Figure 7 After the text to be translated is input into the target intelligent agent and the target translation result is obtained, it also includes steps S702 to S706.

[0118] S702: Obtain user feedback on the target translation result.

[0119] It can be understood that user feedback refers to the opinions, evaluations or suggestions made by users of the translation results based on their own needs, professional knowledge or actual application scenarios. Feedback can be in various forms, including but not limited to text descriptions, ratings, etc. In the translation system, although the translation ability of the target agent is constantly improving, due to the complexity and diversity of the language, as well as the personalized needs of different users, the translation results may not fully meet the expectations of all users. Obtaining user feedback can allow the system to understand the problems and shortcomings of the translation results, and provide a basis for subsequent improvements.

[0120] S704, determining whether the feedback is a modification instruction.

[0121] It can be understood that modification instructions are specific requirements in user feedback that clearly indicate the need to modify the target translation result. It can be a modification suggestion for a certain vocabulary, sentence structure, grammatical error or semantic expression. Determine whether feedback is not all user feedback is a modification instruction. Some feedback is used to continue interacting with the intelligent system and does not involve modification of the target translation result. By determining whether the feedback is a modification instruction, user feedback can be classified and processed to improve the processing efficiency of the system. If it is a modification instruction, the system can directly enter the modification process.

[0122] S706: If yes, compose a modification prompt word according to the modification instruction, input the modification prompt word into the target intelligent agent, and obtain a modified target translation result.

[0123] It can be understood that the modification prompt words are generated based on the user's modification instructions, and are prompt information used to guide the target agent to modify the target translation result. When it is determined that user feedback belongs to modification instructions, these instructions need to be converted into inputs that the target agent can process. By forming modification prompt words, the target agent is clearly informed of the specific content and direction that needs to be modified. The target agent analyzes and adjusts the original target translation result based on the modification prompt words, and uses its own language model and algorithm to generate a translation result that better meets user needs. This process realizes the interaction between the user and the target agent, allowing the translation result to be dynamically optimized based on user feedback.

[0124] The present application provides a translation device, including an input module, an agent selection module and a translation module. The input module is used to obtain a text to be translated and determine the original language and the target language. The agent selection module is used to call an adapted target agent from a plurality of candidate agents according to the original language and the target language. The translation module is used to input the text to be translated into the target agent to obtain a target translation result.

[0125] For the specific definition of the translation device, please refer to the definition of the translation method above, which will not be repeated here. The various modules in the above-mentioned melody generation device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0126] The present application provides a computer device, including one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the translation method in any of the above embodiments are executed.

[0127] Indicatively, if Figure 8 As shown, Figure 8 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. Figure 8 The computer device 800 includes a processing component 802, which further includes one or more processors, and a memory resource represented by a memory 801, for storing instructions executable by the processing component 802, such as an application. The application stored in the memory 801 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 802 is configured to execute instructions to perform the steps of the translation method of any of the above embodiments.

[0128] The computer device 800 may further include a power supply component 803 configured to perform power management of the computer device 800 , a wired or wireless model interface 804 configured to connect the computer device 800 to the model, and an input / output (I / O) interface 805 .

[0129] The present application provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the translation method in any of the above embodiments.

[0130] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0131] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0132] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A translation method, characterized in that: include: Obtain the text to be translated and determine the original language and target language; Calling an adapted target agent from a plurality of candidate agents according to the original language and the target language; The text to be translated is input into the target agent to obtain a target translation result.

2. The translation method according to claim 1, characterized in that: The step of inputting the text to be translated into the target agent to obtain a target translation result includes: Inputting the text to be translated into the target agent to obtain a preliminary translation result; Obtaining evaluation annotations of the preliminary translation results; the evaluation annotations include evaluation results and evaluation reasons; If the evaluation result is lower than the quality threshold, the target agent is instructed to translate again according to the preliminary translation result and the corresponding evaluation annotation to obtain an updated preliminary translation result, and the step of obtaining the evaluation annotation of the preliminary translation result is returned to continue execution; If the evaluation result exceeds the quality threshold, the preliminary translation result is used as the target translation result.

3. The translation method according to claim 2, characterized in that: The obtaining of the evaluation annotation of the preliminary translation result includes: The preliminary translation result is input into the evaluation agent to obtain the evaluation annotation.

4. The translation method according to claim 2, characterized in that: Also includes: storing the preliminary translation result whose evaluation result exceeds the quality threshold in a translation record; The step of inputting the text to be translated into the target agent to obtain a target translation result includes: Searching the translation records according to the text to be translated; If a matching translation record is retrieved, the preliminary translation result in the translation record is output as the target translation result; Otherwise, the text to be translated is input into the target agent to obtain the target translation result.

5. The translation method according to claim 2, characterized in that: Also includes: Outputting the preliminary translation result whose evaluation result is lower than the quality threshold to the proofreading end, and adding the corrected preliminary translation result to the iterative data set corresponding to the target intelligent agent; adding the preliminary translation results whose evaluation results exceed the quality threshold to the iterative data set; When the iteration condition is met, the target agent is triggered to perform update iteration according to the iteration data set.

6. The translation method according to claim 1, characterized in that: The process of determining the original language includes: Slide the text to be translated according to the set window width to obtain multiple text windows; Performing language identification on each of the text windows respectively; The language that appears most frequently in the recognition results is selected as the original language.

7. The translation method according to claim 1, characterized in that: After inputting the text to be translated into the target agent and obtaining the target translation result, the method further includes: Obtaining user feedback on the target translation result; Determining whether the feedback is a modification instruction; If so, a modification prompt word is formed according to the modification instruction, and the modification prompt word is input into the target intelligent agent to obtain the modified target translation result.

8. A translation device, characterized in that: include: The input module is used to obtain the text to be translated and determine the original language and the target language; An agent selection module, used to call an adapted target agent from a plurality of candidate agents according to the original language and the target language; The translation module is used to input the text to be translated into the target agent to obtain a target translation result.

9. A computer device, characterized in that: The method comprises one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the translation method according to any one of claims 1 to 7 are executed.

10. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the translation method according to any one of claims 1 to 7.