Translation method and translation model optimization method and device
By optimizing the machine translation model using user feedback data, the problem of inconsistency between training data and application scenarios was solved, improving translation quality and user experience, and enabling continuous model optimization and efficient data collection.
Patent Information
- Application Number
- CN202310361912.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
When the training data of a machine translation model is inconsistent with the data distribution of the actual application scenario, the translation performance will decline, and there is a lack of effective performance evaluation and optimization methods, which will affect the user experience.
By guiding users to actively provide feedback on translation results, collecting user ranking, selection, and modification data, adjusting the parameters of the translation model, and combining generation loss and ranking loss functions to optimize the model, a multi-task learning framework is formed to alleviate the exposure bias problem.
It improves the performance and user experience of the translation model, enables continuous model optimization and efficient data collection, and reduces reliance on annotation personnel.
Smart Images

Figure CN118734868A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a translation method, a translation model optimization method and a translation model optimization device. Background Art
[0002] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is also the study of the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.
[0003] Machine translation is an important direction of natural language processing. With the continuous development of deep learning, the quality of machine translation has been improved and it is widely used in various scenarios, such as translating web pages, translating applications (applications, apps) or input method translation. Machine translation models are usually trained based on training data, and the data distribution of training data may not be consistent with the data distribution in actual application scenarios. In this case, the machine translation model may not achieve the expected performance. If the translation result is poor, it will affect the user experience. Summary of the invention
[0004] The present application provides a translation method, a translation model optimization method and a device, which can guide users to actively provide feedback on translation results, and adjust the next displayed translation result according to user portraits, application scenarios, and user feedback data. At the same time, user feedback data is also conducive to training and improving the performance of the translation model.
[0005] In a first aspect, a translation method is provided, comprising: receiving a first input operation of a first user; in response to the first input operation, displaying a first translation result, a first option, and a second option; wherein the first option comprises the first translation result and a first control, the second option comprises the second translation result and a second control, and the first translation result and the second translation result are different; the first control is used to prompt the first user to change the order of the first translation result, and the second control is used to prompt the first user to change the order of the second translation result.
[0006] In the embodiment of the present application, there is no need for the user to find the feedback entrance by himself, and the feedback prompt is displayed on the interface, and the user is actively guided to give feedback, which can improve the possibility of the user giving feedback, thereby realizing the efficient collection of the data of the user feedback, and improving the data volume of the collected user feedback. After the user inputs the content to be translated, multiple translation results can be displayed on the interface, and the user is prompted to sort the multiple translation results, which is conducive to obtaining the user's sorting feedback result. The user's sorting feedback result can be used for subsequent optimization of the translation result, thereby improving the user experience. For example, the user's sorting feedback result can be used as training data for subsequent fine-tuning of the translation model, thereby realizing the continuous optimization of the translation model performance, and improving the translation quality of the translation model. For example, the first input operation can be the input operation of the first user to the content to be translated. The first translation result and the second translation result are two translation results of the content to be translated.
[0007] In combination with the first aspect, in some implementations of the first aspect, the method further includes: in response to an operation performed by the first user on the second control, replacing display positions of the first translation result and the second translation result.
[0008] For example, the operation of the first user on the second control may be a click operation of the first user on the second control. Replacing the display positions of the first translation result and the second translation result may include changing the first translation result originally displayed at the first position to be displayed at the second position, where the second position is the position where the second translation result was originally displayed; accordingly, after receiving the click operation of the first user on the second control, the second translation result is displayed at the first position. Optionally, the positions of the first control and the second control may remain unchanged, or may be replaced according to the translation results.
[0009] In combination with the first aspect, in certain implementations of the first aspect, in response to a first input operation, displaying a first translation result, a first option, and a second option includes: in response to the first input operation, displaying the first translation result, the first option, the second option, and first prompt information, the first prompt information being used to prompt the first user to change the order of the first translation result or the second translation result.
[0010] For example, the first prompt information may be to inform the user that clicking the first control or the second control can change the order of the translation results, thereby helping the user understand the functions of the first option and the second option and guiding the user to more actively order the multiple translation results.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: receiving a second input operation of the first user, the content to be translated input by the second input operation is different from the content to be translated input by the first input operation; in response to the second input operation, displaying a third translation result, a third option, and a fourth option; wherein the third option includes a third translation result and a third control, the fourth option includes a fourth translation result and a fourth control, and the third translation result and the fourth translation result are different; the third control is used to prompt the first user to select the third translation result, and the fourth control is used to prompt the first user to select the fourth translation result.
[0012] In the solution of the embodiment of the present application, after receiving the user's input operation, multiple translation results can be displayed on the interface, and the user can be prompted to select a suitable translation result from them. This is conducive to obtaining the user's selection feedback result.
[0013] In addition, when the content to be translated is different, different feedback prompts can be provided to the user, guiding the user to provide feedback in different feedback modes. For example, after receiving the first input operation of the first user, the user is prompted to sort multiple translation results, and after receiving the second input operation of the first user, the user is prompted to select multiple translation results. In this way, it is helpful to further increase the possibility of users providing feedback on the translation results, thereby further increasing the amount of data collected from user feedback.
[0014] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: receiving a third input operation of the first user, the content to be translated input by the third input operation being different from the content to be translated input by the first input operation; in response to the third input operation, displaying a fifth translation result and a first edit box; wherein the first edit box is used to prompt the first user to modify the fifth translation result.
[0015] In the solution of the embodiment of the present application, after receiving the user's input operation, a translation result can be displayed on the interface, and the user can be prompted to modify the translation result. This is conducive to obtaining the user's modification feedback result.
[0016] In addition, when the content to be translated is different, different feedback prompts can be provided to the user, guiding the user to provide feedback in different ways. For example, after receiving the first input operation of the first user, the user is prompted to sort the multiple translation results, and after receiving the third input operation of the first user, the user is prompted to modify the translation result. In this way, it is helpful to further increase the possibility of users providing feedback on the translation results, thereby further increasing the amount of data collected from user feedback.
[0017] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: receiving a fourth input operation of the second user, the login accounts of the first user and the second user are different; in response to the fourth input operation, displaying the sixth translation result, the fifth option and the sixth option; wherein the fifth option includes the sixth translation result and the fifth control, the sixth option includes the seventh translation result and the sixth control, and the sixth translation result and the seventh translation result are different; the fifth control is used to prompt the second user to select the sixth translation result, and the sixth control is used to prompt the second user to select the seventh translation result.
[0018] The content to be translated inputted by the fourth input operation may be the same as or different from the content to be translated inputted by the first input operation.
[0019] In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different users, guiding different users to use different feedback methods for feedback. For example, after receiving the first input operation of the first user, the first user is prompted to sort multiple translation results, and after receiving the fourth input operation of the second user, the second user is prompted to select multiple translation results. This is conducive to further improving the possibility of users giving feedback on translation results, thereby further improving the amount of data collected from user feedback.
[0020] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: receiving a fifth input operation from a third user, the login accounts of the first user and the third user are different; in response to the fifth input operation, displaying an eighth translation result and a second edit box; wherein the second edit box is used to prompt the third user to modify the eighth translation result.
[0021] The content to be translated inputted by the fifth input operation may be the same as or different from the content to be translated inputted by the first input operation.
[0022] In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different users, guiding different users to provide feedback in different feedback modes. For example, after receiving the first input operation of the first user, the first user is prompted to sort multiple translation results, and after receiving the fifth input operation of the third user, the third user is prompted to modify the translation result. In this way, it is conducive to further improving the possibility of users providing feedback on the translation results, thereby further improving the data volume of the collected user feedback.
[0023] In combination with the first aspect, in certain implementations of the first aspect, before receiving a first input operation of a first user, the method further includes: displaying a first interface, the first interface including a first input box, and the first input operation is an operation performed by the first user on the first input box.
[0024] In combination with the first aspect, in certain implementations of the first aspect, after displaying the first translation result, the first option, and the second option, the method also includes: displaying a second interface, the second interface including a second input box, a third input box, and a first input method; receiving a sixth input operation of the first user, the sixth input operation being an operation performed by the first user on the second input box; in response to the sixth input operation, displaying a ninth translation result and a second prompt message, the ninth translation result being located in the third input box, and the second prompt message being used to prompt the first user to modify the ninth translation result.
[0025] The content to be translated input by the first input operation and the content to be translated input by the sixth input operation may be the same or different.
[0026] The first interface and the second interface are interfaces under different application scenarios. For example, the first interface is a translation interface in a browser or translation application, which provides input of content to be translated and display of translation results; the second interface is a message input interface in an instant messaging application, and the translation function is provided by the input method, and the input of content to be translated and display of translation results are provided when the user inputs a message. In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different application scenarios to guide users to use different feedback methods for feedback. For example, in the first interface, after receiving the first input operation of the first user, the user is prompted to sort multiple translation results, and in the second interface, after receiving the sixth input operation of the first user, the user is prompted to modify the translation results, because in the process of the first user inputting a message to communicate with other users, the first user has higher requirements for the quality of translation and is more willing to actively modify the translation results. In this way, it is conducive to further improving the possibility of users giving feedback on the translation results, thereby further improving the amount of data collected from user feedback.
[0027] In combination with the first aspect, in certain implementations of the first aspect, the method also includes: receiving an operation performed by the first user on the second control; receiving a seventh input operation by the first user, wherein the content to be translated input by the seventh input operation is the same as the content to be translated input by the first input operation; and displaying a second translation result in response to the seventh input operation.
[0028] After obtaining the sorting results of the first user's multiple translation results for the content to be translated, when the first user inputs the content to be translated again, the related content can be displayed based on the sorting results of the first user. The user operates the second control so that the position of the second translation result is exchanged with the position of the first translation result, and when the user inputs the content to be translated again, the second translation result can be displayed. In this way, adjusting the displayed translation results based on the user's sorting results is conducive to improving the user experience.
[0029] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: receiving an eighth input operation of a fourth user, the login accounts of the fourth user and the first user are different; in response to the eighth input operation, displaying the tenth translation result, the seventh option and the eighth option; wherein the seventh option includes the tenth translation result and the seventh control, the eighth option includes the eleventh translation result and the eighth control, and the tenth translation result and the eleventh translation result are different; the seventh control is used to prompt the fourth user to change the sorting of the tenth translation result, and the eighth control is used to prompt the fourth user to change the sorting of the eleventh translation result; receiving an operation of the fourth user acting on the eighth control; receiving a ninth input operation of the fourth user, the content to be translated input by the ninth input operation is the same as the content to be translated input by the eighth input operation; in response to the ninth input operation, displaying the tenth translation result.
[0030] In combination with the first aspect, in some implementations of the first aspect, the method also includes: receiving a tenth input operation of the first user, the content to be translated input by the tenth input operation is different from the content to be translated input by the first input operation; in response to the tenth input operation, displaying the twelfth translation result, the ninth option and the tenth option; wherein the ninth option includes the twelfth translation result and the ninth control, the tenth option includes the thirteenth translation result and the tenth control, and the twelfth translation result and the thirteenth translation result are different; the ninth control is used to prompt the first user to change the sorting of the twelfth translation result, and the tenth control is used to prompt the first user to change the sorting of the thirteenth translation result; receiving an operation of the first user acting on the tenth control; receiving an eleventh input operation of the first user, the content to be translated input by the eleventh input operation is the same as the content to be translated input by the tenth input operation; in response to the eleventh input operation, displaying the twelfth translation result.
[0031] In a second aspect, a method for optimizing a translation model is provided, comprising: obtaining at least one training data, the training data comprising a source sequence, a reference translation result of the source sequence, and a reference ranking of multiple candidate translation results of the source sequence; inputting the source sequence and the multiple candidate translation results into an initial translation model for processing to obtain a first predicted translation result of the source sequence and predicted probabilities of the multiple candidate translation results; adjusting parameters of the initial translation model with the goal of reducing a function value of a loss function, the loss function being based on a first loss function and a second loss function, the first loss function being used to indicate a difference between a first predicted translation result and a reference translation result, the second loss function being used to indicate a difference between a reference ranking and a predicted ranking of multiple candidate translation results, the predicted ranking of the multiple candidate translation results being obtained based on the predicted probabilities of the multiple candidate translation results.
[0032] In an embodiment of the present application, the loss function is based on a generation loss function and a ranking loss function, and the ranking loss function is conducive to ensuring that the model learns an evaluation method for translation quality during the fine-tuning stage, and the generation loss function is conducive to ensuring the translation ability of the model. The target translation model obtained after such adjustment can be used as a generation model and an evaluation model at the same time, for generating multiple predicted translation results, and scoring multiple predicted translation results, and the scoring can be determined based on the prediction probability of the multiple predicted translation results. The model can select some or all of the predicted translation results from the multiple predicted translation results based on the scores of the multiple predicted translation results. At the same time, the ranking loss is used together with the generation loss function to adjust the model parameters to form a multi-task learning framework, which prompts the model to be biased towards a non-fixed target distribution training method, which is conducive to alleviating the exposure bias problem, thereby improving the performance of the model.
[0033] Exemplarily, the multiple candidate translation results may be multiple predicted translation results obtained by inputting the source sequence into the initial translation model for processing in advance.
[0034] Exemplarily, the multiple candidate translation results may be multiple predicted translation results obtained by inputting the source sequence into other translation models other than the initial translation model for processing.
[0035] In conjunction with the second aspect, in certain implementations of the second aspect, the reference ranking of the plurality of candidate translation results is obtained based on a ranking result of the plurality of candidate translation results ranked by a user.
[0036] In combination with the second aspect, in certain implementations of the second aspect, a reference ranking of the plurality of candidate translation results is obtained based on reference probabilities of the plurality of candidate translation results, and a reference probability of a selection result selected by a user from the plurality of candidate translation results is higher than a reference probability of other candidate translation results among the plurality of candidate translation results except the selection result.
[0037] In the solution of the embodiment of the present application, the user's feedback data can be used as training data. For example, the user's ranking results and feedback results can be used as training data. In this way, the model can be continuously adjusted based on the user's feedback data, and the problem of mismatch between the training data and the data distribution in the application scenario can be gradually corrected, thereby achieving continuous optimization of the model, improving the translation quality, and thus improving the user experience. This solution is adapted to the existing model framework. At the same time, the user's ranking results and feedback results can be used as training data, which is conducive to reducing the dependence on annotation personnel.
[0038] In conjunction with the second aspect, in certain implementations of the second aspect, the reference ranking of the plurality of candidate translation results is determined based on similarities or differences between the plurality of candidate translation results and the reference translation result.
[0039] For example, the reference ranking of the plurality of candidate translation results may be determined based on BLEU scores between the plurality of candidate translation results and a reference translation result.
[0040] In conjunction with the second aspect, in certain implementations of the second aspect, the predicted probability of the candidate translation result is determined according to the probability of a word in the candidate translation result output by the initial translation model.
[0041] Exemplarily, the predicted probability of the candidate translation result can be calculated by taking the logarithmic sum of the probabilities of the words output by the initial translation model and then performing length normalization.
[0042] In conjunction with the second aspect, in certain implementations of the second aspect, the prediction probability of the candidate translation result satisfies the following formula:
[0043]
[0044] Where G represents any candidate translation result among multiple candidate translation results, Z(G) represents the predicted probability of candidate translation result G, and g t represents the tth word in the candidate translation result G, g <t represents the word before the tth word in the candidate translation result G, S represents the source sequence, l represents the number of words in the candidate translation result G, θ represents the parameters of the initial translation model, and f θ represents the initial translation model, It means that the initial translation model has input S and g <t Output g in the case of t The conditional probability of , α is a hyperparameter.
[0045] In the solution of the embodiment of the present application, the predicted probability of the candidate translation result can measure the overall probability of the sequence from the perspective of the entire sentence (ie, sequence), rather than considering the probability of a single word locally.
[0046] In conjunction with the second aspect, in certain implementations of the second aspect, the multiple candidate translation results are obtained by inputting the source sequence into an initial translation model for processing, and the multiple candidate translation results include the first predicted translation result.
[0047] In conjunction with the second aspect, in some implementations of the second aspect, the second loss function satisfies the following formula:
[0048]
[0049] Among them, L reorder represents the second loss function, G j represents the candidate translation result at position j in the reference ranking, G i represents the candidate translation result at position i in the reference ranking, Z(Gj ) represents G j The predicted probability, Z(G i ) represents G i The predicted probability, λ ij Represents G j and G i The adjustment parameters between .
[0050] According to a third aspect, a translation device is provided, the device comprising a unit / module for executing a method of any one of the implementation modes of the first aspect.
[0051] It should be understood that the expansion, limitation, explanation and description of the relevant contents in the above-mentioned first aspect also apply to the same contents in the third aspect.
[0052] In a fourth aspect, a translation model optimization device is provided, the device comprising a unit / module for executing a method of any one of the implementation modes of the second aspect.
[0053] It should be understood that the expansion, limitation, explanation and description of the relevant contents in the above-mentioned second aspect also apply to the same contents in the fourth aspect.
[0054] In a fifth aspect, a computing device cluster is provided, including at least one computing device, each computing device including a processor and a memory. The processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method in any one of the implementations of the first aspect or the second aspect.
[0055] The processor in the fifth aspect can be a central processing unit (CPU) or a combination of a CPU and a neural network processor, where the neural network processor can include a graphics processing unit (GPU), a neural network processing unit (NPU) and a tensor processing unit (TPU), etc. Among them, TPU is a fully customized artificial intelligence accelerator dedicated integrated circuit for machine learning.
[0056] In a sixth aspect, a computer-readable medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes a method for executing any one of the implementations of the first aspect or the second aspect, and the computing device cluster comprises at least one computing device.
[0057] In a seventh aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in any one of the implementations of the first aspect or the second aspect, and the computing device cluster includes at least one computing device.
[0058] In an eighth aspect, a chip is provided, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute a method in any one of the implementations of the first aspect or the second aspect.
[0059] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in any one of the implementation methods of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of a translation system according to an embodiment of the present application.
[0061] Figure 2 A schematic diagram of a system architecture of an embodiment of the present application.
[0062] Figure 3 A schematic diagram of a translation process.
[0063] Figure 4 A schematic diagram of a set of graphical user interfaces according to an embodiment of the present application.
[0064] Figure 5 A schematic diagram of another set of graphical user interfaces according to an embodiment of the present application.
[0065] Figure 6 A schematic flowchart of a method for optimizing a translation model according to an embodiment of the present application.
[0066] Figure 7 A schematic diagram of a loss function according to an embodiment of the present application.
[0067] Figure 8 A schematic diagram of a translation process according to an embodiment of the present application.
[0068] Fig. 9 A schematic diagram of user feedback according to an embodiment of the present application.
[0069] Fig.10 A schematic flowchart of a translation method according to an embodiment of the present application.
[0070] Fig.11 Schematic diagram of two feedback methods according to an embodiment of the present application.
[0071] Fig.12 A schematic flowchart of a method for determining a user portrait according to an embodiment of the present application.
[0072] Fig.13 A schematic diagram of a user portrait according to an embodiment of the present application.
[0073] Fig.14 A schematic diagram of two user groups according to an embodiment of the present application.
[0074] Fig.15 A schematic flowchart of another translation method according to an embodiment of the present application.
[0075] Fig.16 The following is a schematic flowchart of another translation method according to an embodiment of the present application.
[0076] Fig.17 A schematic block diagram of a translation model optimization device according to an embodiment of the present application.
[0077] Fig.18 A schematic block diagram of a translation device according to an embodiment of the present application.
[0078] Fig.19 A schematic block diagram of another translation model optimization device according to an embodiment of the present application.
[0079] Fig. 20 A schematic block diagram of another translation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0080] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0081] In order to facilitate understanding of the embodiments of the present application, the relevant concepts of relevant terms that may be involved in the embodiments of the present application are first introduced below.
[0082] (1) Natural Language Processing
[0083] Natural language is human language, and natural language processing is the processing of human language. Natural language processing is the process of systematically analyzing, understanding, and extracting information from text data in an intelligent and efficient way. Natural language processing (NLP) and its components can manage very large blocks of text data, or perform a large number of automated tasks, and solve a variety of problems, such as automatic summarization, machine translation (MT), named entity recognition (NER), relation extraction (RE), information extraction (IE), sentiment analysis, speech recognition, question answering, and topic segmentation, etc.
[0084] (2) Model training and reasoning
[0085] The training method of the model refers to applying data processing methods such as data training, machine learning, and deep learning to symbolize and formalize intelligent information modeling, extraction, preprocessing, training, etc. on the training samples, and finally obtaining a trained model. The model in the embodiment of the present application is a translation model. For example, the training sample may include a source sequence and a reference sequence. The reference sequence may also be referred to as a reference translation result. The source sequence may be a sentence in a first language, and the reference sequence may be a sentence in a second language. In addition, the method provided in the embodiment of the present application can use the above-mentioned trained translation model to input input data, such as the query request of the user in the present application, into the trained translation model to obtain output data, such as a predicted translation result and the confidence of the predicted translation result.
[0086] It should be noted that the optimization method and translation method of the translation model provided in the embodiments of the present application are solutions generated based on the same concept, and can also be understood as two parts in a system, or two stages of an overall process: such as the model training stage and the model application stage.
[0087] (3) Loss Function
[0088] In the process of training the model, because we hope that the output of the model is as close as possible to the result we really want to predict, we can compare the prediction results of the current model with the target results we really want, and then update the model weights according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters in the model), and keep adjusting until the model can predict the target result we really want or a result that is very close to the target result we really want. Therefore, it is necessary to pre-define "how to compare the difference between the predicted result and the target result", which is the loss function or objective function, which are important equations used to measure the difference between the predicted result and the target result. Among them, taking the loss function as an example, the higher the value of the loss function (loss), the greater the difference, so the training of the model becomes a process of minimizing this loss as much as possible.
[0089] The training goal of the translation model is to learn a model f that generates a predicted sequence G' based on the input source sequence S, that is, it satisfies the following formula:
[0090] G'←f(S);
[0091] The language of the source sequence is the source language, and the language of the predicted sequence is the target language, and the source language and the target language are different. The predicted sequence can also be called a predicted translation result.
[0092] Maximum likelihood estimation is a commonly used training method for translation models. The training goal is to maximize the possibility of the translation model outputting a reference sequence. In other words, the training goal is to find the model parameters that maximize the probability of the words in the reference sequence appearing, that is, the target model parameters.
[0093] Target model parameters θ * The following formula can be satisfied:
[0094]
[0095] Among them, θ represents the parameters of the model, f θ represents a model with parameter θ. *(i) represents the reference sequence in the i-th training data in the training data set. The i-th training data can be represented as {S (i) ,G *(i)}. (i) represents the source sequence in the i-th training data. In a training data, the source sequence and the reference sequence have a corresponding relationship. For example, G *(i) It can be described as the source sequence S (i) The corresponding reference sequence. Represents the model f θ In S(i) Output G under the condition *(i) probability. Represents the probability distribution involved in the model parameters.
[0096] For the above training sample, the above formula uses the cross entropy method to express the loss function L trans The following formula can be satisfied:
[0097]
[0098] Among them, the reference sequence can be expressed as a word sequence n represents the length of the reference sequence. Represents the model f θ When the input is S and g * <t Output g under the condition t 'Probability. g t ' represents the model f θ Output the tth word. g * <t Represents the word before the tth word in the reference sequence. g' represents the word that the model may output, that is, the word in the dictionary.
[0099] p true (g t '|S,g * <t ) can satisfy the following formula:
[0100]
[0101] represents the tth word in the reference sequence.
[0102] From the above formula, we can see that only the words in the reference sequence are assigned a probability of 1, and the other words are assigned a probability of 0, that is, only when the word output by the model is the same as the word in the reference sequence, p true When the word output by the model is different from the word in the reference sequence, p true Both are 0. In the actual training process, soft label (label smoothing) can be used.
[0103] During the inference process, the translation model can generate candidate translation results in an autoregressive manner. It is difficult to enumerate all possible candidate translation results. Therefore, during the inference process, beam search and other methods are usually used to reduce the search space.
[0104] (4) Exposure bias
[0105] Generative tasks, such as translation tasks or summary generation tasks, use deep learning models to achieve sequence-to-sequence modeling. The model used for this type of task can be called a sequence-to-sequence (seq2seq) model. The seq2seq model is usually trained based on maximum likelihood estimation, which assumes that there is only one target distribution, that is, the source sequence corresponds to only one reference sequence. The ideal model assigns all probabilities to the reference sequence, that is, the ideal model takes the source sequence as input and outputs the reference sequence with a probability of 1. The training goal is to make the model take the source sequence as input and output a predicted sequence as close to the reference sequence as possible, that is, the ground truth. However, the model trained in this way has the problem of exposure bias. Specifically, in the training phase, when the model predicts the next word, it takes the source sequence and the previous word of the word in the reference sequence as input; in the inference phase, when the model predicts the next word, it takes the source sequence and the words that the model has generated as input. The words generated by the model may not be the same as the preceding words of the word in the reference sequence, which leads to inconsistent inputs in the model training and inference stages. The model may not be able to output the prediction results in the training stage in the inference stage. That is, for the same source sequence, the prediction sequence output by the model in the inference stage may be significantly different from the reference sequence. Exposure bias may cause the model to experience performance degradation in the inference stage.
[0106] (5) Beam search
[0107] Beam search is a heuristic graph search algorithm. When the graph solution space is large, in order to reduce the space and time occupied by the search, only some high-quality nodes are retained at each step of depth expansion. In other words, beam search is to find the optimal solution in a relatively limited search space at a relatively low cost.
[0108] Beam search is often used in the testing and inference phases of seq2seq models to output multiple sequences with the highest probability.
[0109] (6) Bilingual evaluation understudy (BLEU)
[0110] BLEU is commonly used in machine translation tasks. The BLEU score can be used to evaluate the difference between the translation results generated by the model and the reference translation results.
[0111] The solution of the embodiment of the present application can be applied to a translation system. Figure 1 A schematic diagram of a translation system according to an embodiment of the present application is shown.
[0112] Figure 1(a) shows an application scenario of the translation system. Figure 1 As shown in (a), the translation system may include a user device and a data processing device. The user device may include a user and an intelligent terminal such as a mobile phone, a personal computer or an information processing center. The user device is the initiator of the translation task processing. As the initiator of a request such as a translation query, the user usually initiates the request through the user device.
[0113] The data processing device can be a device or server with data processing functions such as a cloud server, a network server, an application server, and a management server. The data processing device receives query statements / voice / text and other questions from the smart terminal through an interactive interface, and then performs language data processing in the form of machine learning, deep learning, search, reasoning, decision-making, etc. through the memory that stores data and the processor link of data processing. Memory can be a general term, including local storage and databases that store historical data. The database can be located on the data processing device or on other network servers.
[0114] exist Figure 1 In the translation system shown in (a), the user device can receive the user's instructions. For example, the user device can receive a piece of text input by the user, and then initiate a request to the data processing device, so that the data processing device translates the piece of text, thereby obtaining a corresponding translation result for the piece of text.
[0115] The translation model obtained by the translation model optimization method of the embodiment of the present application can be deployed in Figure 1 In the data processing device in (a), the translation model can be used to perform a translation task to obtain a translation result.
[0116] Figure 1 (b) shows another application scenario of the translation system. In this scenario, the user device directly serves as a data processing device, directly receiving input from the user and directly processing it by the hardware of the user device itself. The specific process is similar to Figure 1 The above description is similar to (a), and will not be repeated here.
[0117] exist Figure 1 In the translation system shown in (b), the user device can receive a user's instruction. For example, the user device can receive a piece of text input by the user, and the user device itself translates the text to obtain a translation result.
[0118] The translation model obtained by the translation model optimization method of the embodiment of the present application can be deployed in Figure 1 In the user device in (b), the translation model can be used to perform the translation task to obtain a translation result.
[0119] Figure 1 (c) is a schematic diagram of related devices of the translation system provided in an embodiment of the present application. The translation system 100 may include a local device 101, a local device 102, an execution device 110 and a data storage system 150, wherein the local device 101 and the local device 102 are connected to the execution device 110 via a communication network.
[0120] The execution device 110 can be implemented by one or more servers. Optionally, the execution device 110 can be used in conjunction with other computing devices, such as data storage devices, routers, load balancers, etc. The execution device 110 can be arranged at one physical site, or distributed at multiple physical sites. The execution device 110 can use the data in the data storage system 150, or call the program code in the data storage system 150 to implement the optimization method of the translation model of the embodiment of the present application.
[0121] Exemplarily, users may operate respective user devices (e.g., local device 101 and local device 102) to interact with execution device 110. Each local device may represent any computing device, such as a personal computer, a computer workstation, a smart phone, a tablet computer, a smart camera, a smart car or other types of cellular phones, a media consumption device, a wearable device, a set-top box, a game console, etc.
[0122] The local device of each user can interact with the execution device 110 through a communication network of any communication mechanism / communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
[0123] The data storage system 150 may be integrated in the execution device 110 , the local device 101 or the local device 102 , or may be set up in the cloud or other network servers.
[0124] In one implementation, the local device 101 or the local device 102 may obtain relevant parameters of the translation model from the execution device 110 , and the local device 101 or the local device 102 may obtain the execution result of the translation task by using the translation model.
[0125] In another implementation, the translation model may be directly deployed on the execution device 110 , and the execution device 110 obtains the text to be processed from the local device 101 and the local device 102 , and obtains the execution result of the translation task through the translation model.
[0126] It should be noted that all functions of the execution device 110 may also be implemented by the local device. For example, the local device 101 implements the functions of the execution device 110 and provides services to its own user, or provides services to the user of the local device 102.
[0127] The execution device 110 may also be called a cloud device, and the execution device 110 may be deployed in the cloud. Alternatively, the execution device 110 may also be a terminal device, and the execution device 110 may be deployed on the user terminal side, which is not limited in the present embodiment.
[0128] For example, Figure 1 (a) and Figure 1 The user equipment in (b) may be Figure 1 (c) the local device 101 or 102.
[0129] For example, Figure 1 (a) and Figure 1 The data processing device in (b) may be Figure 1 The execution device 110 in (c).
[0130] Figure 1 (d) shows a schematic diagram of the structure of an electronic device 1100. For example, the electronic device 1100 may be Figure 1 (a) and Figure 1 The electronic device 1100 may be Figure 1 (c) the local device 101 or 102.
[0131] The electronic device 1100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an AI device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.
[0132] The electronic device 1100 may include a processor 1101, an external memory interface 1120, an internal memory 1121, a universal serial bus (USB) interface 1130, a charging management module 1140, a power management module 1141, a battery 1142, an antenna 1, an antenna 2, a mobile communication module 1150, a wireless communication module 1160, an audio module 1170, a speaker 1170A, a receiver 1170B, a microphone 1170C, an earphone interface 1170D, a sensor module 1180, a button 1190, a motor 1191, an indicator 1192, a camera 1193, a display screen 1194, and a subscriber identification module (SIM) card interface 1195, etc. The sensor module 1180 may include a pressure sensor 1180A, a gyroscope sensor 1180B, an air pressure sensor 1180C, a magnetic sensor 1180D, an acceleration sensor 1180E, a distance sensor 1180F, a proximity light sensor 1180G, a fingerprint sensor 1180H, a temperature sensor 1180J, a touch sensor 1180K, an ambient light sensor 1180L, a bone conduction sensor 1180M, and the like.
[0133] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 1100. In other embodiments of the present application, the electronic device 1100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0134] The processor 1101 may include one or more processing units, for example, the processor 1101 may include an application processor (AP), a modem processor, a GPU, an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or an NPU, etc. Different processing units may be independent devices or integrated into one or more processors.
[0135] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0136] The processor 1101 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1101 is a cache memory. The memory may store instructions or data that the processor 1101 has just used or cyclically used. If the processor 1101 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1101, and thus improves the efficiency of the system.
[0137] In some embodiments, the processor 1101 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0138] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 1101 may include multiple groups of I2C buses. The processor 1101 may be coupled to the touch sensor 1180K, the charger, the flash, the camera 1193, etc. through different I2C bus interfaces. For example: the processor 1101 may be coupled to the touch sensor 1180K through the I2C interface, so that the processor 1101 communicates with the touch sensor 1180K through the I2C bus interface, thereby realizing the touch function of the electronic device 1100.
[0139] The I2S interface can be used for audio communication. In some embodiments, the processor 1101 can include multiple I2S buses. The processor 1101 can be coupled to the audio module 1170 via the I2S bus to achieve communication between the processor 1101 and the audio module 1170.
[0140] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 1170 and the wireless communication module 1160 can be coupled via a PCM bus interface.
[0141] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
[0142] The MIPI interface can be used to connect the processor 1101 with peripheral devices such as the display screen 1194 and the camera 1193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 1101 and the display screen 1194 communicate via the DSI interface to realize the display function of the electronic device 1100.
[0143] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 1101 with the camera 1193, the display 1194, the wireless communication module 1160, the audio module 1170, the sensor module 1180, etc.
[0144] The USB interface 1130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
[0145] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 1100. In other embodiments of the present application, the electronic device 1100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0146] The charging management module 1140 is used to receive charging input from a charger.
[0147] The power management module 1141 is used to connect the battery 1142, the charging management module 1140 and the processor 1101. The power management module 1141 receives input from the battery 1142 and / or the charging management module 1140 to power the processor 1101, the internal memory 1121, the display screen 1194, the camera 1193, and the wireless communication module 1160.
[0148] The wireless communication function of the electronic device 1100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 1150, the wireless communication module 1160, the modem processor and the baseband processor.
[0149] The electronic device 1100 implements the display function through a GPU, a display screen 1194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 1194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1101 may include one or more GPUs, which execute program instructions to generate or change display information.
[0150] The display screen 1194 is used to display images, videos, etc. The display screen 1194 includes a display panel.
[0151] The electronic device 1100 can realize the shooting function through an ISP, a camera 1193, a video codec, a GPU, a display screen 1194, and an application processor.
[0152] The ISP is used to process the data fed back by the camera 1193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. In some embodiments, the ISP can be set in the camera 1193.
[0153] The camera 1193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. In some embodiments, the electronic device 1100 may include 1 or M cameras 1193, where M is a positive integer greater than 1.
[0154] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 1100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0155] The external memory interface 1120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 1100. The external memory card communicates with the processor 1101 through the external memory interface 1120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0156] The internal memory 1121 can be used to store computer executable program codes, which include instructions. The internal memory 1121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 1100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 1121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 1101 executes various functional applications and data processing of the electronic device 1100 by running instructions stored in the internal memory 1121 and / or instructions stored in a memory provided in the processor.
[0157] The electronic device 1100 can implement audio functions such as music playing and recording through the audio module 1170, the speaker 1170A, the receiver 1170B, the microphone 1170C, the headphone jack 1170D, and the application processor.
[0158] The audio module 1170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 1170 can also be used to encode and decode audio signals. In some embodiments, the audio module 1170 can be arranged in the processor 1101, or some functional modules of the audio module 1170 can be arranged in the processor 1101.
[0159] The speaker 1170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 1100 can listen to music or listen to a hands-free call through the speaker 1170A.
[0160] The receiver 1170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 1100 receives a call or voice message, the voice can be received by placing the receiver 1170B close to the human ear.
[0161] Microphone 1170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 1170C to input the sound signal into the microphone 1170C. The electronic device 1100 can be provided with at least one microphone 1170C. In other embodiments, the electronic device 1100 can be provided with two microphones 1170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 1100 can also be provided with three, four or more microphones 1170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0162] The headphone jack 1170D is used to connect a wired headphone.
[0163] The pressure sensor 1180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, the pressure sensor 1180A can be set on the display screen 1194. When a touch operation acts on the display screen 1194, the electronic device 1100 detects the touch operation strength according to the pressure sensor 1180A. The electronic device 1100 can also calculate the touch position based on the detection signal of the pressure sensor 1180A. In some embodiments, touch operations acting on the same touch position but with different touch operation strengths can correspond to different operation instructions. For example: when a touch operation with a touch operation strength less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation strength greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0164] The fingerprint sensor 1180H is used to collect fingerprints. The electronic device 1100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0165] The touch sensor 1180K is also called a "touch control device". The touch sensor 1180K can be set on the display screen 1194. The touch sensor 1180K and the display screen 1194 form a touch screen, also called a "touch control screen". The touch sensor 1180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 1194. In other embodiments, the touch sensor 1180K can also be set on the surface of the electronic device 1100, which is different from the position of the display screen 1194.
[0166] Button 1190 includes a power button, a volume button, etc.
[0167] Motor 1191 can generate vibration prompts. Motor 1191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 1194, motor 1191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0168] The SIM card interface 1195 is used to connect a SIM card. The electronic device 1100 may support 1 or M SIM card interfaces, where M is a positive integer greater than 1.
[0169] The software system of the electronic device 1100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 1100.
[0170] Figure 1 (e) is a software structure block diagram of the electronic device 1100 according to an embodiment of the present application.
[0171] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0172] The application layer can include a series of application packages.
[0173] like Figure 1 As shown in (e), the application package may include camera, gallery, translation, call, map, navigation, wireless local area networks (WLAN), Bluetooth, music, video, short message and other applications.
[0174] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0175] like Figure 1 As shown in (e), the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0176] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0177] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0178] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0179] The phone manager is used to provide communication functions of the electronic device 1100, such as management of call status (including connecting, hanging up, etc.).
[0180] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0181] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0182] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0183] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0184] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0185] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0186] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0187] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0188] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0189] A 2D graphics engine is a drawing engine for 2D drawings.
[0190] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0191] The following is an illustrative description of the workflow of the software and hardware of the electronic device 1100 in conjunction with a translation scenario.
[0192] When the touch sensor 1180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the translation application icon, the translation application calls the interface of the application framework layer to start the translation application, and then starts the display driver by calling the kernel layer, and provides a translation interface through the display screen 1194.
[0193] Figure 2 A system architecture 200 provided by an embodiment of the present application is shown. The data acquisition device 260 is used to collect training data and store it in the database 230. The training device 220 generates a target model / rule 201 based on the training data maintained in the database 230, for example, a translation model in an embodiment of the present application. The model in the embodiment of the present application can be a neural network model, or it can be other models. The training data may include a source sequence and a reference sequence corresponding to the source sequence. Exemplarily, the translation model can be obtained by the optimization method in the embodiment of the present application, and the specific description is detailed below.
[0194] It should be noted that, in actual applications, the training data maintained in the database 230 may not all come from the data acquisition device 260, but may also be received from other devices. It should also be noted that the training device 220 may not train the target model / rule 201 entirely based on the training data maintained by the database 230, but may also obtain training data from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.
[0195] Figure 2 The figure shows a functional module diagram in the data processing process. Figure 2 The client device 240 may be Figure 1 User equipment. Figure 1 When the data processing capability of the user equipment in the Figure 2 The execution device 210 and the data storage system 250 in the embodiment may be integrated in Figure 1 In some embodiments, Figure 2 The execution device 210 and the data storage system 250 in the embodiment may also be integrated in Figure 1 on data processing equipment. Figure 2 The database 230, training device 220 and data acquisition device 260 in the embodiment can be integrated into Figure 1 The data processing device in the system can be set up on the cloud or other servers on the network.
[0196] Exemplarily, the data acquisition device 260 may be a terminal device, or an input / output interface of a server or cloud, an interactive layer (interface) for obtaining user input and returning processing results.
[0197] The target model / rule obtained by the training device 220 can be applied to different systems or devices. Figure 2 The execution device 210 shown in the figure may be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an AR / VR, a vehicle terminal, etc., or a server or a cloud. Figure 2 In the embodiment, the execution device 210 is configured with an input / output (I / O) interface 212 for data interaction with external devices, and a "user" can input data to the I / O interface 212 through a client device 240. For example, the input data may include: text to be translated input by the client device.
[0198] When the execution device 210 preprocesses the input data, or when the computing module 211 of the execution device 210 performs calculations and other related processing, the execution device 210 can call data, codes, etc. in the data storage system 250, and can also store data, instructions, etc. in the data storage system 250.
[0199] Finally, the I / O interface 212 returns the processing result to the client device 240 so as to provide it to the user.
[0200] It is worth noting that the training device 220 can generate corresponding target models / rules 201 based on different training data for different goals or different tasks, and the corresponding target models / rules 201 can be used to achieve the above goals or complete the above tasks, thereby providing the user with the desired results.
[0201] exist Figure 2 In the case shown in the figure, the user can manually specify the data input into the execution device 210, for example, by operating in the interface provided by the I / O interface 212. In another case, the client device 240 can automatically input data into the I / O interface 212 and obtain the result. If the client device 240 needs to obtain the user's authorization to automatically input data, the user can set the corresponding authority in the client device 240. The user can view the result output by the execution device 210 in the client device 240, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 240 can also be used as a data acquisition terminal to collect the input data input into the I / O interface 212 and the output result of the I / O interface 212 as shown in the figure as new sample data, and store it in the database 230. Of course, it is also possible not to collect through the client device 240, but the I / O interface 212 directly stores the input data input into the I / O interface 212 and the output result of the I / O interface 212 as new training data into the database 230.
[0202] It is worth noting that Figure 2 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 2 In the embodiment, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 can also be placed in the execution device 210.
[0203] Machine translation is an important direction of natural language processing. With the continuous development of deep learning, the quality of machine translation has been improved and it is widely used in various scenarios, such as translating web pages, translating apps, or input method translation. Machine translation models are usually trained based on training data, and the data distribution of training data may not be consistent with the data distribution in actual application scenarios. In this case, the machine translation model may not achieve the expected performance. If the performance of the model is poor, it will seriously affect the user experience. In addition, after the machine translation model is launched, due to the lack of standard translation results, the performance of the model is difficult to evaluate and errors are difficult to identify and correct.
[0204] Figure 3 A schematic diagram of a translation process is shown. Figure 3 As shown in Figure 1, a translation model is obtained by training based on the training dataset. After the translation model passes the test on the test dataset, it can be deployed online. After deployment, the translation model continues to run on the live network, that is, Figure 3 The local model in the system runs continuously. The local model can process the user's query request and output the translation result. The user may modify the translation result. The system can retain the existing network data. For example, the system can randomly retain the user's query request and the translation result output by the model. For another example, the system can also retain the user's query request, the translation result output by the model, and the user's modification result. For another example, the system can also retain data based on the user's evaluation, for example, retain the user's query request with a low evaluation and its translation result. The sequence in the query request can be used as the source sequence of the training data, and the annotator annotates it to obtain the corresponding reference translation result, that is, Figure 3 The reference translation results and their corresponding source sequences can be stored as new training data in the training dataset of the translation model for subsequent fine-tuning of the translation model. Annotators can also evaluate the performance of the translation model based on live network data.
[0205] In the above process, fine-tuning of the translation model mainly depends on the feedback from the annotators, which places relatively high demands on the annotators, such as language experts. In addition, this method is inefficient, affects the collection of training data, and makes it difficult to achieve efficient iterative optimization of the translation model.
[0206] In view of this, an embodiment of the present application provides a translation method that actively guides users to provide feedback on translation results, thereby achieving efficient collection of user feedback data for continuous optimization of the translation model, thereby improving the performance of the translation model.
[0207] The solution of the embodiment of the present application can be applied to various scenarios such as translating web pages, translating apps, and input method translation. For ease of understanding, some human-computer interaction embodiments are first introduced below.
[0208] Figure 4 A set of graphical user interface (GUI) schematic diagrams provided in an embodiment of the present application are shown.
[0209] For example, Figure 4 The interface shown may be an interface of a translation webpage or a translation app. Figure 4 The interface may include a content input box 401, a translation result display box 402, and an editing control. The interface may also include a source language selection control 403 and a target language selection control 404. Further, the interface may also include other controls, such as a translation control 405, an audio control 406, or a copy control 407.
[0210] When the user inputs the text to be translated in the content input box 401, the translation result display box 402 can display a translation result of the text to be translated. The translation control 405 can be used to control the translation result display box 402 to display a translation result of the text to be translated. For example, after the user inputs the text to be translated, the user clicks the translation control 405. In response to the click operation, the translation result display box 402 can display a translation result of the text to be translated.
[0211] exist Figure 4 In the relevant description of , the translation result of the text to be translated can be output by the translation model. The translation model can be the translation model in the embodiment of the present application. Exemplarily, the text to be translated is input into the translation model for processing to obtain N predicted translation results of the text to be translated. N is a positive integer. For example, the translation result displayed in the translation result display box 402 can be the first predicted translation result among the N predicted translation results. Or the translation model can also be other translation models, which is not limited in the embodiment of the present application.
[0212] It should be noted that the interface may not include the translation control 405. For example, when the user inputs the text to be translated, the translation result display box 402 can display a translation result of the text to be translated in real time. For another example, when there is no input information in the content input box 401 for a period of time, that is, after a period of time after the text to be translated is input, the translation result display box 402 can display a translation result of the text to be translated in the current content input box 401.
[0213] The source language selection control 403 is used to select the source language, that is, the language of the text to be translated. The target language selection control 404 is used to select the target language, that is, the language of the translation result of the text to be translated. The audio control 406 is used to control the output of the audio corresponding to the translation result. The copy control 407 is used to copy the translation result.
[0214] For example, Figure 4 As shown in (a), the source language is "Chinese (Simplified)" and the target language is "English". The text to be translated input by the user is "Let's go hiking together on weekends!". The translation result display box 402 displays the translation result of the text "Go to climb the mountain together on weekends!".
[0215] like Figure 4 As shown, when the text to be translated is in Chinese, the pinyin of the text to be translated can also be displayed on the interface.
[0216] like Figure 4 As shown, the editing controls may include a translation result sorting control 408 , a translation result selection control 409 , and a translation result modification control 410 .
[0217] Exemplarily, the user can perform some operations on the translation result sorting control 408, such as a click operation or a long press operation. For ease of description, only the click operation is used as an example for explanation. In response to the click operation, a sorting operation box 411 is displayed on the interface. The sorting operation box 411 includes multiple translation results of the text to be translated and the sorting control corresponding to the multiple translation results. The multiple translation results in the sorting operation box 411 may include the translation results in the translation result display box 402, or may not include the translation results in the translation result display box 402. The user can perform some operations on the sorting operation box 411 to adjust the order of the multiple translation results. The translation result ranked first is displayed in the translation result display box 402. Further, in response to the click operation, a sorting operation prompt box 412 can also be displayed on the interface. The sorting operation prompt box 412 can be used to prompt the user a specific operation mode of sorting. The sorting operation prompt box 412 can be displayed only when the user performs the sorting operation for the first time. Alternatively, the sorting operation prompt box 412 can also be displayed every time the user performs the sorting operation.
[0218] Exemplarily, the text to be translated is input into the translation model for processing to obtain N predicted translation results of the text to be translated. For example, the multiple translation results in the sorting operation box 411 include the translation results in the translation result display box 402. In this case, the multiple translation results in the sorting operation box 411 can be the N predicted translation results. For another example, the multiple translation results in the sorting operation box 411 do not include the translation results in the translation result display box 402. In this case, the multiple translation results in the sorting operation box 411 can be the remaining N-1 predicted translation results of the N predicted translation results except the translation results in the translation result display box 402.
[0219] like Figure 4 As shown in (b), a sorting operation box 411 and a sorting operation prompt box 412 are displayed on the interface. Two translation results are displayed in the sorting operation box 411, namely, translation result 416 and translation result 417. The two translation results include the translation result in the translation result display box 402. The sorting controls corresponding to the two translation results are the arrow icon 418 and the arrow icon 419 on the left side of the multiple translation results. "Click the arrow to sort" is displayed in the sorting operation prompt box 412. The user can click the arrow icon 419 corresponding to the translation result to adjust the position of the translation result to sort the two translation results. The translation result 417 ranked first is displayed in the translation result display box 402. For example, the user clicks the arrow icon 419 on the left side of the translation result "Do you have time to climb the mountaion on the weekend?" In response to the click operation, the translation result 417 can move up one position. At this time, the translation result 417 is the translation result ranked first, and the translation result 417 replaces the translation result 416 originally displayed in the translation result display box 402. Figure 4 In (b), the positions of arrow icon 418 and arrow icon 419 change as the positions of the two translation results change. In other possible implementations, the positions of arrow icon 418 and arrow icon 419 may also remain unchanged.
[0220] For example, the user's sorting result can take effect immediately, that is, when the same user inputs the same text to be translated again after a period of time, the displayed translation result can be the translation result ranked first in the user's sorting result. For example, if the same user inputs "Let's go hiking together on the weekend!" again, the translation result "Do you have time to climb the mountaion on the weekend?" can be directly displayed.
[0221] Whether the user's sorting result takes effect immediately can be determined based on the user's user profile.
[0222] In other words, the sorting results of some users can take effect immediately. The sorting results of some users will not take effect immediately, that is, when the same user enters the same text to be translated again after a period of time, even if the user has previously provided sorting feedback, the displayed translation results will still be the translation results before the user provided sorting feedback.
[0223] For example, if the user's user profile is a high-quality contributor, the user's feedback quality is high, and the user's ranking result can take effect in the next query request. If the user's user profile is an ordinary user, the user's feedback quality is low, and the user's ranking result will not take effect in the next query request. The specific description of the user profile can refer to method 1200, which is not described here.
[0224] Whether the user's sorting result takes effect immediately can be determined based on the translation confidence.
[0225] In other words, for some of the content to be translated, the user's sorting results can take effect immediately. For some of the content to be translated, the user's sorting results will not take effect immediately.
[0226] For example, if the translation confidence corresponding to the content to be translated is high, the user's ranking result will not take effect in the next query request. If the translation confidence corresponding to the content to be translated is low, the user's ranking result may take effect in the next query request.
[0227] It should be understood that Figure 4 The sorting control in (b) is only an example and does not limit the solution of the embodiment of the present application. For example, the sorting control corresponding to the multiple translation results may not be explicitly displayed in the interface, and the user can drag the translation result to the desired position by long pressing the translation result to adjust the position of the translation result.
[0228] Exemplarily, the user can perform some operations on the translation result selection control 409, such as a click operation or a long press operation. For ease of description, only the click operation is used as an example for explanation. In response to the click operation, a selection operation box 413 is displayed on the interface. The selection operation box 413 includes multiple translation results of the text to be translated and the selection controls corresponding to the multiple translation results. The multiple translation results in the selection operation box 413 may include the translation results in the translation result display box 402, or may not include the translation results in the translation result display box 402. The user can perform some operations on the selection operation box 413 to select the required translation result. The translation result selected by the user is displayed in the translation result display box 402. Further, in response to the click operation, a selection operation prompt box 414 can also be displayed on the interface. The selection operation prompt box 414 can be used to prompt the user to select a specific operation mode. The selection operation prompt box 414 can be displayed only when the user performs a selection operation for the first time. Alternatively, the selection operation prompt box 414 can also be displayed each time the user performs a selection operation.
[0229] Exemplarily, the text to be translated is input into the translation model for processing to obtain N predicted translation results of the text to be translated. For example, the multiple translation results in the selection operation box 413 include the translation result in the translation result display box 402. In this case, the multiple translation results in the selection operation box 413 can be the N predicted translation results. For another example, the multiple translation results in the selection operation box 413 do not include the translation result in the translation result display box 402. In this case, the multiple translation results in the selection operation box 413 can be the remaining N-1 predicted translation results in the N predicted translation results except the translation result in the translation result display box 402.
[0230] like Figure 4 As shown in (c), a selection operation box 413 and a selection operation prompt box 414 are displayed on the interface. Two translation results, namely, translation result 420 and translation result 421, are displayed in the selection operation box 413, and the two translation results include the translation result in the translation result display box 402. "Click to select translation result" is displayed in the selection operation prompt box 414. The selection controls corresponding to the two translation results (i.e., selection control 422 and selection control 423) can be the areas where the two translation results are displayed. The user can click on the required translation result. The translation result clicked by the user is displayed in the translation result display box 402. For example, the user clicks on the area where the translation result 421 of "Let's go mountain climbing together this weekend!" is located, i.e., selection control 423. In response to the click operation, the translation result replaces the translation result originally displayed in the translation result display box 402.
[0231] Exemplarily, the user can perform some operations on the translation result modification control 410, such as a click operation or a long press operation. For ease of description, only the click operation is used as an example for description. In response to the click operation, the translation result display box 402 can be transformed into a translation result editing box. The user can modify the translation result in the translation result editing box.
[0232] like Figure 4As shown in (d), the translation result display box 402 displays the translation result "How about hiking this weekend?". The user can click on the translation result modification control 410. The translation result display box 402 is transformed into a translation result editing box. The user can modify the translation result in the translation result editing box 402, and after the modification is completed, the user can click on the "Submit" control 424, and the translation result editing box is transformed into the translation result display box 402, and the translation result display box 402 displays the user's modified translation result "Go hiking this weekend?". Alternatively, the user can click on the "Cancel" control 425, and the translation result editing box is transformed into the translation result display box 402, and the original translation result is displayed in the translation result display box.
[0233] In the above description, Figure 4 (b) to Figure 4 The interface shown in (d) may be triggered by a user's operation on an editing control. In some possible embodiments, Figure 4 (b) to Figure 4 The interface shown in (d) may also be triggered by other methods.
[0234] Exemplarily, the sorting operation box 411 may be actively popped up. For example, the translation result display box 402 displays a translation result of the text to be translated, and at the same time, the sorting operation box 411 is displayed on the interface. For another example, after the translation result display box 402 displays a translation result of the text to be translated, the sorting operation box 411 is displayed on the interface.
[0235] Exemplarily, the sorting operation box 411 may be triggered by other operations of the user. For example, Figure 4 The interface shown may be an interface on a computer. The translation result display box 402 displays a translation result of the text to be translated. The user performs some operations on the translation result, for example, moves the mouse to the location of the translation result, or clicks on the translation result. In response to the operation, a sorting operation box 411 may be displayed on the interface.
[0236] Exemplarily, the selection operation box 413 may be actively popped up. For example, the translation result display box 402 displays a translation result of the text to be translated, and at the same time, the selection operation box 413 is displayed on the interface. For another example, after the translation result display box 402 displays a translation result of the text to be translated, the selection operation box 413 is displayed on the interface.
[0237] Exemplarily, the selection operation box 413 may be triggered by other operations of the user. For example, Figure 4The interface shown may be an interface on a computer. The translation result display box 402 displays a translation result of the text to be translated. The user performs some operations on the translation result, for example, moves the mouse to the location of the translation result, or clicks on the translation result. In response to the operation, a selection operation box 413 may be displayed on the interface.
[0238] Exemplarily, the interface may display a modification operation prompt box 415. The modification operation prompt box 415 may be used to prompt the user of a specific modification operation method.
[0239] like Figure 4 As shown in (d), a modification operation prompt box 415 is displayed on the interface. The modification operation prompt box 415 displays "click to modify". The user can click the translation result modification control 410 to modify the translation result.
[0240] Exemplarily, the modification operation prompt box 415 may be actively popped up. For example, the translation result display box 402 displays a translation result of the text to be translated, and at the same time, the modification operation prompt box 415 is displayed on the interface. For another example, after the translation result display box 402 displays a translation result of the text to be translated, the modification operation prompt box 415 is displayed on the interface.
[0241] Exemplarily, the modification operation prompt box 415 may be triggered by other operations of the user. Figure 4 The interface shown may be an interface on a computer. The translation result display box 402 displays a translation result of the text to be translated. The user performs some operations on the translation result, for example, moves the mouse to the location of the translation result, or clicks on the translation result. In response to the operation, a modification operation prompt box 415 may be displayed on the interface.
[0242] Figure 5 A schematic diagram of another group of GUIs provided in an embodiment of the present application is shown.
[0243] In application scenarios such as input method translation, the main demand of users is to communicate with users of the target language or write documents in the target language. Taking the chat scenario as an example, the interface may include a first area and a second area. The first area is the area corresponding to the input method app, and the second area is the area corresponding to the chat app. When the translation function of the input method app is not enabled, the interface may display the following: Figure 5As shown in (a), the first area includes a keyboard area 502, and the second area includes a chat content display box and an input dialog box 501. The user can perform some operations in the keyboard area 502, such as a click operation, and in response to the operation, the input method App displays the corresponding text in the input dialog box 501. The user can click the send control to send the text in the input dialog box 501. Furthermore, the second area may also include other controls, such as an audio control or an emoticon selection control. The audio control can be used to input audio. The emoticon selection control can be used to select emoticons. After turning on the translation function of the input method App, for example, Figure 5 As shown in (a), the user clicks the translation function control to turn on the translation function, and the interface may display the following Figure 5 The user can click the "Cancel" control 509 to close the translation function and return to the Figure 5 The first area includes a keyboard area 502 and a content input box 503, and the second area includes a chat content display box (not shown in the figure) and an input dialog box 501. The user can perform some operations in the keyboard area 502, such as a click operation. In response to the operation, the input method App displays the corresponding text in the content input box 503, which is the text to be translated, and a translation result corresponding to the text to be translated is displayed in the input dialog box 501. The first area may also include a language selection control 504.
[0244] exist Figure 5 In the relevant description of , the translation result of the text to be translated can be output by the translation model. The translation model can be the translation model in the embodiment of the present application. Exemplarily, the text to be translated is input into the translation model for processing to obtain one or more predicted translation results of the text to be translated. For example, the translation result displayed in the input dialog box 501 can be the first predicted translation result among the one or more predicted translation results of the text to be translated. Or the translation model can also be other translation models, which is not limited in the embodiment of the present application.
[0245] The language selection control 504 is used to select the source language and the target language. The language selection control 504 can also be used to select an automatic mode, that is, automatically detecting the source language and determining the target language.
[0246] For example, Figure 5 As shown in (d), the text to be translated entered by the user is "Let's go hiking together on the weekend!". The language selection control 504 displays "Automatic", and the source language is automatically detected as "Chinese". The target language can automatically select the target language previously determined by the user, or the target language can also automatically select the target language that the user uses most frequently, such as Figure 5As shown in (d), the target language can be "English". The user can click the "OK" control 510, and the translation result of the text "We have time to climb mountain at weekends!" is displayed in the input dialog box. Alternatively, while the user inputs the text to be translated, the translation result of the text can be displayed in the input dialog box 501. Alternatively, after the user stops inputting for a period of time, the translation result of the input text can be displayed in the input dialog box 501. The above is only an example, and the embodiment of the present application does not limit the triggering method for displaying the translation result in the input dialog box 501.
[0247] like Figure 5 As shown in (c), the interface may display relevant prompt information to prompt the user to make changes. Figure 5 As shown in (c), the prompt message displayed on the interface is "Propose modification suggestions".
[0248] Exemplarily, the user can modify the translation result in the input dialog box 501 .
[0249] like Figure 5 As shown in (d), the editing control may include a translation result sorting control 505. Relevant prompt information may be displayed on the interface to prompt the user to sort. Figure 5 As shown in (d), the prompt information displayed on the translation result sorting control 505 is "Sort the translation results".
[0250] For example, the user can perform some operations on the translation result sorting control 505, such as a click operation or a long press operation. For ease of description, only the click operation is used as an example for explanation. In response to the click operation, a sorting operation box 506 is displayed on the interface, such as Figure 5 As shown in (e). Further, in response to the click operation, a sorting operation prompt box can also be displayed on the interface. The sorting operation prompt box can be used to prompt the user of the specific operation method of sorting. The sorting operation prompt box can be displayed only when the user performs the sorting operation for the first time. Alternatively, the sorting operation prompt box can also be displayed every time the user performs the sorting operation. Alternatively, in the case where the text to be translated input by the user this time is a text that has been input before and the user has sorted the translation results, the sorting prompt box is not displayed, and in other cases, the sorting operation prompt box is displayed. Alternatively, in the case where the text to be translated input by the user this time is a text that has not been input before, and the user is a high-quality contributor, the sorting operation prompt box is displayed. The relevant description of the sorting operation box 506 and the sorting operation prompt box can refer to the previous text, and the translation result display box 402 in the previous text is replaced by the input dialog box 501. To avoid repetition, it will not be repeated here.
[0251] like Figure 5 As shown in (f), the editing control may include a translation result selection control 507. Relevant prompt information may be displayed on the interface to prompt the user to make a selection. Figure 5 As shown in (f), the prompt information displayed on the translation result selection control 507 is "Select translation result".
[0252] For example, the user can perform some operations on the translation result selection control 507, such as a click operation or a long press operation. For ease of description, only the click operation is used as an example for description. In response to the click operation, a selection operation box 508 is displayed on the interface, such as Figure 5 As shown in (g). Further, in response to the click operation, a selection operation prompt box can also be displayed on the interface. The selection operation prompt box can be used to prompt the user to select a specific operation mode. The selection operation prompt box can be displayed only when the user performs a selection operation for the first time. Alternatively, the selection operation prompt box can also be displayed each time the user performs a selection operation. Alternatively, in the case where the text to be translated input by the user this time is a text that has been input before and the user has selected the translation result, the selection prompt box is not displayed, and in other cases, the selection operation prompt box is displayed. Alternatively, in the case where the text to be translated input by the user this time is a text that has not been input before and the user is a high-quality contributor, the selection operation prompt box is displayed. The relevant description of the selection operation box 508 can refer to the previous text, and the translation result display box 402 in the previous text is replaced by the input dialog box 501. To avoid repetition, it will not be repeated here.
[0253] In the above description, relevant prompt information may be displayed in the interface to prompt the user to sort the translation results or select a translation result. Figure 5 (e) and Figure 5 The interface shown in (g) can be triggered by the user's operation on the editing control. This can avoid the sorting operation box or the selection operation box blocking the chat operation interface or the input method operation interface, avoid affecting the user's normal chat needs, and help ensure user experience.
[0254] In some possible embodiments, Figure 5 (e) to Figure 5 The interface shown in (g) may also be triggered by other methods.
[0255] Exemplarily, the sorting operation box 506 may be actively popped up. For example, the input dialog box 501 displays a translation result of the text to be translated, and at the same time, the sorting operation box 506 is displayed on the interface. For another example, when there is no input information in the input dialog box 501 for a period of time, that is, a period of time after the translation result is input, the sorting operation box 506 is displayed on the interface.
[0256] Exemplarily, the sorting operation box 506 may be triggered by other operations of the user. For example, the input dialog box 501 displays a translation result of the text to be translated. The user performs some operations on the translation result, for example, long presses the location where the translation result is located. In response to the operation, the sorting operation box 506 may be displayed on the interface.
[0257] Exemplarily, the selection operation box 508 may be actively popped up. For example, the input dialog box 501 displays a translation result of the text to be translated, and at the same time, the selection operation box 508 is displayed on the interface. For another example, when there is no input information in the input dialog box 501 for a period of time, that is, a period of time after the translation result is input, the selection operation box 508 is displayed on the interface.
[0258] Exemplarily, the selection operation box 508 may be triggered by other operations of the user. For example, the input dialog box 501 displays a translation result of the text to be translated. The user performs some operations on the translation result, for example, long pressing the location where the translation result is located. In response to the operation, the selection operation box 508 may be displayed on the interface.
[0259] It should be understood that the above interaction methods are only examples and do not constitute a limitation on the solutions of the embodiments of the present application.
[0260] The solutions in the above two scenarios both show three ways of guiding users to give feedback on translation results, namely, sorting feedback, selection feedback and modification feedback.
[0261] Exemplarily, the three feedback modes may be determined based on at least one of the following: translation confidence of the translation model, user portrait, and application scenario.
[0262] For example, the system may determine a feedback method from the three feedback methods according to at least one of the above items, and actively display a corresponding feedback prompt.
[0263] In other words, when the translation confidence of the translation model is different, the feedback method of the user may be different.
[0264] Below Figure 4 (b) to Figure 4 Take (d) as an example to illustrate.
[0265] exist Figure 4 In (b), the text to be translated entered by the user is "Let's go hiking together if we have time on the weekend!", and the user is guided to provide feedback on the translation results in a ranking feedback manner. Figure 4 In (c), the text to be translated input by the user is "Let's go hiking together this weekend!", and the user is guided to provide feedback on the translation result by selecting feedback. Figure 4In (d), the text to be translated input by the user is "How about going hiking on the weekend?", and the user is guided to provide feedback on the translation result by modifying the feedback.
[0266] When the text to be translated input by the user is different, the translation confidence may also be different. For example, when the translation confidence corresponding to the text to be translated is low, the translation quality of multiple translation results may be poor. In this case, the user can be guided to adopt a modification feedback method, for example, Figure 4 As another example, when the translation confidences of multiple translation results of the text to be translated are all high, the user can be guided to adopt a ranking feedback method, for example, Figure 4 As shown in (b), in order to obtain a more accurate ranking result of the translation quality of the multiple translation results. For another example, when the translation confidence of one translation result among the multiple translation results of the text to be translated is high, and the translation confidence of the other translation results is low, the user can be guided to adopt a selective feedback method, for example, Figure 4 It should be understood that the above is only an example and does not limit the solution of the embodiment of the present application.
[0267] In different user situations, the feedback method of prompting users may be different.
[0268] Different users may have different feedback willingness, feedback method preferences, or feedback quality. User portraits can reflect the user characteristics of the specific translation feedback function.
[0269] For example, some users tend to provide feedback by selecting feedback. In this case, the user can be guided to select feedback to increase the possibility of the user providing feedback. Relevant prompt information can be displayed on the interface to prompt the user to make a selection.
[0270] For another example, some users tend to use the method of modifying feedback to provide feedback. In this case, the user can be guided to use the method of modifying feedback to increase the possibility of the user providing feedback. Relevant prompt information can be displayed on the interface to prompt the user to make modifications.
[0271] For another example, some users tend to provide feedback in the form of sorting feedback. In this case, users can be guided to provide feedback in the form of sorting feedback to increase the possibility of users providing feedback. Relevant prompt information can be displayed on the interface to prompt users to sort.
[0272] by Figure 5 For example, Figure 5 (f), Figure 5 (c) and Figure 5 (d) may be content to be translated input by different users. Figure 5The users in (f) tend to provide feedback by selecting feedback, such as Figure 5 As shown in (f), the prompt information displayed on the translation result selection control 507 is "Select translation result". Figure 5 Users in (c) tend to provide feedback in the form of modified feedback, such as Figure 5 As shown in (c), the prompt message displayed on the interface is "Propose modification suggestions". Figure 5 The users in (d) tend to provide feedback in a ranked manner, such as Figure 5 As shown in (d), the prompt information displayed on the translation result sorting control 505 is "Sort the translation results".
[0273] For another example, some users have a low willingness to provide feedback. In this case, users can be guided to adopt a method of sorting feedback or selecting feedback to increase the possibility of users providing feedback.
[0274] For another example, some users are more willing to provide feedback. In this case, users can be guided to adopt a method of modifying their feedback to increase the possibility of users providing feedback.
[0275] In different application scenarios of the translation model, the feedback method of prompting the user may be different.
[0276] In different application scenarios, users have different degrees of acceptance of various feedback methods.
[0277] In application scenarios such as translation apps or webpage translation, the main demand of users is to understand the meaning of the translation results. Users are less willing to modify the translation results, that is, the possibility of users choosing to modify this feedback method is low. In this case, users can be guided to adopt the method of selecting feedback or sorting feedback, for example, Figure 4 (b) or Figure 4 as shown in (c).
[0278] In application scenarios such as input method apps, the main reason users use the translation function is to communicate with users of other languages or write documents. Users are more willing to modify the translation results, that is, users are more likely to choose to modify this feedback method. In this case, users can be guided to adopt the modification feedback method, for example, Figure 5 as shown in (c).
[0279] The detailed description can be found in the following text and will not be elaborated here.
[0280] The prompt information corresponding to the three feedback modes may be expressed in various forms, and any information that can be actively popped up to prompt the user to provide feedback may be regarded as prompt information corresponding to the feedback mode.
[0281] Exemplarily, the prompt information of the sorting feedback may include any of the following forms: Figure 4 The sorting operation box 411 in (b) Figure 4 (b) in the sorting operation prompt box 412, Figure 5 The text prompt in (d) (i.e., "rank the translation results"), Figure 5 The sorting operation box 506 in (e), etc.
[0282] Exemplarily, the prompt information for selecting feedback may include any of the following forms: Figure 4 (c) in the selection operation box 413, Figure 4 (c) in the selection operation prompt box 414, Figure 5 The text prompt in (f) (i.e. "Select translation result"), Figure 5 The selection operation box 508 in (g), etc.
[0283] Exemplarily, the prompt information for modifying the feedback may include any of the following forms: Figure 4 (d) in the modification operation prompt box 415 or Figure 5 The text prompt in (c) (i.e. “make suggestions for revisions”) etc.
[0284] Translation models are usually trained based on maximum likelihood estimation, which assumes that there is only one target distribution, which is the distribution closest to the reference sequence. The training goal is to make the translation model take the source sequence as input and output a predicted sequence as close to the reference sequence as possible. However, the model trained in this way has the problem of exposure bias. Exposure bias may cause the performance of the model to degrade during the inference phase. In addition, the translation model can generate multiple predicted translation results during the inference phase. However, the translation model trained based on the above method can only evaluate the probability of the occurrence of the multiple predicted translation results, and cannot measure the translation quality of the multiple predicted translation results.
[0285] Table 1 shows the accuracy of four predicted translation results generated by beam search using the multilingual bidirectional and auto-regressive transformers (mBART) model on the dataset wmt2017 English to Romanian released at the 2017 workshop on machine translation (WMT).
[0286] Table 1
[0287] Model F-acc L-acc FL acc mBART 0.4 0.47 0.69
[0288] Exemplarily, for a source sequence, if the BLEU score of the first predicted translation result is the maximum value among the BLEU scores of the four predicted translation results, that is, the translation quality of the first predicted translation result is the highest, then the first predicted translation result can be considered to be accurate. The first predicted translation result is the predicted translation result with the highest probability of appearing in the four predicted translation results. If the BLEU score of the last predicted translation result is the minimum value among the BLEU scores of the four predicted translation results, that is, the translation quality of the last predicted translation result is the lowest, then the last predicted translation result can be considered to be accurate. The last predicted translation result is the predicted translation result with the lowest probability of appearing in the four predicted translation results. The first accuracy (first accuracy, F-acc) represents the proportion of the first predicted translation result on the data set that is accurate, that is, the accuracy of the first predicted translation result. The final accuracy (last accuracy, L-acc) represents the proportion of the last predicted translation result on the data set that is accurate, that is, the accuracy of the last predicted translation result. The first last accuracy (FL acc) indicates the proportion of cases where the BLEU score of the first predicted translation result on the dataset is greater than the BLEU score of the last predicted translation result.
[0289] As can be seen from the table above, the F-acc is only 0.4, which means that the probability that the first predicted translation result is correct on this dataset is only 0.4. In other words, the proportion of the highest quality translations with the highest probability of predicted translation results is only 0.4. It can be seen that the ranking given by this translation model cannot accurately measure the translation quality.
[0290] The embodiment of the present application provides a method for optimizing a translation model, which optimizes the translation model based on the translation quality ranking of multiple candidate translation results, thereby alleviating the problem of exposure bias and facilitating improving the performance of the model in the reasoning stage.
[0291] Figure 6 A schematic flow chart of a translation model optimization method provided in an embodiment of the present application is shown. Figure 6 The method shown can be executed by a cloud service device or a terminal device, such as a computer, a server, a vehicle, a mobile phone, etc., or a system composed of a cloud service device and a terminal device. Figure 6 The method 600 shown may be performed by Figure 1 or Figure 2 For example, method 600 may be performed by Figure 1 The data processing device in (a) is executed. For another example, the method 600 may be performed by Figure 1The method 600 may be performed by the intelligent terminal in (b). Figure 1 The execution device 110 or the local device 101 / 102 in (c) is executed. For example, the method 600 may be performed by Figure 2 The training device 220 in is executed.
[0292] Method 600 may include steps 610 to 630. Figure 6 The method 600 is described.
[0293] 610, obtaining a training data set #1, where the training data set #1 includes at least one training data, including a source sequence, a reference translation result of the source sequence, and a reference ranking of multiple candidate translation results of the source sequence.
[0294] 620 , input the source sequence and the multiple candidate translation results into the initial translation model for processing to obtain a first predicted translation result of the source sequence and predicted probabilities of the multiple candidate translation results.
[0295] 630, adjusting the parameters of the initial translation model with the goal of reducing the function value of the loss function. The loss function is based on a second loss function. The second loss function is used to indicate the difference between the reference ranking and the predicted ranking of the plurality of candidate translation results. The predicted ranking of the plurality of candidate translation results is obtained based on the predicted probabilities of the plurality of candidate translation results.
[0296] Further, the loss function is based on a first loss function and a second loss function. The first loss function is used to indicate the difference between the first predicted translation result and the reference translation result.
[0297] For ease of description, in this embodiment of the present application, the training data in training data set #1 is referred to as training data #1.
[0298] The reference translation result may also be referred to as a reference sequence. The candidate translation result may also be referred to as a candidate sequence. The predicted translation result may also be referred to as a predicted sequence.
[0299] The language of the source sequence is the source language. The language of the translation result is the target language. The source language and the target language are different.
[0300] The initial translation model can be obtained in many ways.
[0301] For example, the initial translation model may be obtained by training with training data set #2. Training data set #2 may include a large amount of training data. For ease of description, the training data in training data set #2 is referred to as training data #2. Training data #2 may include a source sequence and a reference translation result of the source sequence. The source sequence and the reference translation result are in different languages. The training data may also be referred to as bilingual training data.
[0302] The source sequence and the reference translation result of the source sequence in training data #2 may be the same as or different from the source sequence and the reference translation result of the source sequence in training data #1. For example, the source sequence and the reference translation result of the source sequence in training data set #1 may be partially or completely derived from the source sequence and the reference translation result of the source sequence in training data set #2. Alternatively, the source sequence and the reference translation result of the source sequence in training data set #1 may be independent of the source sequence and the reference translation result of the source sequence in training data set #2.
[0303] For another example, the initial translation model can be obtained by fine-tuning a pre-trained language model.
[0304] For another example, the initial translation model may also be a model obtained through training by the method 600. In other words, the translation model may be continuously adjusted based on new training data so that the translation model can be continuously optimized and better adapted to the current application scenario.
[0305] It should be understood that the above is only an example, and the initial translation model can also be obtained by other means, which is not limited in the embodiments of the present application.
[0306] The first predicted translation result is exemplarily described below.
[0307] The source sequence is input into the initial translation model for processing, and one or more predicted translation results are output.
[0308] If the initial translation model only outputs one predicted translation result, then the predicted translation result is the first predicted translation result.
[0309] Exemplarily, the predicted translation result may be obtained by inputting the source sequence into an initial translation model through a greedy algorithm.
[0310] If the initial translation model outputs a plurality of predicted translation results, the plurality of predicted translation results include the first predicted translation result.
[0311] Exemplarily, the multiple predicted translation results may be multiple predicted translation results that are most likely to be output by inputting the source sequence into the initial translation model and obtaining them through beam search.
[0312] For example, the first predicted translation result may be the predicted translation result with the highest probability output by the initial translation model among the multiple predicted translation results. For another example, the first predicted translation result may be the predicted translation result with the highest predicted probability among the multiple predicted translation results. That is, the predicted probabilities of the multiple predicted translation results are calculated respectively, and the predicted translation result with the highest predicted probability is selected as the first predicted translation result.
[0313] The multiple candidate translation results are exemplarily described below.
[0314] Exemplarily, the multiple candidate translation results may be multiple predicted translation results obtained by inputting the source sequence into the initial translation model for processing in advance.
[0315] In this case, the first predicted translation result may also be determined based on the user's feedback data. For example, the first predicted translation result may be a selection result of the user from the multiple candidate translation results.
[0316] Alternatively, the multiple candidate translation results may be multiple predicted translation results obtained by inputting the source sequence into other translation models other than the initial translation model for processing.
[0317] For example, the parameters of translation model A are adjusted to obtain translation model B. Method 600 is used to adjust the parameters of translation model B to obtain translation model C. That is, translation model B is used as the initial translation model. The multiple candidate translation results of the source sequence can be multiple predicted translation results obtained by inputting the source sequence into translation model A for processing.
[0318] Alternatively, the multiple candidate translation results may also be manually set.
[0319] It should be understood that the above is only an example, and the multiple candidate translation results can also be obtained by other means, which is not limited in the embodiments of the present application.
[0320] The reference ranking of the multiple candidate translation results is exemplarily described below.
[0321] The reference ranking of the multiple candidate translation results is used to reflect the translation quality ranking of the multiple candidate translation results. Exemplarily, the reference ranking of the multiple candidate translation results is arranged from front to back in the order of the translation quality of the multiple candidate translation results from high to low. For ease of description, the application is only described as an example, and the solution of the embodiment of the application is not limited.
[0322] As a possible implementation manner, the reference ranking of the multiple candidate translation results may be determined based on the similarities or differences between the multiple candidate translation results and the reference translation result.
[0323] Exemplarily, the reference ranking of the plurality of candidate translation results may be determined based on BLEU scores between the plurality of candidate translation results and a reference translation result.
[0324] The above is only an example, and the reference ranking of the multiple candidate translation results may also be determined based on other indicators that can measure translation quality.
[0325] As another possible implementation, the reference ranking of the plurality of candidate translation results may be determined based on user feedback data, which includes the user's ranking result of the plurality of candidate translation results or the user's selection result of the plurality of candidate translation results.
[0326] Exemplarily, after the translation model is put into operation, the user inputs a query request, which is used to request the sequence to be translated to be translated. In an embodiment of the present application, the sequence to be translated may also be referred to as content to be translated. The translation model may output N predicted translation results. The sequence to be translated may be used as a source sequence, and the N predicted translation results may be used as N candidate translation results of the source sequence. The user may sort the multiple candidate translation results, so that the system may obtain the user's sorting results for the multiple candidate translation results. The sorting results may reflect the sorting of the translation quality that the user believes. Alternatively, the user may select the multiple candidate translation results, that is, the user selects the one that the user believes to be the highest translation quality from the multiple candidate translation results, so that the system may obtain the user's selection results for the multiple candidate translation results. For example, the translation model may be an initial translation model. That is, the initial translation model is put into operation, and the user's feedback data is obtained, and the user's feedback data may be used to determine training data #1, and then the parameters of the initial translation model are adjusted based on the training data #1. For specific examples, reference may be made to method 800 in the following text, which will not be described in detail here. Alternatively, the translation model may also be other translation models other than the initial translation model.
[0327] For example, the user's feedback data can be obtained through Figure 4 or Figure 5 The interactive method shown is obtained.
[0328] Optionally, the ranking result of the multiple candidate translation results by the user may be used as a reference ranking of the multiple candidate translation results.
[0329] Exemplarily, the reference ranking of the plurality of candidate translation results may be obtained by a user adjusting positions of some of the candidate translation results in the ranking result of the plurality of candidate translation results.
[0330] Optionally, the reference ranking of the multiple candidate translation results can be obtained based on the reference probabilities of the multiple candidate translation results. Among the multiple candidate translation results, the reference probability of the candidate translation result selected by the user (i.e., the selected result) is higher than the reference probabilities of other candidate translation results. Among the multiple candidate translation results, the higher the reference probability of a candidate translation result, the higher the translation quality corresponding to the candidate translation result in the reference ranking.
[0331] For example, the reference probabilities of the multiple candidate translation results and the reference translation result may satisfy the following formula:
[0332] p true (G user_choosed |S)>p true (G others |S);
[0333] p true (G|S) represents the reference probability of G. S represents the source sequence. G represents the candidate translation result. user_choosed Indicates the user's selection result, G others Indicates the remaining candidate translation results among multiple candidate translation results except the result selected by the user.
[0334] Exemplarily, in the reference ranking of the plurality of candidate translation results, the user's selection result may be located before other candidate translation results. For example, the positions of the other candidate translation results in the reference ranking may be the same. For another example, the positions of the other candidate translation results in the reference ranking may be determined in other ways, for example, the positions of the other candidate translation results in the reference ranking may be determined by the BLEU scores between the other candidate translation results and the reference translation results.
[0335] The predicted probabilities of the multiple candidate translation results are described below.
[0336] The predicted probability of the translation result may be determined based on the probability of the translation model outputting the words in the translation result.
[0337] Optionally, the predicted probability of each candidate translation result in the plurality of candidate translation results may be determined based on a probability of a word in each candidate translation result output by the initial translation model.
[0338] Exemplarily, the predicted probability of the candidate translation result can be calculated by logarithmically summing the probabilities of the words output by the initial translation model and then normalizing the length. The predicted probability of the candidate translation result can also be called the overall probability of the sentence. The predicted probability of the candidate translation result can satisfy the following formula:
[0339]
[0340] Where G represents any candidate translation result among multiple candidate translation results, Z(G) represents the predicted probability of candidate translation result G, and g t represents the tth word in the candidate translation result G, g <t represents the word before the tth word in the candidate translation result G, S represents the source sequence, l represents the number of words in the candidate translation result G, and l is an integer greater than 1. θ represents the parameters of the translation model, f θ represents the translation model with parameter θ, represents f θWhen the input is S and g <t Output g in the case of t The conditional probability of |G| represents the length of the candidate translation result G, that is, the number of words l in the candidate translation result G, and α is the length penalty hyperparameter, which is used to represent the penalty for the length of the candidate translation result G. The larger α is, the higher the predicted probability of the shorter candidate translation result may be, that is, the translation model tends to translate the source sequence into a shorter sequence. For example, α = 0.7.
[0341] Replacing the candidate translation results in the above formula with the predicted translation results can be used to determine the predicted probabilities of the N predicted translation results of the source sequence. For example, the source sequence is input into the initial translation model for processing to obtain the N predicted translation results of the source sequence. The predicted probabilities of the N predicted translation results of the source sequence can be determined in the above manner.
[0342] After the training is completed, the sequence to be translated is input into the target translation model for processing to obtain N predicted translation results of the sequence to be translated. The predicted probabilities of the N predicted translation results of the sequence to be translated can be determined in the above manner, as long as the relevant parameters of the initial translation model in the formula are replaced with the relevant parameters of the translation model #2, the relevant parameters of the candidate translation results are replaced with the relevant parameters of the predicted translation results, and the relevant parameters of the source sequence are replaced with the relevant parameters of the sequence to be translated.
[0343] The predicted probability of the candidate translation result can measure the overall probability of the sequence from the perspective of the entire sentence (ie, sequence), rather than considering the probability of a single word locally.
[0344] The loss function is explained below.
[0345] The first loss function is used to indicate the difference between the first predicted translation result and the reference translation result, and can be used to measure the generative ability of the model. Adjusting the parameters of the initial translation model with the goal of reducing the function value of the first loss function can make the output of the model (i.e., the first predicted translation result) during the training process continuously approach the reference translation result, thereby improving the generative ability of the model. The first loss function can also be called a generative loss function.
[0346] Optionally, the first loss function may satisfy the following formula:
[0347]
[0348] Among them, the reference translation result G* can be expressed as a word sequence n represents the number of words in the reference translation result, and n is a positive integer. represents f θ At input S and Output g under the condition t'Probability. g t ' indicates f θ Output the tth word. g * <t It represents the word before the tth word in the reference translation result. g' represents the word that the model may output, that is, the word in the dictionary.
[0349] p true (g t '|S,g * <t ) can satisfy the following formula:
[0350] p true (g t '|S,g * <t )=1-εg t '=g * t
[0351] ∑p true (g t '|S,g * <t )=εg t '≠g * t
[0352] Represents the tth word in the reference translation result. ε is a hyperparameter, ε>0. 1-ε is much larger than ε. For example, ε can be 0.1.
[0353] In the above formula, the probability is determined by soft labeling. The words in the reference translation result are assigned a larger probability of 1-ε, and the remaining words are also assigned a certain probability. The probability of the remaining words is p true The sum is ε. That is, when the t-th word output by the model is the same as the t-th word in the reference translation result, the corresponding p true When the tth word output by the model is different from the word in the reference translation result, the corresponding p true The sum is ε.
[0354] It should be understood that the above is only an example and does not limit the solution of the embodiment of the present application. The first loss function can also be expressed in other forms as long as it can indicate the difference between the first predicted translation result and the reference translation result.
[0355] The second loss function is used to indicate the difference between the reference ranking of the multiple candidate translation results and the predicted ranking of the multiple candidate translation results, and can be used to measure the model's ability to evaluate translation quality. The predicted ranking of multiple candidate translation results is obtained based on the predicted probability of multiple candidate translation results, and the reference ranking of the multiple candidate translation results can reflect the translation quality. In an embodiment of the present application, the second loss function is introduced in the loss function, that is, the function value of the second loss function is reduced as a training target during the training process, or in other words, the difference between the predicted ranking and the reference ranking is reduced as a training target, so that the predicted ranking of the multiple candidate translation results output by the model is constantly close to the reference ranking, that is, the higher the translation quality, the higher the predicted probability of the candidate translation result. In this way, when the model is predicted, it is not only the reference translation result that is given the probability 1, but the probability distribution can be realized according to the translation quality, and it is conducive to making the candidate translation result with higher translation quality obtain a higher predicted probability, and improve the model's ability to evaluate translation quality. The second loss function can also be called a ranking loss function.
[0356] In a possible implementation, in the reference ranking, the multiple candidate translation results are arranged in descending order of translation quality. For example, in the reference ranking, the candidate translation result with higher translation quality has a higher ranking and a lower corresponding ranking number. j represents the candidate translation result at position j in the reference ranking, G i represents the candidate translation result at position i in the reference ranking. i is a non-negative integer, j is a non-negative integer. In the case of j>i, in the reference ranking, G i The corresponding translation quality is higher than G j The above training goal can be understood as making the prediction probability of the candidate translation result with a smaller ranking number as high as possible.
[0357] Exemplarily, the reference ranking of the plurality of candidate translation results may be determined based on the ranking result of the user. In this case, the candidate translation result with a higher ranking has a smaller corresponding ranking number.
[0358] Exemplarily, the reference ranking of the plurality of candidate translation results may be determined based on the user's selection result. In this case, in the reference ranking of the plurality of candidate translation results, the user's selection result may be located before other candidate translation results, that is, the ranking number corresponding to the user's selection result is smaller than the ranking numbers corresponding to other candidate translation results. The positions of other candidate translation results in the reference ranking may be the same, that is, the ranking numbers corresponding to other candidate translation results may be the same.
[0359] Optionally, the second loss function may satisfy the following formula:
[0360]
[0361] Among them, L reorder represents the second loss function, G j represents the candidate translation result at position j in the reference ranking, G i represents the candidate translation result at position i in the reference ranking, Z(G j ) represents G j The predicted probability, Z(G i ) represents G i The predicted probability, λ ij Represents G j and G i The adjustment parameters between .
[0362] λ ij The following formula can be satisfied:
[0363] λ ij =λ*Z(G j );
[0364] λ is a hyperparameter. Exemplarily, the value range of λ may be [0, 1], for example, λ=0.1.
[0365] Next, the second loss function L reorder The above formula is explained.
[0366] In the reference sorting G i Located in G j Before, G. i The corresponding translation quality is higher than G j The corresponding translation quality. If Z(G i ) is greater than Z(G j ), then in the prediction ranking G i Located in G j Before, G i and G j The order and G in the reference sort i and G j The order in the predicted ranking is consistent, and the ranking loss between the two candidate translation results may be 0. i ) is less than Z(G j ), then in the prediction ranking G i Located in G j After that, G i and G j The order and G in the reference sort i and G j The order in the prediction ranking is different, and there is a ranking loss between the two candidate translation results, that is, Z(G j )-Z(G i )+λij .
[0367] It should be understood that the above formula is only an example and does not limit the solution of the embodiment of the present application. For example, if j>i, in the reference sorting, G i The corresponding translation quality is lower than G j The corresponding translation quality, then Z(G j )-Z(G i )+λ ij Can be adjusted to Z(G i )-Z(G j )+λ ij ,λ ij Adjustments can be made accordingly.
[0368] Exemplarily, the function value of the loss function may be based on the sum of the function value of the first loss function and the function value of the second loss function.
[0369] For example, the loss function L can satisfy the following formula:
[0370] L=L trans +L reorder ;
[0371] For example, the loss function L can satisfy the following formula:
[0372] L=βL trans +(1-β)L reorder ;
[0373] β represents the weight corresponding to the first loss function. The value range of β is (0,1).
[0374] It should be understood that the above is only an example, and the loss function can also be expressed in other forms, which is not limited in the embodiments of the present application.
[0375] The above process of adjusting the parameters of the model may be an iterative process, during which the parameters of the model are continuously adjusted until the adjustment is completed to obtain a target translation model.
[0376] In an embodiment of the present application, the loss function is based on a generation loss function and a ranking loss function, and the ranking loss function is conducive to ensuring that the model learns an evaluation method for translation quality during the fine-tuning stage, and the generation loss function is conducive to ensuring the translation ability of the model. The target translation model obtained after such adjustment can be used as a generation model and an evaluation model at the same time, for generating multiple predicted translation results, and scoring multiple predicted translation results, and the scoring can be determined based on the prediction probability of the multiple predicted translation results. The model can select some or all of the predicted translation results from the multiple predicted translation results based on the scores of the multiple predicted translation results. At the same time, the ranking loss is used together with the generation loss function to adjust the model parameters to form a multi-task learning framework, which prompts the model to be biased towards a non-fixed target distribution training method, which is conducive to alleviating the exposure bias problem, thereby improving the performance of the model.
[0377] In addition, in the solution of the embodiment of the present application, the user's feedback data can be used as training data. For example, the user's ranking results and feedback results can be used as training data. In this way, the model can be continuously adjusted based on the user's feedback data, and the problem of mismatch between the training data and the data distribution in the application scenario can be gradually corrected, thereby achieving continuous optimization of the model, improving the translation quality, and thus improving the user experience. This solution is adapted to the existing model framework. At the same time, the user's ranking results and feedback results can be used as training data, which is conducive to reducing the dependence on annotation personnel.
[0378] Figure 7 A schematic diagram of a loss function provided in an embodiment of the present application is shown.
[0379] like Figure 7 The initial translation model may include an encoder and a decoder. Figure 7 The two decoders in are actually the same decoder. In order to express the loss function more intuitively, they are expressed as two decoders outputting different candidate translation results.
[0380] Figure 7 Two candidate translation results are shown. The two candidate translation results may be two predicted translation results obtained by inputting the source sequence into the initial translation model, namely, the first predicted translation result and the second predicted translation result. Figure 7 As shown, the predicted translation result selected by the user can be used as the first predicted translation result, and the second predicted translation result is other candidate translation results. Alternatively, the first predicted translation result can also be determined in other ways. The first loss function is used to indicate the difference between the reference translation result and the first predicted translation result selected by the user. The second loss function is used to indicate the difference between the reference ranking and the predicted ranking of the two predicted translation results.
[0381] It should be understood that Figure 7 This is only an example and does not limit the solution of the embodiment of the present application. For example, the initial translation model can also output more predicted translation results.
[0382] The target translation model can be deployed online to process the user's query request. The user's query request includes a sequence to be translated. The target translation model can output N predicted translation results of the sequence to be translated. For example, the N predicted translation results can be the N predicted translation results with the highest probability of being output by the target translation model obtained through beam search. The predicted ranking of the N predicted translation results can be obtained based on the predicted probabilities of the N predicted translation results. The predicted probabilities of the N predicted translation results can also be called the translation confidence of the N predicted translation results.
[0383] The predicted probability of the predicted translation result is determined based on the probability of the target translation model outputting the words in the predicted translation result. The specific description can be referred to above and will not be repeated here.
[0384] Furthermore, the target translation model may also output scores of the N predicted translation results, where the scores of the N predicted translation results are obtained based on the prediction probabilities of the N predicted translation results.
[0385] Exemplarily, the scores of the N predicted translation results are positively correlated with the prediction probabilities of the N predicted translation results.
[0386] For example, the prediction probabilities of the N predicted translation results may be used as scores of the N predicted translation results.
[0387] In this way, the higher the score of the predicted translation result is, the higher the translation quality of the predicted translation result judged by the target translation model is.
[0388] Figure 8 A schematic diagram of a translation process provided by an embodiment of the present application is shown. It should be understood that Figure 8 The translation process shown is only a possible implementation method and does not limit the solution of the embodiment of the present application.
[0389] like Figure 8 As shown, Figure 8 The translation process shown includes the following steps.
[0390] 810, training a translation model #1 based on the training data set #2.
[0391] Translation model #1 may be used as an initial translation model in method 600 .
[0392] Step 810 is only an example. In other implementations, translation model #1 may be obtained in other ways. For example, translation model #1 may be received from other devices. Other acquisition methods may refer to the acquisition method of the initial translation model in method 600, which will not be described in detail here.
[0393] Exemplarily, step 810 may be performed in the cloud.
[0394] 820, sort and fine-tune translation model #1 to obtain translation model #2.
[0395] Translation model #2 may be used as the target translation model obtained by method 600. For example, translation model #1 is fine-tuned based on the second loss function to obtain translation model #2.
[0396] Exemplarily, training data set #1 can be obtained in the following manner.
[0397] The source sequences in all or part of the training data in the training data set #2 are processed using the translation model #1. For each source sequence, the first N predicted translation results obtained based on the beam search are retained, that is, the N predicted translation results that are most likely to be output. N is an integer greater than 1. The N predicted translation results can be used as the N candidate translation results in method 600. For each source sequence, the BLEU score between the N predicted translation results and the reference translation result of the source sequence is used as a measure of the translation quality of the N predicted translation results, and a reference ranking of the N predicted translation results is obtained. The reference ranking can be used to fine-tune the ranking of the translation model #1.
[0398] It should be understood that the above is only an example, and training data set #1 can also be obtained by other means. For example, when determining the reference ranking of the N predicted translation results, the BLEU score can be replaced by other indicators that can measure the translation quality. For another example, the source sequence in training data set #1 can also be different from the source sequence in training data set #2.
[0399] Exemplarily, step 820 may be performed in the cloud.
[0400] 830, deploy the translation model #2 to the corresponding device for execution.
[0401] That is, translation model #2 is put into operation.
[0402] The translation model #2 can process the user's query request and output the corresponding processing result. The user's query request includes a sequence to be translated. The processing result can include N predicted translation results corresponding to the query request.
[0403] The N predicted translation results may be the first N predicted translation results obtained based on the beam search.
[0404] Furthermore, translation model #2 may also output scores of N predicted translation results, which scores may be prediction probabilities of the N predicted translation results.
[0405] Exemplarily, the N predicted translation results can be sorted based on the predicted probabilities of the N predicted translation results. The predicted probability of each predicted translation result can be determined based on the probability of the words in the predicted translation result output by translation model #2. The determination method of the predicted probability of the predicted translation result can refer to the determination method of the predicted probability of the candidate translation result in method 600. For example, the predicted probabilities of the N predicted translation results can be determined with reference to the relevant formula of Z(G), as long as the relevant parameters of the initial translation model in the formula are replaced with the relevant parameters of translation model #2, the relevant parameters of the candidate translation result are replaced with the relevant parameters of the predicted translation result, and the relevant parameters of the source sequence are replaced with the relevant parameters of the sequence to be translated.
[0406] For example, Fig. 9 As shown, the sequence to be translated in the query request input by the user is "He wants to play Amy's baby". Translation model #2 outputs 3 predicted translation results and their scores, that is, N=3.
[0407] Exemplarily, translation model #2 may also be deployed on a cloud device for execution. The cloud device may obtain the user's query request from the local device and return the corresponding processing result.
[0408] Alternatively, if Figure 8 As shown, the cloud can deploy translation model #2 to the local device, and the local device obtains the user's query request and returns the corresponding processing result. For the sake of distinction, the model on the local device is called the local model. For the sake of ease of description, the embodiment of the present application is only used as an example for illustration, and does not limit the solution of the embodiment of the present application.
[0409] When method 800 does not include step 820 , in step 830 , translation model # 1 may be deployed to a corresponding device for execution.
[0410] 840, providing feedback prompts and obtaining user feedback data.
[0411] Exemplarily, a feedback prompt may be provided to guide the user to provide feedback in any one of the following feedback modes: sorting feedback, selecting feedback, or modifying feedback.
[0412] exist Fig. 9In the scenario shown, the user can be guided to provide feedback in any of the following ways: sorting feedback, selection feedback, or modification feedback. The user provides feedback in the ways of selection feedback and modification feedback. As Fig. 9 shown, the user selects the third predicted translation result and modifies some words in the third predicted translation result. The feedback data of the user can be used as training data for subsequent optimization of the translation model #2. For example, the translation model #2 is optimized using method 600. As Fig. 9 shown, the optimized translation model #2 outputs 3 predicted translation results and their scores.
[0413] For the specific guiding method, reference can be made to the solutions shown in Figure 4 , Figure 5 or Fig.10 . To avoid repetition, it will not be elaborated here.
[0414] It should be understood that step 840 is only an example. In other implementation manners, the user may not be guided to provide feedback, and the user may provide feedback actively by himself / herself.
[0415] After the translation model #2 is deployed to a local device, a local database can be established for the user. This local database can also be referred to as a local word-level translation knowledge base, a local intervention library, or a local word-level intervention library.
[0416] After the user provides feedback, the feedback data of the user can be saved to the local database.
[0417] Exemplarily, the user provides feedback in the way of modification feedback, that is, the user modifies some words in the predicted translation result. In this case, the modified words of the user and the words in the corresponding query request can be saved to the local database. Further, a corresponding confidence level can be set for the words modified by the user. For example, this confidence level can be the score of the predicted translation result modified by the user. This local database is the local database containing the confidence level.
[0418] For example, as Fig. 9 shown, the user modifies "埃米" to "艾米", and this word corresponds to "Amy" in the query request. Save Amy and 艾米 to the local database, and set a confidence level for Amy and 艾米. The predicted translation result modified by the user is the third predicted translation result, and its score is 0.75. Then the confidence level of Amy and 艾米 in the local database can be 0.75.
[0419] Exemplarily, the feedback data of the user can take effect immediately ( Figure 8 hot intervention in
[0420] For example, if the user provides feedback in the form of modified feedback, if Amy is included in subsequent query requests, it can be translated into Amy.
[0421] Exemplarily, after a user inputs a query request, the system may display at least one predicted translation result of the query request. Obtain user feedback data on the at least one predicted translation result. Obtain the query request of the user again, adjust the at least one predicted translation result of the query request according to the user's feedback data, and display the adjusted at least one predicted translation result.
[0422] For example, when a user provides feedback by selecting feedback, if the user inputs the query request again, the user's selection result can be displayed. Fig. 9 For example, when the user enters "He wants to play Amy's baby" for the first time, the model outputs three predicted translation results. The system can display "He wants to play Amy's baby" and prompt the user to provide feedback. After obtaining the user's feedback data, if the user enters the query request again, the system can display "He wants to play Amy's baby".
[0423] For another example, when the user provides feedback in the form of ranking feedback, if the user inputs the query request again, the user's ranking result may be displayed.
[0424] Exemplarily, it may be determined whether the user's feedback data is effective in the next query request based on the user's user profile and / or the translation confidence corresponding to the query request.
[0425] For example, if the translation confidence corresponding to the query request is high, the user's feedback data will not take effect in the next query request. If the translation confidence corresponding to the query request is low, the user's feedback data will take effect in the next query request.
[0426] For another example, if the user's user profile is a high-quality contributor, the user's feedback data will take effect in the next query request. If the user's user profile is an ordinary user, the user's feedback data will not take effect in the next query request.
[0427] For a detailed description of the user portrait, please refer to the relevant description in method 1200 below, which will not be described in detail here.
[0428] Furthermore, user feedback data can be uploaded to the cloud.
[0429] Exemplarily, the words modified by the user in the local database can be uploaded to the cloud database. The confidence level corresponding to each word can be set in the cloud database.
[0430] The cloud database may also be referred to as a cloud word-level translation knowledge base, a cloud intervention base, or a cloud word-level intervention base.
[0431] The confidence level corresponding to each word in the cloud database may be determined based on the confidence levels corresponding to the word in the local databases of multiple users.
[0432] For example, the confidence corresponding to each word in the cloud database can be obtained by weighted average of the confidence corresponding to the word in the local databases of multiple users. The weight of the confidence corresponding to the word in each user's local database can be based on the user profile of the user. For example, the higher the quality of the user's feedback, the higher the weight of the confidence of the word in the user's local database.
[0433] like Fig. 9 As shown, the data in the local database can be synchronized to the cloud database, and the confidence level is set to 0.8.
[0434] The user feedback data can be used to determine new training data for fine-tuning the translation model #2.
[0435] For example, if the user provides feedback in the form of selection feedback or ranking feedback, the feedback data can be used as new training data to fine-tune the translation model #2.
[0436] In this case, translation model #2 can be used as the initial translation model in method 600, that is, translation model #2 is fine-tuned using method 600. For example, translation model #2 is fine-tuned based on the second loss function. Part or all of the training data in training data set #2 can be determined based on user feedback data. Specifically, the reference ranking of multiple candidate translation results in each training data in the part or all of the training data can be determined based on the user's ranking result or selection result. For example, the sequence to be translated in the user's query request can be used as the source sequence in the training data, and the N predicted translation results output by translation model #2 can be used as the N candidate translation results of the source sequence. The user's ranking result of the N predicted translation results can be used as a reference ranking of the N candidate translation results. The specific description can refer to method 600, which will not be repeated here.
[0437] Exemplarily, when method 800 does not include step 820 , the user's feedback data may be used as new training data to fine-tune translation model # 1 .
[0438] In this case, translation model #1 can be used as the initial translation model in method 600. For a detailed description, reference can be made to method 600, which will not be repeated here.
[0439] Exemplarily, the feedback data of all users can be used to determine new training data. For example, the fine-tuning process can be performed by the cloud, in which case the feedback data of all users can be uploaded to the cloud.
[0440] Alternatively, the feedback data of some users can be used to determine new training data. For example, the fine-tuning process can be performed by the cloud. In this case, the feedback data of the part of users can be uploaded to the cloud. Alternatively, the feedback data of all users can be uploaded to the cloud, and the cloud selects the feedback data of some users from the feedback data of all users to determine new training data.
[0441] The specific method for determining the feedback data of this part of users can refer to method 1200 described later, which will not be described in detail here.
[0442] 860, retention data.
[0443] exist Figure 3 In the scheme shown, the error cases cannot be identified and corrected by randomly retaining the existing network data.
[0444] In step 860, data can be retained in a variety of ways. Exemplarily, when the scores of the N predicted translation results of a query request are less than or equal to threshold #1, the query request is saved. For example, when the highest score of the N predicted translation results of a query request is less than or equal to threshold #1, the query request is saved.
[0445] In the solution of the embodiment of the present application, translation model #2 can output the scores of the N predicted translation results, that is, the translation quality of the predicted translation results can be evaluated. If the score of the predicted translation result is low, translation model #2 can determine that the translation quality of the predicted translation result is poor, which is conducive to identifying wrong examples so that they can be modified later.
[0446] For example, for a query request, if the user provides feedback, the query request and the user's feedback data are saved, which is helpful for identifying wrong examples so that they can be modified later.
[0447] For example, for a query request, if the user's evaluation of the translation result is poor, the query request can be saved, which is helpful for identifying wrong examples so that they can be modified later.
[0448] It should be understood that the above is only an example, and the existing network data can also be retained in other ways, which is not limited in the embodiments of the present application.
[0449] For the saved query request, translation model #2 can output the N predicted translation results for the annotator to process and obtain the annotated data. For example, the annotator can select the best result among the N predicted translation results, that is, the translation result with the highest translation quality determined by the annotator. For another example, the annotator can modify some words in the N predicted translation results. The annotated data can be used to determine new training data for fine-tuning translation model #2. If the user's feedback data is saved, the annotator can also determine whether the user's feedback data can be used as new training data.
[0450] In this case, translation model #2 can be used as the initial translation model in method 600, that is, method 600 is used to fine-tune translation model #2. Part or all of the training data in training data set #2 can be determined based on the annotation data. Exemplarily, the reference ranking of multiple candidate translation results in each of the part or all of the training data can be determined based on the annotation data. For example, the sequence to be translated in the saved query request can be used as the source sequence in the training data, and the N predicted translation results output by translation model #2 can be used as the N candidate translation results of the source sequence. The selection result of the annotation personnel on the N predicted translation results can be used as the candidate translation result with the highest translation quality in the reference ranking of the N candidate translation results. Alternatively, the reference translation result in each of the part or all of the training data can be determined based on the annotation data. The specific description can refer to method 600, which will not be repeated here.
[0451] It should be understood that the above is only an example and does not limit the solution of the embodiment of the present application. For example, part or all of the training data in training data set #2 can be determined based on the labeled data and the user's feedback data. Figure 8 As shown, the annotation data of the annotators and the feedback data of the users can be used to fine-tune the translation model #2.
[0452] It should be noted that step 860 is an optional step. When method 800 does not include step 860, part or all of the training data in training data set #2 may be determined based on user feedback data.
[0453] In actual translation scenarios, some users are willing to provide feedback on translation results, but are unwilling to find a feedback entry point. The feedback entry point in the relevant solution is deep, and these users may not provide feedback in the end.
[0454] The solution of the embodiment of the present application provides a translation method that actively guides users to provide feedback, which can increase the possibility of users providing feedback on translation results, thereby increasing the amount of feedback data collected, which is conducive to subsequent continuous optimization of the translation model.
[0455] Fig.10 A schematic flow chart of a translation method provided in an embodiment of the present application is shown.
[0456] For example, Fig.10 The method 1000 shown can be applied to Figure 8 Specifically, method 1000 can be applied to the process of online operation of translation model #2.
[0457] Method 1000 may also be applied to other translation scenarios, which is not limited in the embodiments of the present application.
[0458] The method 1000 includes the following steps, and the method 1000 is described below.
[0459] 1010, obtaining a user's query request.
[0460] The query request includes the sequence to be translated.
[0461] 1020, determining a target feedback method according to at least one of the following: a user profile of the user, a translation confidence corresponding to the query request, or an application scenario of the method. The target feedback method may include any one of the following: sorting feedback, selection feedback, or modification feedback.
[0462] If the target feedback mode is based on the translation confidence corresponding to the query request, the method 1000 may further include: obtaining the translation confidence corresponding to the query request.
[0463] Exemplarily, the translation confidence corresponding to the query request may be the translation confidences of N predicted translation results of the query request.
[0464] For example, the translation confidence corresponding to the query request can be indicated by the highest score of the N predicted translation results of the query request. The score of the predicted translation result is the translation quality of the predicted translation result judged by the target translation model. The target translation model is the model used to output the scores of the N predicted translation results. Figure 8 For example, the sequence to be translated is input into translation model #2 for processing, and translation model #2 can output N predicted translation results of the query request and the scores corresponding to the N predicted translation results. The highest score can be used as the translation confidence corresponding to the query request.
[0465] Exemplarily, the target translation model may be a target translation model obtained by method 600 . The specific description of predicting the score of the translation result may refer to method 600 , which will not be described in detail here.
[0466] Exemplarily, the translation confidence corresponding to the query request may be determined by a BLEU score between N predicted translation results of the query request and a reference translation result.
[0467] For example, the translation confidence corresponding to the query request may be the maximum BLEU score between the N predicted translation results of the query request and the reference translation result.
[0468] Exemplarily, the N predicted translation results of the query request may be the N predicted translation results with the highest probability obtained by beam search, and the maximum value of the probability of the N predicted translation results appearing in the beam search may be used as the translation confidence corresponding to the translation request.
[0469] If the target feedback method is based on the user's user portrait, method 1000 may further include: obtaining the user portrait of the user.
[0470] 1030 , display prompt information, where the prompt information is used to prompt the user to provide feedback on at least one predicted translation result of the query request in a target feedback manner.
[0471] For example, method 1000 may adopt Figure 4 or Figure 5 The interaction method shown.
[0472] In different application scenarios, users have different degrees of acceptance of various feedback methods.
[0473] In application scenarios such as translation apps or webpage translation, the main demand of users is to understand the meaning of the translation results, and users are less willing to modify the translation results, that is, users are less likely to choose to modify this feedback method. In this case, users can be guided to use the method of selecting feedback or sorting feedback.
[0474] In application scenarios such as input method apps, the main reason users use the translation function is to communicate with users of other languages or write documents, and users are more willing to modify the translation results, that is, users are more likely to choose to modify this feedback method. In this case, users can be guided to use the modification feedback method.
[0475] Fig.11 Figure 2 shows a schematic diagram of two feedback methods. Fig.11 In (a), user #1 enters query request #1 in application scenario #1 (e.g., translation app), the translation confidence corresponding to query request #1 is translation confidence #1, and the target feedback method is ranking feedback. Fig.11In (b), user #1 inputs query request #1 in application scenario #2 (eg, input method App), the translation confidence corresponding to query request #1 is translation confidence #1, and the target feedback mode is modification feedback.
[0476] It should be understood that Fig.11 This is only an example and does not limit the solution of the embodiment of the present application. Fig.11 In the embodiment, the target feedback mode is determined based on the user portrait of the user, the translation confidence corresponding to the query request, and the application scenario of the method. In other implementations, the target feedback mode may also be determined based on the user portrait of the user, the translation confidence corresponding to the query request, or any one of the application scenarios of the method. Alternatively, the target feedback mode may also be determined based on the user portrait of the user, the translation confidence corresponding to the query request, or any two of the application scenarios of the method.
[0477] When the translation confidences corresponding to the query requests are different, the ways in which the user is required to provide feedback may be different.
[0478] For example, when the translation confidence corresponding to the query request is low, the translation quality of the N predicted translation results of the query request may all be poor. In this case, the user may be guided to adopt a modification feedback method.
[0479] Different users may have different feedback willingness, feedback method preferences, or feedback quality. User portraits can reflect the user characteristics of the specific translation feedback function.
[0480] For example, some users tend to provide feedback in the form of selective feedback. In this case, the user can be guided to use the selective feedback method to increase the possibility of the user providing feedback.
[0481] For another example, some users tend to adopt the method of modifying feedback to provide feedback. In this case, the user can be guided to adopt the method of modifying feedback to increase the possibility of the user providing feedback.
[0482] The specific method for determining the user portrait can be referred to method 1200 in the following text and will not be described in detail here.
[0483] In some possible implementations, the target feedback method may be determined based on at least two of an application scenario, a user profile, or a translation confidence.
[0484] Exemplarily, the at least two items are processed based on a first rule to determine a target feedback mode. The first rule is used to indicate the degree of influence of the at least two items on the target feedback mode.
[0485] Exemplarily, the at least two items are processed by a deep learning network to determine a target feedback method.
[0486] It should be understood that the above are only examples, and at least two items may be processed in other ways to determine the target feedback method, such as a simple machine learning algorithm.
[0487] For specific interaction methods involved in method 1000, refer to Figure 4 or Figure 5 , I will not go into details here.
[0488] In the embodiment of the present application, there is no need for the user to find the feedback entrance by himself, and the feedback prompt is displayed on the interface, and the user is actively guided to give feedback, which can improve the possibility of the user giving feedback, so as to realize the efficient collection of the data of the user feedback, and improve the data volume of the user feedback collected. At the same time, in the scheme of the embodiment of the present application, based on different application scenarios, different user portraits or different translation confidences, personalized feedback prompts are provided to the user, and the user is guided to give feedback in different feedback modes, which is conducive to further improving the possibility of the user giving feedback to the translation result, so as to further improve the data volume of the user feedback collected. The feedback data of the user can be used for subsequent optimization of the translation result, so as to improve the user experience. For example, the feedback data of the user can be used as training data for subsequent fine-tuning of the translation model, so as to realize the continuous optimization of the performance of the translation model, and improve the translation quality of the translation model, so as to improve the user experience. The efficient collection of data is conducive to realizing the efficient iteration of the model.
[0489] In addition, the solution of the embodiment of the present application actively guides users to provide feedback, which is conducive to better identifying and correcting erroneous examples and reducing existing online public opinion.
[0490] Step 1020 and step 1030 are optional steps.
[0491] In a possible implementation, whether to execute step 1020 and step 1030 is determined according to at least one of the following: translation confidence, user portrait, or application scenario corresponding to the query request.
[0492] For example, when the translation confidence corresponding to the query request is less than or equal to threshold #3, step 1020 and step 1030 are performed. That is, when the translation confidence corresponding to the query request is low, the user is prompted to provide feedback.
[0493] For another example, when the user is determined to be a high-quality contributor based on the user portrait, steps 1020 and 1030 are executed.
[0494] Exemplarily, whether to execute step 1020 and step 1030 is determined based on at least two of the following: translation confidence, user portrait, or application scenario corresponding to the query request.
[0495] The specific determination method may refer to the method for determining the target feedback mode in method 1000, which will not be described in detail here.
[0496] Fig.12 A method for determining a user portrait provided by an embodiment of the present application is shown. The user portrait is a user portrait of a user for translation feedback, and is used to reflect the user's characteristics for translation feedback.
[0497] The method 1200 includes the following steps:
[0498] 1210 , obtaining at least one of a user's personal attribute, a user's feedback willingness, or a user's feedback quality.
[0499] 1220 , determine a user portrait according to at least one of a user's personal attribute, a user's feedback willingness, or a user's feedback quality.
[0500] In other words, the user portrait may include at least one of the following: the user's personal attributes, the user's feedback willingness, or the user's feedback quality.
[0501] Fig.13 A schematic diagram of a user portrait is shown.
[0502] For example, Fig.13 As shown, the user's personal attributes may include the user's education level or the user's occupation, etc.
[0503] Different users may have different feedback intentions.
[0504] Optionally, method 1200 further includes step 1211 (not shown in the figure).
[0505] Step 1211 may include determining the user's willingness to provide feedback based on at least one of the following: whether the user is a contributor, the size of the user's local intervention library, the user's ranking ratio, the user's selection ratio, the user's modification ratio, the user's acceptance ratio of guided feedback, etc.
[0506] For example, the user's feedback willingness may be modeled based on at least one of the above items to obtain the user's feedback willingness.
[0507] Exemplarily, whether a user is a contributor can be determined based on the proportion of situations in which the user provides feedback in the user's historical query records. For example, if the proportion of situations in which the user provides feedback in the user's historical query records is greater than or equal to threshold #2, the user is a contributor, otherwise, the user is not a contributor.
[0508] Alternatively, whether a user is a contributor can be determined based on whether the user has actively applied for the role of a contributor. For example, if the user has applied for the role of a contributor, the user can be a contributor, otherwise, the user is not a contributor.
[0509] The ratio of the user's feedback in the user's historical query records, that is, the ratio between the total number of times the user gave feedback and the total number of query requests input by the user.
[0510] The user's ranking ratio refers to the proportion of cases in which the user uses ranking feedback in the historical query records, that is, the ratio between the number of times the user uses ranking feedback to the total number of times the user provides feedback.
[0511] The user selection ratio refers to the proportion of cases in which the user uses the selection feedback method in the historical query records, that is, the ratio between the number of times the user uses the selection feedback method to provide feedback and the total number of times the user provides feedback.
[0512] The modification ratio of a user refers to the ratio of the number of times the user adopts modification feedback in the historical query records, that is, the ratio between the number of times the user adopts modification feedback to the total number of times the user provides feedback.
[0513] When providing guidance for different feedback modes (eg, modification, sorting, or selection, etc.) to the user, the user's acceptance level may be different.
[0514] The user's acceptance ratio of guided feedback can be the proportion of cases in which the user adopts the feedback method indicated by the prompt information in the historical query records, that is, the ratio between the number of times the user adopts the feedback method indicated by the prompt information (that is, the target feedback method) and the number of times the prompt information is displayed.
[0515] Different users have different translation abilities, which results in different feedback qualities from different users.
[0516] Optionally, method 1200 further includes step 1212 (not shown in the figure).
[0517] Step 1212 may include determining the quality of user feedback based on at least one of the following: user selection score statistics, user modification score statistics, user sorting score statistics, local intervention library hit cloud library ratio, etc.
[0518] For example, the user's feedback quality may be modeled based on at least one of the above items to obtain the user's feedback quality.
[0519] Exemplarily, the statistical values may include: maximum value, minimum value, average value, median value, etc.
[0520] The user's selection score statistics refer to the statistics of the translation confidence corresponding to the query request when the user adopts the selection feedback in the historical query record.
[0521] For example, the user's selection score statistics may be an average value of the user's selection scores, that is, from the historical query records, all query requests in which the user adopts selection feedback are determined, and the average value of the corresponding translation confidences is determined.
[0522] The user's modification score statistics refer to the statistical values of translation confidences corresponding to query requests in the historical query records when the user adopts modification feedback.
[0523] For example, the modification score statistics of the user may be the minimum value of the modification score of the user, that is, from the historical query records, all query requests in which the user adopts modification feedback are determined, and the minimum value of the corresponding translation confidence is determined.
[0524] The user's ranking score statistics refer to the statistics of the translation confidence corresponding to the query request of the user using ranking feedback in the historical query records.
[0525] For example, the ranking score statistics of the user may be the median of the ranking score of the user, that is, from the historical query records, all query requests of the user using ranking feedback are determined, and the median of the corresponding translation confidence is determined.
[0526] As mentioned above, the user's local intervention library can store the words modified by the user and the corresponding words in the query request. The local intervention library is only effective in local hot intervention. When the user's new query request hits the local intervention library, the translation result of the query request can be hot intervened.
[0527] The user's new query request hitting the local intervention library includes that the words in the user's new query request are in the local intervention library.
[0528] Exemplarily, the thermal intervention may be effective by providing a translation result list, wherein the translation result list includes a plurality of translation results, at least one of which includes a word in the local intervention library.
[0529] For example, a new query request of a user includes word #1, and word #1 is in the local intervention library. In this case, a translation result list can be provided to the user, and the translation result list includes multiple translation results, wherein the word corresponding to word #1 in at least one translation result is the word corresponding to word #1 in the local intervention library. The remaining translation results can be predicted translation results with higher translation confidence.
[0530] Alternatively, the hot intervention can also be effected by providing a translation result, wherein the words in the translation result include words in the local intervention library.
[0531] For example, the user's new query request includes word #1, and word #1 is in the local intervention library. In this case, a translation result can be provided to the user, and the word corresponding to word #1 in the translation result is the word corresponding to word #1 in the local intervention library.
[0532] The cloud intervention library may include multiple user-modified words and their corresponding words in the query request.
[0533] The local intervention library hit cloud library ratio refers to the degree of consistency between the words in the user's local intervention library and the words in the cloud intervention library.
[0534] Exemplarily, the ratio of the local intervention library to the cloud library may be a ratio between the number of words in the local intervention library that are identical to the words in the cloud intervention library and the number of words in the local intervention library.
[0535] Exemplarily, users may be divided into different user groups based on user portraits.
[0536] For example, users can be divided into high-quality contributors and ordinary users based on their feedback quality and their feedback willingness.
[0537] High-quality contributors refer to users with high feedback willingness and high feedback quality. Ordinary users refer to users with low feedback willingness and / or low feedback quality.
[0538] Fig.14 A schematic diagram of two user groups is shown. Fig.14 As shown, feedback quality can be divided into three levels: high, medium and low, and feedback willingness can be divided into three levels: high, medium and low.
[0539] like Fig.14 As shown in , users in the ideal area are high-quality contributors. The ideal area refers to the area where the user's feedback quality is medium or above and the feedback willingness is medium or above. Users in the rest of the area are ordinary users. Fig.14 As shown, ordinary users may be users with low feedback quality or users with low feedback willingness.
[0540] The following is an illustrative explanation of the application scenarios of user portraits.
[0541] In a possible implementation, the user portrait may be used to determine the target feedback method. For a detailed description, please refer to method 1000.
[0542] User portraits can be used to differentiate users and provide personalized feedback prompts to different users, which helps increase the possibility of users providing feedback.
[0543] Feedback data from high-quality contributors can be used to improve the performance of translation models.
[0544] In another possible implementation, the user portrait may be used to determine whether the local intervention library can be synchronized to the cloud intervention library.
[0545] Exemplarily, it can be determined whether the user's local intervention library can be synchronized to the cloud intervention library based on the confidence of the words in the local intervention library, the user portrait, and the modification hit rate of the existing network users.
[0546] The hit rate of modification by users in the current network is the ratio of the local intervention library to the cloud library, which is a statistical feature. For example, if a user has made modification feedback 10 times, the modification results of the 10 modifications are saved in the local intervention library, and the modification results of 8 modifications are consistent with the words in the cloud library, that is, they hit the cloud library, then the modification hit rate of the user is 0.8.
[0547] The data in the cloud intervention library can be used for cloud hot fixes.
[0548] Exemplarily, the translation model can be deployed in the cloud. The cloud obtains the user's query request through the local device, outputs one or more predicted translation results through the translation model, and returns them to the user through the local device. When the user's new query request hits the cloud intervention library, the translation result of the query request can be repaired in the cloud. The user's new query request hits the cloud pre-library including that the words in the user's new query request are in the cloud intervention library.
[0549] For specific methods, please refer to the thermal intervention method of the local intervention library, which will not be repeated here.
[0550] The data in the cloud intervention library can be used for subsequent training.
[0551] Exemplarily, data in the cloud intervention library may be used to determine training data in method 600 or training data in method 800 .
[0552] For example, the cloud intervention library includes phrase #1 and phrase #11 corresponding to phrase #1 in the query request. Phrase #11 can be used as a source sequence, and the reference translation result of the source sequence can be phrase #1.
[0553] Furthermore, it can be determined whether the data in the local intervention library can be synchronized to the cloud intervention library based on the user portrait and the translation confidence corresponding to the query request.
[0554] In another possible implementation, the user portrait of the user may be used to determine whether the user's feedback data can be used as training data.
[0555] For example, the selection data or ranking data of the high-quality contributors may be used to determine the training data in method 600 or the training data in method 800 .
[0556] For example, the selection data or ranking data of the high-quality contributors may be used to determine the training data in the training data set #1 in the method 600 .
[0557] User feedback data can be used as training data for the model. Users can be distinguished through user portraits, which is conducive to selecting high-quality feedback data for use as training data for the model, thereby improving the quality of training data and thus improving the performance of the model.
[0558] Furthermore, whether the user's feedback data can be used as training data is determined based on the user's user profile and the translation confidence corresponding to the query request.
[0559] In another possible implementation, the user profile of the user can be used to determine whether the user's feedback data can be immediately effective, that is, when the user inputs the same query request again, whether to adjust at least one predicted translation result of the query request according to the user's feedback data. For related descriptions, reference can be made to method 800.
[0560] For example, feedback data from high-quality contributors can take effect immediately.
[0561] Fig.15 The schematic flow chart of the translation method 1500 provided in the embodiment of the present application is shown. The method can be executed by a device or equipment capable of performing translation. For example, the device can be a cloud service device, or a terminal device, such as a computer, a server, etc., which has sufficient computing power to perform the data processing method, or a system composed of a cloud service device and a terminal device. Exemplarily, the method 1500 can be performed by Figure 1 (a) of the user equipment, Figure 1 (b) of the user equipment, Figure 1 (c) a local device or Figure 2 The execution device 210 executes. Fig.15 The model used in the translation method 1500 can be obtained by Figure 6 The specific implementation of method 1500 can refer to the aforementioned method 600. In order to avoid unnecessary repetition, repeated descriptions are appropriately omitted when introducing method 1500 below.
[0562] Method 1500 includes the following steps.
[0563] 1510, obtaining the user's query request.
[0564] 1520, the query request is processed by the target translation model to obtain N predicted translation results of the query request and the predicted probabilities of the N predicted translation results. The predicted probabilities of the N predicted translation results are used to indicate the translation confidences of the N predicted translation results.
[0565] Optionally, the prediction probabilities of the N predicted translation results are respectively determined according to the probabilities of the target translation model outputting words in the N predicted translation results.
[0566] Optionally, the target translation model is obtained by adjusting parameters of the initial translation model with the goal of reducing a function value of a loss function, wherein the loss function is based on a first loss function and a second loss function, the first loss function being used to indicate a difference between a first predicted translation result of a source sequence and a reference translation result of the source sequence, the second loss function being used to indicate a difference between a reference ranking of multiple candidate translation results of the source sequence and a predicted ranking of the multiple candidate translation results, the predicted ranking of the multiple candidate translation results being obtained based on predicted probabilities of the multiple candidate translation results, and the predicted probabilities of the multiple candidate translation results being obtained by inputting the source sequence into the initial translation model for processing.
[0567] Optionally, the predicted probabilities of the multiple candidate translation results are determined according to the probabilities of the words in the multiple candidate translation results output by the initial translation model.
[0568] In some possible implementations, method 1500 may be used in combination with method 1000 .
[0569] Optionally, method 1500 may further include step 1530 (not shown in the figure).
[0570] Step 1530 may include: determining a target feedback method according to a translation confidence corresponding to the query request, a user profile of the user, and an application scenario of the method. The translation confidence corresponding to the query request is based on the translation confidences of the N predicted translation results.
[0571] Optionally, the translation confidence corresponding to the query request is a maximum value of the translation confidences of the N predicted translation results.
[0572] For a detailed description, please refer to method 1000, which will not be repeated here.
[0573] Optionally, method 1500 may further include step 1540 (not shown in the figure).
[0574] Step 1540 may include: obtaining user feedback data, and updating the local intervention library according to the user feedback data.
[0575] Optionally, the user feedback data includes a modification result of the user on at least one word in the N predicted translation results of the query request, and updating the local intervention library according to the user feedback data may include: saving the modified word and the confidence of the modified word in the local intervention library.
[0576] The confidence of the modified word may be the translation confidence of the predicted translation result in which the word is located.
[0577] For example, Fig. 9 As shown, the user modified a word in the third predicted translation result, that is, changed "Amy" to "Amy", the confidence of "Amy" is 0.75, and "Amy" and 0.75 are saved in the local database.
[0578] In addition, the method 1500 may also be used in combination with the method 1200. For a detailed description, reference may be made to the method 1200.
[0579] Fig.16 A translation method provided by an embodiment of the present application is shown. Method 1600 can be applied to a first electronic device. For example, the first electronic device can be Figure 1 The user equipment, electronic device 100, local device 301 or local device 302 in the embodiment. Alternatively, the first electronic device may be Figure 2 The execution device 210 in.
[0580] like Fig.16 As shown, method 1600 includes the following steps.
[0581] 1610. Receive a first input operation from a first user.
[0582] 1620. In response to the first input operation, display a first translation result, a first option, and a second option.
[0583] Among them, the first option includes a first translation result and a first control, the second option includes a second translation result and a second control, the first translation result and the second translation result are different; the first control is used to prompt the first user to change the order of the first translation result, and the second control is used to prompt the first user to change the order of the second translation result.
[0584] Below Figure 4For example, the first input operation may be an input operation of the first user in the content input box 401. For another example, the first input operation may be a click operation of the first user on the translation control 405. The first translation result may be the content displayed in the translation result display box 402. For example, after the first user inputs the text to be translated, the first translation result may be a translation result of the text to be translated output by the translation model. The translation model may be a model trained by the method 600. The first translation result may be the first predicted translation result among the N predicted translation results output by the translation model. Figure 4 As shown in (b), N is 2, and the other predicted translation result is the second translation result. Alternatively, the translation model may also be other translation models, which is not limited in the present embodiment of the application. Figure 4 As shown in (b), the first option and the second option are two options in the sorting operation box 411. The first control may be a sorting control corresponding to the first translation result in the sorting operation box 411, i.e., arrow icon 418, and the second control may be a sorting control corresponding to the second translation result in the sorting operation box 411, i.e., arrow icon 419.
[0585] Below Figure 5 For example, the first input operation may be an input operation of the first user in the content input box 503. For another example, the first input operation may be an operation performed by the first user on the translation result sorting control 505, such as a click operation or a long press operation. The first translation result may be the content displayed in the input dialog box 501. Figure 5 As shown in (e), the first option and the second option are two options in the sorting operation box 506. The first control may be a sorting control corresponding to the first translation result in the sorting operation box 506, and the second control may be a sorting control corresponding to the second translation result in the sorting operation box 506. The sorting control is an arrow icon on the left side of the translation result.
[0586] Exemplarily, the first translation result and the second translation result may be two predicted translation results output by the translation model in the embodiment of the present application, and the order of the first translation result and the second translation result may be determined based on the translation confidence of the first translation result and the second translation result. The method for determining the translation confidence may refer to the method 600 or the method 1500 described above.
[0587] In the embodiment of the present application, there is no need for the user to find the feedback entrance by himself, and the feedback prompt is displayed on the interface, and the user is actively guided to give feedback, which can improve the possibility of the user giving feedback, thereby realizing the efficient collection of the data of the user feedback, and improving the data volume of the collected user feedback. After the user inputs the content to be translated, multiple translation results can be displayed on the interface, and the user is prompted to sort the multiple translation results, which is conducive to obtaining the sorting results of the user. The feedback data of the user can be used for subsequent optimization of the translation result, thereby improving the user experience. For example, the feedback data of the user can be used as training data for subsequent fine-tuning of the translation model, thereby realizing the continuous optimization of the performance of the translation model, improving the translation quality of the translation model, thereby improving the user experience. The efficient collection of data is conducive to realizing the efficient iteration of the model.
[0588] Optionally, method 1600 may further include: in response to an operation performed by the first user on the second control, replacing display positions of the first translation result and the second translation result.
[0589] For example, the operation performed by the first user on the second control may be a click operation performed by the first user on the second control.
[0590] For example, Figure 4 As shown in (b), the first user clicks arrow icon 419. In response to the click operation, second translation result 417 may move up one position, and second translation result 417 may replace the translation result originally displayed in translation result display box 402, namely, first translation result 416.
[0591] For example, Figure 5 As shown in (e), in response to the click operation, the second translation result may be moved up one position, and the second translation result may replace the translation result originally displayed in the input dialog box 501, that is, the first translation result.
[0592] Optionally, in response to a first input operation, displaying a first translation result, a first option, and a second option includes: in response to the first input operation, displaying the first translation result, the first option, the second option, and first prompt information, the first prompt information being used to prompt the first user to change the order of the first translation result or the second translation result.
[0593] For example, the first prompt information may be to inform the user that clicking the first control or the second control can change the order of the translation results, thereby helping the user understand the functions of the first option and the second option and guiding the user to more actively order the multiple translation results.
[0594] For example, Figure 4 As shown in (b), the first prompt information may be the content displayed in the sorting operation prompt box 412, namely, “click the arrow to sort”.
[0595] Optionally, method 1600 may further include: receiving a second input operation of the first user, the content to be translated input by the second input operation is different from the content to be translated input by the first input operation; in response to the second input operation, displaying a third translation result, a third option and a fourth option; wherein the third option includes a third translation result and a third control, the fourth option includes a fourth translation result and a fourth control, and the third translation result and the fourth translation result are different; the third control is used to prompt the first user to select the third translation result, and the fourth control is used to prompt the first user to select the fourth translation result.
[0596] The second input operation is similar to the first input operation, and the main difference is that the two input operations correspond to different contents to be translated. For related descriptions, please refer to the first input operation, and will not be repeated here to avoid repetition.
[0597] Below Figure 4 For example, the third translation result may be the content displayed in the translation result display box 402. For example, after the first user inputs the text to be translated, the third translation result may be a translation result of the text to be translated output by the translation model. The translation model may be a model trained by the method 600. The third translation result may be the first predicted translation result among the N predicted translation results output by the translation model. Figure 4 As shown in (c), N is 2, and another predicted translation result is the fourth translation result. Alternatively, the translation model may also be other translation models, which is not limited in the present embodiment of the application. Figure 4 As shown in (c), the third option and the fourth option are two options in the selection operation box 413. The third control is the selection control 422 corresponding to the first translation result 420 in the selection operation box 413, and the fourth control is the selection control 423 corresponding to the second translation result 421 in the selection operation box 413. The two selection controls can be areas for displaying the two translation results.
[0598] Below Figure 5 The third translation result may be the content displayed in the input dialog box 501. Figure 5 As shown in (g), the third option and the fourth option are two options in the selection operation box 508. The third control is a selection control corresponding to the first translation result in the selection operation box 508, and the fourth control is a selection control corresponding to the second translation result in the selection operation box 508. The two selection controls can be areas for displaying the two translation results.
[0599] In the solution of the embodiment of the present application, after the user inputs the content to be translated, multiple translation results may be displayed on the interface, and the user may be prompted to select a suitable translation result from them. This is conducive to obtaining the user's selection result.
[0600] Optionally, method 1600 may further include: receiving a third input operation of the first user, wherein the content to be translated inputted by the third input operation is different from the content to be translated inputted by the first input operation; in response to the third input operation, displaying a fifth translation result and a first edit box; wherein the first edit box is used to prompt the first user to modify the fifth translation result.
[0601] The third input operation is similar to the first input operation, and the main difference is that the content to be translated corresponding to the two input operations is different. The relevant description can refer to the first input operation, and to avoid repetition, it will not be repeated here. The content to be translated input by the third input operation and the content to be translated input by the second input operation can be the same. For example, the third input operation and the second input operation can be input operations in different application scenarios, and the content to be translated input is the same. The content to be translated input by the third input operation and the content to be translated input by the second input operation may also be different.
[0602] Below Figure 4 For example, the fifth translation result may be the content displayed in the translation result display box 402. For example, after the first user inputs the text to be translated, the fifth translation result may be a translation result of the text to be translated output by the translation model. The translation model may be a model trained by the method 600. Alternatively, the translation model may be other translation models, which is not limited in the embodiments of the present application. Figure 4 As shown in (d), the first edit box may be a translation result edit box 402.
[0603] Below Figure 5 The fifth translation result may be the content displayed in the input dialog box 501. Figure 5 As shown in (c), the first edit box may be an input dialog box 501.
[0604] In the solution of the embodiment of the present application, after the user inputs the content to be translated, a translation result can be displayed on the interface, and the user can be prompted to modify the translation result, which is conducive to obtaining the user's modified result.
[0605] In the scheme of the embodiment of the present application, when the user inputs different contents to be translated, the feedback mode adopted by the user is prompted to be different. For example, in method 1000, the target feedback mode can be determined based on the translation confidence corresponding to the query request. When the query request is different, that is, when the contents to be translated are different, the translation confidence corresponding to the query request may also be different, and the target feedback mode may also be different. In the scheme of the embodiment of the present application, different feedback prompts can be provided to the user based on different contents to be translated, and the user is guided to adopt different feedback modes for feedback, which is conducive to further improving the possibility that the user feeds back the translation result, thereby further improving the data volume of the user feedback collected.
[0606] Optionally, method 1600 may further include: receiving a fourth input operation of the second user, the login accounts of the first user and the second user are different; in response to the fourth input operation, displaying the sixth translation result, the fifth option and the sixth option; wherein the fifth option includes the sixth translation result and the fifth control, the sixth option includes the seventh translation result and the sixth control, and the sixth translation result and the seventh translation result are different; the fifth control is used to prompt the second user to select the sixth translation result, and the sixth control is used to prompt the second user to select the seventh translation result.
[0607] The fourth input operation is similar to the second input operation, and the main difference is that the users of the two input operations are different. The relevant description can refer to the second input operation, and to avoid repetition, it is not repeated here. The content to be translated input by the fourth input operation can be the same as or different from the content to be translated input by the second input operation, the content to be translated input by the first input operation, and the content to be translated input by the third input operation.
[0608] In the solution of the embodiment of the present application, when different users perform input operations, the feedback methods used by different users may be different. For example, in method 1000, the target feedback method may be determined based on the user portrait of the user. When the user is different, the user portrait of the user may also be different, and the target feedback method may also be different. For a specific description of the user portrait, please refer to method 1200.
[0609] In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different users, guiding different users to adopt different feedback methods for feedback, which is conducive to further increasing the possibility of users providing feedback on translation results, thereby further increasing the amount of user feedback data collected.
[0610] Optionally, method 1600 may further include: receiving a fifth input operation from a third user, the first user and the third user having different login accounts; in response to the fifth input operation, displaying an eighth translation result and a second edit box; wherein the second edit box is used to prompt the third user to modify the eighth translation result.
[0611] The fifth input operation is similar to the third input operation, and the main difference is that the users of the two input operations are different. The relevant description can refer to the third input operation, and to avoid repetition, it is not repeated here. The content to be translated input by the fifth input operation can be the same as or different from the content to be translated input by the second input operation, the content to be translated input by the first input operation, the content to be translated input by the third input operation, and the content to be translated input by the fourth input operation.
[0612] In the solution of the embodiment of the present application, when different users perform input operations, the feedback methods used by different users may be different. For example, in method 1000, the target feedback method may be determined based on the user portrait of the user. When the user is different, the user portrait of the user may also be different, and the target feedback method may also be different. For a specific description of the user portrait, please refer to method 1200.
[0613] In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different users, guiding different users to adopt different feedback methods for feedback, which is conducive to further increasing the possibility of users providing feedback on translation results, thereby further increasing the amount of user feedback data collected.
[0614] Optionally, before receiving the first input operation of the first user, method 1600 may further include: displaying a first interface, where the first interface includes a first input box, and the first input operation is an operation performed by the first user on the first input box.
[0615] Optionally, after displaying the first translation result, the first option and the second option, method 1600 may further include: displaying a second interface, the second interface including a second input box, a third input box and a first input method; receiving a sixth input operation of the first user, the sixth input operation being an operation performed by the first user on the second input box; in response to the sixth input operation, displaying a ninth translation result and a second prompt message, the ninth translation result being located in the third input box, and the second prompt message being used to prompt the first user to modify the ninth translation result.
[0616] The first interface and the second interface are interfaces in different application scenarios.
[0617] by Figure 4 and Figure 5 For example, the first input box may be a content input box 401, the second input box may be a content input box 503, the third input box may be an input dialog box 501, and the first input method may be Figure 5In this case, the first input operation is an operation in which the first user inputs the content to be translated in the content input box 401. The sixth input operation is an operation in which the first user inputs the content to be translated in the content input box 503. The two contents to be translated may be the same or different. Figure 5 As shown in (c), after the first user enters the text to be translated in the content input box 503, the ninth translation result can be a translation result of the text to be translated output by the translation model. The translation model can be a model trained by method 600. Or the translation model can also be other translation models, which is not limited in the embodiment of the present application. The ninth translation result is the content displayed in the input dialog box 501. The second prompt information can be Figure 5 "Suggest a modification" is shown in (c) of the document.
[0618] In the solution of the embodiment of the present application, when the method is applied to different scenarios, for example, Figure 4 and Figure 5 In the scenario shown, when the user performs an input operation, the feedback method used to prompt the user may be different. For example, in method 1000, the target feedback method may be determined based on the application scenario. When the application scenario is different, the target feedback method may also be different.
[0619] In the scheme of the embodiment of the present application, different feedback prompts can be provided based on different application scenarios to guide users to adopt different feedback methods for feedback, which is conducive to further increasing the possibility of users providing feedback on translation results, thereby further increasing the amount of user feedback data collected.
[0620] Optionally, method 1600 may further include: receiving an operation performed by the first user on the second control; receiving a seventh input operation by the first user, wherein the content to be translated input by the seventh input operation is the same as the content to be translated input by the first input operation; and displaying a second translation result in response to the seventh input operation.
[0621] The seventh input operation is similar to the first input operation, except that the timing of the two operations is different. For a specific description, please refer to the relevant description of the first input operation, and to avoid repetition, it will not be repeated here.
[0622] In other words, for a content to be translated, after obtaining the sorting result of multiple translation results of the content to be translated by the first user, when the first user inputs the content to be translated again, the related content can be displayed based on the sorting result of the first user. The user operates the second control so that the position of the second translation result is exchanged with the position of the first translation result, and when the user inputs the content to be translated again, the second translation result can be displayed.
[0623] In this way, the displayed translation results are adjusted based on the user's ranking results, which is conducive to improving the user experience.
[0624] Optionally, method 1600 may further include: receiving an eighth input operation from a fourth user, the fourth user and the first user having different login accounts; in response to the eighth input operation, displaying the tenth translation result, the seventh option and the eighth option; wherein the seventh option includes the tenth translation result and the seventh control, the eighth option includes the eleventh translation result and the eighth control, and the tenth translation result and the eleventh translation result are different; the seventh control is used to prompt the fourth user to change the sorting of the tenth translation result, and the eighth control is used to prompt the fourth user to change the sorting of the eleventh translation result; receiving an operation of the fourth user acting on the eighth control; receiving a ninth input operation from the fourth user, the content to be translated inputted by the ninth input operation is the same as the content to be translated inputted by the eighth input operation; in response to the ninth input operation, displaying the tenth translation result.
[0625] The eighth input operation is similar to the first input operation, and the difference lies in that the two operations are performed by different users. The specific description can be found in the previous text, and will not be repeated here.
[0626] The ninth input operation is similar to the first input operation, and the difference lies in that the two operations are performed by different users. The specific description can be found in the previous text, and will not be repeated here.
[0627] For a content to be translated, after obtaining the sorting result of multiple translation results of the content to be translated by the fourth user, when the fourth user inputs the content to be translated again, the original translation result is still displayed. The fourth user operates the eighth control so that the position of the tenth translation result is exchanged with the position of the eleventh translation result. When the fourth user inputs the content to be translated again, the tenth translation result is still displayed.
[0628] The user portrait of the user can be used to determine whether the user's feedback data can take effect immediately. For different users, their user portraits may be different. The feedback data of some users (such as the first user) can take effect immediately. The feedback data of some users (such as the fourth user) will not take effect immediately. For example, for users with higher feedback quality, when the feedback data of the user is obtained, the translation results modified based on the feedback data can be displayed at the next query. For users with lower feedback quality, when the feedback data of the user is obtained, the original translation results of the translation model will still be displayed at the next query. For a specific description, please refer to method 1200.
[0629] Optionally, method 1600 may further include: receiving a tenth input operation of the first user, the content to be translated input by the tenth input operation is different from the content to be translated input by the first input operation; in response to the tenth input operation, displaying the twelfth translation result, the ninth option and the tenth option; wherein the ninth option includes the twelfth translation result and the ninth control, the tenth option includes the thirteenth translation result and the tenth control, and the twelfth translation result and the thirteenth translation result are different; the ninth control is used to prompt the first user to change the sorting of the twelfth translation result, and the tenth control is used to prompt the first user to change the sorting of the thirteenth translation result; receiving an operation of the first user acting on the tenth control; receiving an eleventh input operation of the first user, the content to be translated input by the eleventh input operation is the same as the content to be translated input by the tenth input operation; in response to the eleventh input operation, displaying the twelfth translation result.
[0630] The tenth input operation is similar to the first input operation, and the difference mainly lies in the different content to be translated. The specific description can be referred to in the previous text, and will not be repeated here.
[0631] For the content to be translated input by the first input operation, after obtaining the sorting result of multiple translation results of the content to be translated by the first user, when the first user inputs the same content to be translated again, the result adjusted by the user based on the sorting result of the user can be displayed.
[0632] For the content to be translated input by the tenth input operation, the twelfth translation result, the ninth option and the tenth option are displayed. The first user operates the tenth control so that the display positions of the twelfth translation result and the thirteenth translation result are swapped. When the first user inputs the same content to be translated again, the twelfth translation result is still displayed.
[0633] The translation confidence of the query request can be used to determine whether the user's feedback data can take effect immediately. Different query requests have different contents to be translated, and the translation confidence may also be different. For example, for a query request with a low translation confidence, when the user's feedback data is obtained, the translation result modified based on the feedback data can be displayed in the next query. For a query request with a high translation confidence, when the user's feedback data is obtained, the original translation result of the translation model will still be displayed in the next query. For a specific description, please refer to method 1200.
[0634] The following is a detailed description of the device of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that the device described below can perform the method of the embodiment of the present application. In order to avoid unnecessary repetition, repeated descriptions are appropriately omitted when introducing the device of the embodiment of the present application.
[0635] Fig.17It is a schematic block diagram of a translation model optimization device according to an embodiment of the present application. Fig.17 The optimization device 3000 shown includes an acquisition unit 3010 and a processing unit 3020.
[0636] Exemplarily, the optimization device may be used to execute method 600 of an embodiment of the present application.
[0637] In a possible implementation, the acquisition unit 3010 may execute the above step 610. The processing unit 3020 may execute the above steps 620 to 630.
[0638] Fig.18 It is a schematic block diagram of a translation device according to an embodiment of the present application. Fig.18 The translation device 4000 shown includes an acquisition unit 4010 and a processing unit 4020 .
[0639] Exemplarily, the apparatus 4000 may be used to execute the method 1000 , the method 1200 , the method 1500 , or the method 1600 of the embodiments of the present application.
[0640] In a possible implementation, the apparatus 4000 may be used to execute the method 1000, and the acquisition unit 4010 may execute the above step 1010. The processing unit 4020 may execute the above step 1020.
[0641] In a possible implementation, the apparatus 4000 may be used to execute the method 1200, and the acquisition unit 4010 may execute the above step 1210. The processing unit 4020 may execute the above step 1220.
[0642] In a possible implementation, the apparatus 4000 may be used to execute the method 1500, and the acquisition unit 4010 may execute the above step 1510. The processing unit 4020 may execute the above step 1520.
[0643] In a possible implementation, the apparatus 4000 may be used to execute the method 1600, and the acquisition unit 4010 may execute the above step 1610. The processing unit 4020 may execute the above step 1620.
[0644] It should be noted that the above-mentioned optimization devices 3000 and 4000 are embodied in the form of functional units. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0645] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0646] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0647] Fig.19 It is a schematic diagram of the hardware structure of a translation model optimization device provided in an embodiment of the present application. Fig.19 The optimization device 5000 shown (the device 5000 may be a computer device) includes a memory 5001, a processor 5002, a communication interface 5003 and a bus 5004. The memory 5001, the processor 5002 and the communication interface 5003 are connected to each other through the bus 5004.
[0648] The memory 5001 may be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 5001 may store a program. When the program stored in the memory 5001 is executed by the processor 5002, the processor 5002 is used to execute each step of the optimization method of the embodiment of the present application. For example, the processor 5002 may execute the method 600 described above.
[0649] Processor 5002 can adopt a general-purpose CPU, microprocessor, ASIC, GPU or one or more integrated circuits to execute relevant programs to implement the optimization method of the method embodiment of the present application.
[0650] The processor 5002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the optimization method of the present application may be completed by an integrated logic circuit of hardware in the processor 5002 or by instructions in the form of software.
[0651] The processor 5002 can also be a general-purpose processor, DSP, ASIC, field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 5001, and the processor 5002 reads the information in the memory 5001 and completes it in combination with its hardware. Fig.17 The units included in the device shown need to perform functions, or execute method 600 of the method embodiment of the present application.
[0652] The communication interface 5003 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the device 5000 and other devices or a communication network. For example, training data can be obtained through the communication interface 5003.
[0653] The bus 5004 may include a path for transmitting information between various components of the device 5000 (eg, the memory 5001 , the processor 5002 , and the communication interface 5003 ).
[0654] Fig. 20 It is a schematic diagram of the hardware structure of a translation device provided in an embodiment of the present application. Fig. 20 The translation device 6000 shown (the device 6000 may be a computer device) includes a memory 6001, a processor 6002, a communication interface 6003 and a bus 6004. The memory 6001, the processor 6002 and the communication interface 6003 are connected to each other through the bus 6004.
[0655] The memory 6001 may be a ROM, a static storage device, a dynamic storage device or a RAM. The memory 6001 may store a program. When the program stored in the memory 6001 is executed by the processor 6002, the processor 6002 is used to execute each step of the translation method of the embodiment of the present application. For example, the processor 6002 may execute the method 1000, the method 1200, the method 1500 or the method 1600 described above.
[0656] The processor 6002 may be a general-purpose CPU, a microprocessor, an ASIC, a GPU or one or more integrated circuits, and is used to execute relevant programs to implement the translation method of the method embodiment of the present application.
[0657] The processor 6002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the translation method of the present application may be completed by an integrated logic circuit of hardware in the processor 6002 or by instructions in the form of software.
[0658] The above-mentioned processor 6002 can also be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 6001, and the processor 6002 reads the information in the memory 6001 and completes it in combination with its hardware. Fig.18 The functions required to be performed by the units included in the shown device, or the method 1000, method 1200, method 1500 or method 1600 of the method embodiment of the present application.
[0659] The communication interface 6003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or communication networks.
[0660] The bus 6004 may include a path for transmitting information between various components of the device 6000 (eg, the memory 6001 , the processor 6002 , and the communication interface 6003 ).
[0661] The embodiment of the present application also provides a computer-readable medium, which stores a program code for execution by a device, and the program code includes any one of the optimization method or translation method for executing the translation model in the embodiment of the present application.
[0662] The embodiment of the present application also provides a computer program product including instructions. When the computer program product is run on a computer, the computer is enabled to execute any one of the optimization methods or translation methods of the translation model in the embodiment of the present application.
[0663] An embodiment of the present application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to execute any one of the optimization methods or translation methods of the translation model in the embodiment of the present application.
[0664] Optionally, as an implementation method, the chip may also include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute any one of the optimization methods or translation methods of the translation model in the embodiments of the present application.
[0665] It should also be understood that in the embodiment of the present application, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the processor may also include a non-volatile random access memory. For example, the processor may also store information about the device type.
[0666] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0667] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0668] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0669] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0670] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0671] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0672] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0673] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a universal serial bus flash disk (USB flash disk, UFD), which can also be referred to as a U disk or USB flash drive, a mobile hard disk, ROM, RAM, a disk or an optical disk, and other media that can store program codes.
[0674] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A translation method, applied to a first electronic device, characterized in that: include: receiving a first input operation of a first user; In response to the first input operation, displaying a first translation result, a first option, and a second option; The first option includes the first translation result and a first control, the second option includes a second translation result and a second control, and the first translation result and the second translation result are different; The first control is used to prompt the first user to change the order of the first translation result, and the second control is used to prompt the first user to change the order of the second translation result.
2. The translation method according to claim 1, characterized in that: The method further comprises: In response to the operation of the first user on the second control, the display positions of the first translation result and the second translation result are swapped.
3. The translation method according to claim 1 or 2, characterized in that: The step of displaying the first translation result, the first option and the second option in response to the first input operation comprises: In response to the first input operation, a first translation result, a first option, a second option and first prompt information are displayed, wherein the first prompt information is used to prompt the first user to change the order of the first translation result or the second translation result.
4. The translation method according to any one of claims 1 to 3, characterized in that: The method further comprises: receiving a second input operation of the first user, wherein the content to be translated inputted by the second input operation is different from the content to be translated inputted by the first input operation; In response to the second input operation, displaying a third translation result, a third option, and a fourth option; Among them, the third option includes the third translation result and a third control, the fourth option includes a fourth translation result and a fourth control, the third translation result and the fourth translation result are different; the third control is used to prompt the first user to select the third translation result, and the fourth control is used to prompt the first user to select the fourth translation result.
5. The translation method according to any one of claims 1 to 4, characterized in that: The method further comprises: receiving a third input operation of the first user, wherein the content to be translated inputted by the third input operation is different from the content to be translated inputted by the first input operation; In response to the third input operation, displaying a fifth translation result and a first edit box; The first edit box is used to prompt the first user to modify the fifth translation result.
6. The translation method according to any one of claims 1 to 5, characterized in that: The method further comprises: receiving a fourth input operation from a second user, wherein the first user and the second user have different login accounts; In response to the fourth input operation, displaying a sixth translation result, a fifth option, and a sixth option; Among them, the fifth option includes the sixth translation result and the fifth control, the sixth option includes the seventh translation result and the sixth control, the sixth translation result and the seventh translation result are different; the fifth control is used to prompt the second user to select the sixth translation result, and the sixth control is used to prompt the second user to select the seventh translation result.
7. The translation method according to any one of claims 1 to 6, characterized in that: The method further comprises: receiving a fifth input operation from a third user, wherein the first user and the third user have different login accounts; In response to the fifth input operation, displaying an eighth translation result and a second edit box; The second editing box is used to prompt the third user to modify the eighth translation result.
8. The translation method according to any one of claims 1 to 7, characterized in that: Before receiving the first input operation of the first user, the method further includes: A first interface is displayed, where the first interface includes a first input box, and the first input operation is an operation performed by the first user on the first input box.
9. The translation method according to any one of claims 1 to 8, characterized in that: After displaying the first translation result, the first option and the second option, the method further includes: Displaying a second interface, wherein the second interface includes a second input box, a third input box, and a first input method; receiving a sixth input operation of the first user, where the sixth input operation is an operation performed by the first user on the second input box; In response to the sixth input operation, a ninth translation result and second prompt information are displayed, the ninth translation result is located in the third input box, and the second prompt information is used to prompt the first user to modify the ninth translation result.
10. The translation method according to any one of claims 1 to 9, characterized in that: The method further comprises: receiving an operation performed by the first user on the second control; receiving a seventh input operation of the first user, wherein the content to be translated inputted by the seventh input operation is the same as the content to be translated inputted by the first input operation; In response to the seventh input operation, the second translation result is displayed.
11. The translation method according to claim 10, characterized in that: The method further comprises: receiving an eighth input operation from a fourth user, where the fourth user and the first user have different login accounts; In response to the eighth input operation, displaying the tenth translation result, the seventh option and the eighth option; The seventh option includes the tenth translation result and a seventh control, the eighth option includes the eleventh translation result and an eighth control, the tenth translation result and the eleventh translation result are different; the seventh control is used to prompt the fourth user to change the order of the tenth translation result, and the eighth control is used to prompt the fourth user to change the order of the eleventh translation result; receiving an operation performed by the fourth user on the eighth control; receiving a ninth input operation of the fourth user, wherein the content to be translated inputted by the ninth input operation is the same as the content to be translated inputted by the eighth input operation; In response to the ninth input operation, the tenth translation result is displayed.
12. The translation method according to claim 10 or 11, characterized in that: The method further comprises: receiving a tenth input operation of the first user, wherein the content to be translated inputted by the tenth input operation is different from the content to be translated inputted by the first input operation; In response to the tenth input operation, displaying the twelfth translation result, the ninth option and the tenth option; The ninth option includes the twelfth translation result and a ninth control, the tenth option includes the thirteenth translation result and a tenth control, the twelfth translation result is different from the thirteenth translation result; the ninth control is used to prompt the first user to change the order of the twelfth translation result, and the tenth control is used to prompt the first user to change the order of the thirteenth translation result; receiving an operation performed by the first user on the tenth control; receiving an eleventh input operation of the first user, wherein the content to be translated inputted by the eleventh input operation is the same as the content to be translated inputted by the tenth input operation; In response to the eleventh input operation, the twelfth translation result is displayed.
13. A method for optimizing a translation model, characterized in that: include: Acquire at least one training data, wherein the training data includes a source sequence, a reference translation result of the source sequence, and a reference ranking of a plurality of candidate translation results of the source sequence; Inputting the source sequence and the multiple candidate translation results into an initial translation model for processing to obtain a first predicted translation result of the source sequence and predicted probabilities of the multiple candidate translation results; The parameters of the initial translation model are adjusted with the goal of reducing the function value of a loss function, wherein the loss function is based on a first loss function and a second loss function, wherein the first loss function is used to indicate a difference between the first predicted translation result and the reference translation result, and the second loss function is used to indicate a difference between the reference ranking and a predicted ranking of the multiple candidate translation results, wherein the predicted ranking of the multiple candidate translation results is obtained based on the predicted probabilities of the multiple candidate translation results.
14. The optimization method according to claim 13, characterized in that: The reference ranking of the plurality of candidate translation results is obtained based on a ranking result of the plurality of candidate translation results ranked by the user.
15. The optimization method according to claim 13, characterized in that: The reference ranking of the multiple candidate translation results is obtained based on the reference probabilities of the multiple candidate translation results, and the reference probability of a selection result selected by the user from the multiple candidate translation results is higher than the reference probabilities of other candidate translation results among the multiple candidate translation results except the selection result.
16. The optimization method according to claim 13, characterized in that: The reference ranking of the plurality of candidate translation results is determined based on the similarity or difference between the plurality of candidate translation results and the reference translation result.
17. The optimization method according to any one of claims 13 to 16, characterized in that: The predicted probability of the candidate translation result is determined according to the probability of the initial translation model outputting the words in the candidate translation result.
18. The optimization method according to claim 17, characterized in that: The predicted probability of the candidate translation result satisfies the following formula: Wherein, G represents any one of the multiple candidate translation results, Z(G) represents the predicted probability of the candidate translation result G, and g t represents the tth word in the candidate translation result G, g <t represents the word before the tth word in the candidate translation result G, S represents the source sequence, l represents the number of words in the candidate translation result G, θ represents the parameters of the initial translation model, and f θ represents the initial translation model, It means that the initial translation model has input S and g <t Output g in the case of t The conditional probability of , α is a hyperparameter.
19. The optimization method according to any one of claims 13 to 18, characterized in that: The multiple candidate translation results are obtained by inputting the source sequence into the initial translation model for processing, and the multiple candidate translation results include the first predicted translation result.
20. The optimization method according to any one of claims 13 to 19, characterized in that: The second loss function satisfies the following formula: Among them, L reorder Denotes the second loss function, G j represents the candidate translation result at the jth position in the reference ranking, G i represents the candidate translation result at the ith position in the reference ranking, Z(G j ) represents G j The predicted probability, Z(G i ) represents G i The predicted probability, λ ij Represents G j and G i The adjustment parameters between .
21. A translation device, characterized in that: The method comprises a unit or a module for executing the method as claimed in any one of claims 1 to 12.
22. A translation model optimization device, characterized in that: The method comprises means or modules for performing the method as claimed in any one of claims 13 to 20.
23. A translation device, characterized in that: The device comprises a processor and a memory, wherein the processor is configured to execute instructions stored in the memory, so that the translation device executes the method according to any one of claims 1 to 12.
24. A translation model optimization device, characterized in that: The device comprises a processor and a memory, wherein the processor is used to execute instructions stored in the memory, so that the translation model optimization device performs the method according to any one of claims 13 to 20.
25. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 12, or the computing device cluster executes the method according to any one of claims 13 to 20. The computing device cluster comprises at least one computing device.
26. A computer program product comprising instructions, characterized in that When the instruction is executed by a computing device cluster, the computing device cluster executes the method as claimed in any one of claims 1 to 12, or the computing device cluster executes the method as claimed in any one of claims 13 to 20, wherein the computing device cluster includes at least one computing device.
Citation Information
Cited By
Merchant information real-time translation method and system based on position data
CN121960522A
Server and method for facilitating providing translations
WO2026075611A1
