Translation optimization method and device, electronic equipment and storage medium

By extracting and training the translation optimization model and optimizing the machine translation process, the problem of insufficient translation accuracy in the existing technology is solved, and higher semantic accuracy and language habit compliance are achieved.

CN119398066APending Publication Date: 2025-02-07PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411551648.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

Existing machine translation techniques are difficult to accurately capture the cultural background and language habits of source language texts, resulting in insufficient translation accuracy.

Method used

A translation optimization method is proposed, by obtaining translation optimization samples, extracting text features, training the translation optimization model, performing preliminary translation and text feature extraction, and finally performing translation optimization through the optimization model to improve the semantic accuracy of the translation results and the conformity of language habits. Spend.

Benefits of technology

It improves the accuracy and naturalness of machine translation, making the translation output more in line with the expression habits and semantic requirements of the target language.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398066A_ABST
    Figure CN119398066A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a translation optimization method and device, electronic equipment and a storage medium, and belongs to the technical field of artificial intelligence and finance. The method comprises the steps of obtaining an original sample translation text and a target sample translation text; performing text feature extraction on the original sample translation text and the target sample translation text to obtain original sample text embedding features and target sample text embedding features; performing model training on the original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model; preliminarily translating the source language text to obtain an initial translated text; performing text feature extraction on the initial translation text to obtain initial text embedding features; and performing translation optimization on the initial text embedding features through the target translation optimization model to obtain a target translation text. According to the embodiment of the invention, the semantic accuracy of the translation result can be ensured, the expression habit is met, and the machine translation accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence and financial technology, and in particular to a translation optimization method and device, an electronic device, and a storage medium. Background Art

[0002] Machine translation is an artificial intelligence technology that can translate from one natural language into another. Machine translation can be applied to a variety of scenarios. For example, in the financial field, machine translation can be used to translate contracts, agreements, materials, information and other contents of international cooperation.

[0003] At present, deep learning models are mainly used to achieve translation based on language rules. However, in actual application scenarios, the source language texts are mostly complex or have multiple meanings. Machine translation cannot accurately understand the cultural background and language habits of the source language texts, which affects the accuracy of machine translation.

[0004] Therefore, how to improve the accuracy of machine translation has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of the embodiments of the present application is to propose a translation optimization method and device, an electronic device and a storage medium, aiming to improve the accuracy of machine translation.

[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a translation optimization method, the method comprising:

[0007] Obtaining a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text;

[0008] Performing text feature extraction on the original sample translation text to obtain original sample text embedding features, and performing text feature extraction on the target sample translation text to obtain target sample text embedding features;

[0009] Based on the embedding features of the original sample text and the embedding features of the target sample text, a preset original translation optimization model is trained to obtain a target translation optimization model;

[0010] Performing a preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text;

[0011] Performing text feature extraction on the initial translation text to obtain initial text embedding features;

[0012] The initial text embedding features are translated and optimized by the target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

[0013] In some embodiments, the step of performing translation optimization on the initial text embedding features by using the target translation optimization model to obtain a target translation text includes:

[0014] Performing editing operation prediction on the initial text embedding features through the target translation optimization model to obtain target candidate editing operations;

[0015] Calculating an edit score for the target candidate edit operation to obtain a target candidate edit score;

[0016] Determining a target editing operation plan based on the target candidate editing score;

[0017] Editing the initial text embedding feature based on the target editing operation scheme to obtain a target text embedding feature;

[0018] The target text embedding features are decoded to obtain the target translated text.

[0019] In some embodiments, calculating the edit score of the target candidate edit operation to obtain the target candidate edit score includes:

[0020] Editing the initial text embedding feature based on the target candidate editing operation to obtain a target candidate editing embedding feature;

[0021] A matrix is ​​constructed based on the target candidate edit embedding features and the initial text embedding features to obtain a candidate text edit matrix; wherein the candidate text edit matrix includes a plurality of candidate text elements;

[0022] For each of the candidate text elements, an edit distance calculation is performed on the candidate text element to obtain the target candidate edit score.

[0023] In some embodiments, determining a target editing operation scheme based on the target candidate editing score includes:

[0024] Selecting the score with the smallest value from the target candidate edit scores as the target edit score;

[0025] The target candidate editing operations are arranged according to the target editing scores to obtain the target editing operation plan.

[0026] In some embodiments, the target editing operation scheme includes an insert operation; and the editing the initial text embedding feature based on the target editing operation scheme to obtain the target text embedding feature includes:

[0027] Determine the target element insertion position based on the insertion operation;

[0028] Predicting an insertion element based on the target element insertion position and the initial text embedding feature to obtain a target insertion element;

[0029] The target insertion element is added to the initial text embedding feature based on the target element insertion position to obtain the target text embedding feature.

[0030] In some embodiments, the target editing operation scheme includes a deletion operation; and the editing the initial text embedding feature based on the target editing operation scheme to obtain the target text embedding feature includes:

[0031] Determine the target element deletion position according to the deletion operation;

[0032] The initial text embedding feature is deleted and edited based on the target element deletion position to obtain the target text embedding feature.

[0033] In some embodiments, the performing model training on a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model includes:

[0034] Predicting the editing operation of the original sample text embedding features by using the original translation optimization model to obtain sample candidate editing operations;

[0035] Calculate an edit score based on the sample candidate edit operation to obtain a sample candidate edit score;

[0036] Determining a sample editing operation plan based on the sample candidate editing score;

[0037] Edit the embedded features of the original sample text based on the sample editing operation scheme to obtain sample translation optimization data;

[0038] Performing loss calculation based on the sample translation optimization data and the target sample text embedding features to obtain translation optimization loss data;

[0039] The parameters of the original translation optimization model are adjusted based on the translation optimization loss data to obtain the target translation optimization model.

[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a machine translation device, the device comprising:

[0041] A sample data acquisition module is used to acquire a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text;

[0042] A sample text feature extraction module is used to extract text features from the original sample translation text to obtain the original sample text embedding features, and to extract text features from the target sample translation text to obtain the target sample text embedding features;

[0043] An optimization model training module, used to perform model training on a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model;

[0044] A preliminary translation module, used to perform preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text;

[0045] A target text feature extraction module is used to extract text features from the initial translation text to obtain initial text embedding features;

[0046] The target translation optimization module is used to perform translation optimization on the initial text embedding features through the target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

[0047] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0048] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0049] The translation optimization method and device, electronic device and storage medium proposed in the present application obtain translation optimization samples; wherein the translation optimization samples include original sample translation text and target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text; text feature extraction is performed on the original sample translation text to obtain the original sample text embedding feature, and text feature extraction is performed on the target sample translation text to obtain the target sample text embedding feature; model training is performed on a preset original translation optimization model based on the original sample text embedding feature and the target sample text embedding feature to obtain a target translation optimization model, thereby improving the learning ability and optimization ability of the translation optimization model, and performing a preliminary translation on a pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text; text feature extraction is performed on the initial translation text to obtain the initial text embedding feature; translation optimization is performed on the initial text embedding feature through the target translation optimization model to obtain the target translation text; wherein the language of the target translation text is the same as the language of the initial translation text, thereby ensuring the semantic accuracy of the translation result and being more in line with the expression habits of the target language, thereby improving the accuracy of machine translation. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flowchart of the translation optimization method provided in an embodiment of the present application;

[0051] Figure 2 yes Figure 1 Flow chart of step S103 in FIG.

[0052] Figure 3 yes Figure 1 Flow chart of step S106 in FIG.

[0053] Figure 4 yes Figure 3 Flow chart of step S302 in FIG.

[0054] Figure 5 yes Figure 3 Flow chart of step S303 in FIG.

[0055] Figure 6 yes Figure 3 A flowchart of step S304 in FIG.

[0056] Figure 7 yes Figure 3 Another flowchart of step S304 in;

[0057] Figure 8 is a schematic diagram of the structure of a machine translation device provided in an embodiment of the present application;

[0058] Fig. 9It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0060] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0062] First, some nouns involved in this application are analyzed:

[0063] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a 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.

[0064] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0065] Machine Translation (MT) refers to the technology of automatically translating text or speech from one language into another using computer software. It is an important branch of natural language processing, involving multiple disciplines such as computer science, artificial intelligence and linguistics. The purpose of machine translation is to automatically convert text or speech content in the source language (original language) into the target language (target language), while preserving the meaning and context of the original text as much as possible.

[0066] Machine translation can be applied in a variety of scenarios. For example, in the financial field, machine translation of contracts, agreements, materials, information and other contents related to international cooperation can be performed.

[0067] At present, deep learning models are mainly used to achieve translation based on language rules. However, in actual application scenarios, the source language texts are mostly complex or have multiple meanings. Machine translation cannot accurately understand the cultural background and language habits of the source language texts, which affects the accuracy of machine translation.

[0068] Based on this, the embodiments of the present application provide a translation optimization method and device, an electronic device and a storage medium, aiming to improve the accuracy of machine translation.

[0069] The embodiments of the present application provide a translation optimization method and device, an electronic device, and a storage medium, which are specifically described through the following embodiments. First, the translation optimization method in the embodiments of the present application is described.

[0070] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, 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.

[0071] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0072] The translation optimization method provided in the embodiment of the present application relates to the field of artificial intelligence and financial technology. The translation optimization method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the translation optimization method, etc., but is not limited to the above forms.

[0073] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0074] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0075] Figure 1 is an optional flowchart of the translation optimization method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0076] Step S101, obtaining a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text;

[0077] Step S102, extracting text features from the original sample translation text to obtain the original sample text embedding features, and extracting text features from the target sample translation text to obtain the target sample text embedding features;

[0078] Step S103, training a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model;

[0079] Step S104, performing a preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text;

[0080] Step S105, extracting text features from the initial translation text to obtain initial text embedding features;

[0081] Step S106, performing translation optimization on the initial text embedding features through a target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

[0082] In steps S101 to S106 shown in the embodiment of the present application, first, by extracting text features from the original sample translation text and the target sample translation text and training the original translation optimization model, the subtle differences between the two translation texts can be captured, thereby improving the learning and optimization capabilities of the translation optimization model, and then the initial translation text after preliminary translation is optimized through the target translation optimization model, ensuring that the translation result is not only semantically accurate, but also more in line with the expression habits and context of the target language, thereby improving the accuracy of machine translation.

[0083] In step S101 of some embodiments, the translation optimization sample is a training sample obtained by manual verification and optimization, and is used to train the original translation optimization model.

[0084] Specifically, the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text, and both can be identified as the target language;

[0085] It should be noted that the original sample translation text is obtained after a preliminary translation of the text in the initial language through a pre-trained deep learning model. It may have problems such as inaccurate translation, semantic understanding deviation, grammatical errors, etc.; the target sample translation text is obtained after the original sample translation text is verified and optimized by technicians or verified models. The target sample translation text has accurate semantics, accurate grammatical expression, and conforms to the expression habits of the target language.

[0086] Among them, the target language and the initial language are not the same.

[0087] In step S102 of some embodiments, text features are extracted from the original sample translation text and the target sample translation text through a pre-trained text encoding model, and then converted into vector representations, namely, text embedding features.

[0088] Specifically, the text encoding model may adopt a Word2Vec model, a BERT model, a GloVe model, etc., but is not limited thereto.

[0089] In some embodiments, before step S103, the translation optimization method further includes constructing an original translation optimization model, wherein the original translation optimization model is composed of a decoder of a text encoding model and an autoregressive model. The model formed by such a combination can be more powerful than the ability of using only a decoder, and can improve the effect of translation optimization.

[0090] See also Figure 2 In some embodiments, step S103 may include but is not limited to steps S201 to S206:

[0091] Step S201, predicting the editing operation of the original sample text embedding features through the original translation optimization model to obtain the sample candidate editing operation;

[0092] Step S202, calculating an edit score based on the sample candidate edit operation to obtain a sample candidate edit score;

[0093] Step S203, determining a sample editing operation plan based on the sample candidate editing score;

[0094] Step S204, editing the original sample text embedding features based on the sample editing operation scheme to obtain sample translation optimization data;

[0095] Step S205, performing loss calculation based on the sample translation optimization data and the target sample text embedding features to obtain translation optimization loss data;

[0096] Step S206: adjusting parameters of the original translation optimization model based on the translation optimization loss data to obtain a target translation optimization model.

[0097] In the steps S201 to S206 shown in the embodiment of the present application, the original sample text embedding features are predicted for editing operations through the original translation optimization model to obtain sample candidate editing operations, and the sample candidate editing scores of the sample candidate editing operations are calculated to determine the sample editing operation plan based on the sample candidate editing scores, thereby performing targeted editing on the original sample text embedding features, and effectively improving the quality of text embedding. Subsequently, the original sample text embedding features are edited based on the sample editing operations to obtain sample translation optimization data, and the loss is calculated with the target sample text embedding features, thereby verifying the model's capabilities and adjusting the model, improving the robustness and generalization ability of the translation optimization model, and thus improving the accuracy of machine translation.

[0098] In step S201 of some embodiments, the original translation optimization model includes an original insertion operation prediction model and an original deletion operation prediction model;

[0099] Among them, the original insertion operation prediction model is used to determine whether it is necessary to perform insertion editing on the embedded features of the original sample text. If insertion editing is required, the operation identifier used to characterize the insertion operation and the corresponding position of the insertion operation are output; the original deletion operation prediction model is used to determine whether it is necessary to perform deletion editing on the embedded features of the original sample text. If deletion editing is required, the operation identifier used to characterize the deletion operation and the corresponding position of the deletion operation are output.

[0100] It should be noted that an element may specifically correspond to a word, a letter, or a phrase, but is not limited thereto.

[0101] It should be noted that if it is a replacement operation, the corresponding element needs to be deleted first, and then the new element is inserted. Therefore, the original deletion operation prediction model can be used to predict the position of the element where the deletion operation needs to be performed, and then the original insertion operation prediction model can be used to predict the position of the element where the insertion operation needs to be performed. If the position of the element where the deletion operation needs to be performed is the same as the position of the element where the insertion operation needs to be performed, it is a replacement operation.

[0102] It should be noted that the original candidate editing operation includes multiple sample candidate editing sub-operations. When the editing operation is predicted for the original sample text embedding features through the original translation optimization model, multiple sample candidate editing sub-operations will be predicted at the same time; wherein each sample candidate editing sub-operation is one of a deletion operation, an insertion operation, and a replacement operation.

[0103] In some embodiments, step S202 may include but is not limited to the following steps:

[0104] Edit the original sample text embedding feature based on the sample candidate editing operation to obtain the sample candidate editing embedding feature;

[0105] A matrix is ​​constructed based on the sample candidate edit embedding features and the original sample text embedding features to obtain a candidate sample text edit matrix; wherein the candidate sample text edit matrix includes multiple candidate sample text elements;

[0106] For each candidate sample text element, the edit distance of the candidate sample text element is calculated to obtain the sample candidate edit score.

[0107] Specifically, for each sample candidate editing sub-operation, the original sample text embedding feature is edited based on the sample candidate editing sub-operation to obtain the sample candidate editing embedding feature, which is used to calculate the distance between the sample candidate editing embedding feature and the original sample text embedding feature.

[0108] In some embodiments, it can be assumed that the length of the original sample text embedding feature is P, and the length of the sample candidate edit embedding feature is Q. Then, a matrix is ​​constructed based on the sample candidate edit embedding features and the original sample text embedding features. The obtained sample candidate edit embedding features can be a matrix of dimension (P+1)*(Q+1), wherein the remaining positions of the first row of the matrix except the first element are the content of the original sample text embedding feature, and the remaining positions of the first column of the matrix except the first element are the content of the sample candidate edit embedding feature.

[0109] Specifically, the sample candidate edit embedding feature is set to D1, and the dimension is (P+1)*(Q+1);

[0110] Then the candidate sample text element is recorded as D1[i][j], i∈(0,P), j∈(0,Q);

[0111] The editing score is calculated for each candidate sample text element D1[i][j]. The specific calculation process is as follows:

[0112]

[0113] Among them, D1[i][j] is the sample candidate editing score, which is obtained by editing calculation through dynamic programming algorithm, s1[i] is the translated text before editing, that is, the embedding feature of the original sample text, and t1[j] is the translated text after editing, that is, the embedding feature of the sample candidate editing, thereby verifying the difference before and after editing to drive editing optimization.

[0114] It should be noted that the otherwise corresponding cases are the cases other than i=0 and j=0. In the otherwise case, the specific calculation method is implemented by a dynamic programming algorithm, but is not limited thereto.

[0115] Specifically, if D1[i][j]=D1[i-1][j]+1, according to the preset editing behavior mapping rule, the sample candidate editing operation is determined to be a deletion operation;

[0116] If D1[i][j]=D1[i][j-1]+1, according to the preset editing behavior mapping rule, the sample candidate editing operation is determined to be an insert operation;

[0117] If D1[i][j]=D1[i-1][j-1]+(s1[i]≠t1[j]), the sample candidate editing operation is determined to be a replacement operation according to a preset editing behavior mapping rule.

[0118] By calculating the distance for each candidate sample text element, the shortest edit distance obtained recursively is the sample candidate edit score. The specific implementation scheme is basically the same as the calculation method of the dynamic programming algorithm, but is not limited thereto.

[0119] In some embodiments, step S203 may also include, but is not limited to:

[0120] The smallest score among the sample candidate editing scores is selected as the sample editing score;

[0121] The candidate editing operations of the samples are arranged according to the sample editing scores to obtain a sample editing operation plan.

[0122] In steps S501 to S502 shown in the embodiment of the present application, a dynamic programming algorithm is used to calculate the editing scores of sample candidate editing operations to obtain multiple sample candidate editing scores, and the sample candidate editing scores are screened to obtain the score with the smallest numerical value, and then the multiple sample candidate editing sub-operations are arranged according to the sample editing scores to obtain a sample editing operation plan, which can efficiently and accurately find the translation optimization plan with the smallest editing distance, thereby improving the efficiency of translation optimization and improving the quality and accuracy of translation optimization.

[0123] It should be noted that there are multiple sample candidate editing scores, corresponding to multiple different editing schemes. Specifically, the sample candidate editing score is used to characterize the editing distance required to edit the original sample text embedding feature to the sample candidate editing embedding feature, which can be specifically understood as the number of different editing operations. The more the number of editing operations, the more computing resources are required and the longer the editing time is. Therefore, it is necessary to screen out the sample candidate editing score with the smallest value.

[0124] According to the editing scheme determined by the sample editing score, multiple sample candidate editing sub-operations are arranged and fine-tuned to obtain a sample editing operation scheme, wherein the sample editing operation scheme includes at least one of the following: a deletion operation, an insertion operation, and a replacement operation.

[0125] In some embodiments, if the sample editing operation scheme includes an insert operation, step S204 includes but is not limited to:

[0126] Determine the insertion position of the sample element based on the insertion operation;

[0127] Predict the inserted element based on the sample element insertion position and the original sample text embedding features to obtain the sample inserted element;

[0128] The sample insertion element is added to the original sample text embedding feature based on the sample element insertion position to obtain sample translation optimization data.

[0129] It can be understood that, since the prediction of the insert operation is implemented by the original insert operation prediction model, the result output by the original insert operation prediction model includes an operation identifier for characterizing the insert operation and a corresponding position of the insert operation;

[0130] Therefore, the insertion position of the sample element can be obtained from the corresponding position of the insertion operation in the insertion operation;

[0131] Specifically, one sample element insertion position corresponds to one element.

[0132] In some embodiments, the sample insertion element is predicted from a preset vocabulary by using a preset insertion element prediction model, in combination with the number of sample element insertion positions and context information;

[0133] In some embodiments, contextual information can be extracted via an attention mechanism.

[0134] In some embodiments, if the sample editing operation scheme includes a deletion operation, step S204 may also include but is not limited to:

[0135] Determine the deletion position of the sample element according to the deletion operation;

[0136] The original sample text embedding features are deleted and edited based on the sample element deletion positions to obtain sample translation optimization data.

[0137] It can be understood that, since the prediction of the deletion operation is implemented by the sample deletion operation prediction model, the result output by the sample deletion operation prediction model includes an operation identifier for characterizing the deletion operation and a corresponding position of the deletion operation;

[0138] Therefore, the deletion position of the sample element can be obtained from the corresponding position of the deletion operation in the deletion operation;

[0139] Thus, the corresponding elements in the original sample text embedding feature are deleted and edited according to the sample element deletion position, so as to obtain sample translation optimization data.

[0140] In some embodiments, if the sample editing operation scheme includes a replacement operation, step S204 may also include but is not limited to:

[0141] Determine the sample element replacement position and the sample replacement element according to the replacement operation;

[0142] The original sample text embedding features are replaced and edited based on the sample element replacement position and the sample replacement element to obtain sample translation optimization data.

[0143] It can be understood, however, that since the replacement operation requires deleting the corresponding element and then inserting a new element, the sample replacement element can be predicted from a preset vocabulary by a preset insertion element prediction model, combined with the number of sample element replacement positions and context information.

[0144] In step S205 of some embodiments, loss calculation is performed based on the sample translation optimization data and the target sample text embedding features, and the loss function such as mean square error loss function, cross entropy loss function, likelihood loss function, adversarial loss function, etc. can be used for calculation, but is not limited to this.

[0145] In step S206 of some embodiments, a gradient descent method may be used to adjust parameters of the original translation optimization model based on the translation optimization loss data to reduce the difference between the sample translation optimization data and the target sample text embedding features, thereby improving the performance of the translation optimization model.

[0146] In step S104 of some embodiments, the source language text is initially translated using a pre-trained machine translation model to obtain an initial translation text;

[0147] Specifically, the pre-trained machine translation model may be a recurrent neural network model, a long short-term memory network model, a BERT model, an autoregressive model (such as a Transformer model), etc., but is not limited thereto.

[0148] In step S105 of some embodiments, text features are extracted from the initial translation text using a pre-trained text encoding model and converted into vector representations, namely text embedding features, to obtain initial text embedding features.

[0149] Specifically, the text encoding model may adopt a Word2Vec model, a BERT model, a GloVe model, etc., but is not limited thereto.

[0150] See also Figure 3 In some embodiments, step S106 may include but is not limited to steps S301 to S305:

[0151] Step S301, predicting the editing operation of the initial text embedding features through the target translation optimization model to obtain the target candidate editing operation;

[0152] Step S302, calculating the edit score of the target candidate edit operation to obtain the target candidate edit score;

[0153] Step S303, determining a target editing operation plan based on the target candidate editing score;

[0154] Step S304, editing the initial text embedding feature based on the target editing operation scheme to obtain the target text embedding feature;

[0155] Step S305: Decode the embedded features of the target text to obtain the target translated text.

[0156] In steps S301 to S305 shown in the embodiment of the present application, the target translation optimization model is used to predict the editing operation of the initial text embedding features to obtain the target candidate editing operation, and the editing score of the target candidate editing operation is calculated to obtain the target candidate editing score; the target editing operation plan is determined based on the target candidate editing score, so as to ensure the efficiency and accuracy of the editing operation; then, the initial text embedding features are edited based on the target editing operation plan to obtain the target text embedding features, and the target text embedding features are decoded to obtain the target translated text, thereby enhancing the accuracy and naturalness of machine translation and making the translation output more in line with the expression habits and semantic requirements of the target language.

[0157] In step S301 of some embodiments, the target translation optimization model includes a target insertion operation prediction model and a target deletion operation prediction model;

[0158] Among them, the target insertion operation prediction model is used to determine whether the initial text embedding feature needs to be inserted and edited. If insertion and editing are required, the operation identifier used to characterize the insertion operation and the corresponding position of the insertion operation are output; the target deletion operation prediction model is used to determine whether the initial text embedding feature needs to be deleted and edited. If deletion and editing are required, the operation identifier used to characterize the deletion operation and the corresponding position of the deletion operation are output.

[0159] It should be noted that an element may specifically correspond to a word, a letter, or a phrase, but is not limited thereto.

[0160] It should be noted that if it is a replacement operation, the corresponding element needs to be deleted first, and then the new element is inserted. Therefore, the target deletion operation prediction model can be used to predict the position of the element where the deletion operation needs to be performed, and then the target insertion operation prediction model can be used to predict the position of the element where the insertion operation needs to be performed. If the position of the element where the deletion operation needs to be performed is the same as the position of the element where the insertion operation needs to be performed, it is a replacement operation.

[0161] It should be noted that the target candidate editing operation includes multiple target candidate editing sub-operations. When the editing operation is predicted for the initial text embedding features through the target translation optimization model, multiple target candidate editing sub-operations will be predicted at the same time; wherein each target candidate editing sub-operation is one of a deletion operation, an insertion operation, and a replacement operation.

[0162] See also Figure 4 In some embodiments, step S302 may include but is not limited to steps S401 to S403:

[0163] Step S401, editing the initial text embedding feature based on the target candidate editing operation to obtain the target candidate edit embedding feature;

[0164] Step S402, constructing a matrix based on the target candidate edit embedding features and the initial text embedding features to obtain a candidate text edit matrix; wherein the candidate text edit matrix includes a plurality of candidate text elements;

[0165] Step S403: For each candidate text element, calculate the edit distance of the candidate text element to obtain a target candidate edit score.

[0166] In steps S401 to S403 shown in the embodiment of the present application, the target candidate edit embedding features are obtained by editing the initial text embedding features based on the target candidate edit operation, and a matrix is ​​constructed based on the target candidate edit embedding features and the initial text embedding features to obtain a candidate text edit matrix; wherein the candidate text edit matrix includes multiple candidate text elements; and then a dynamic programming algorithm is used to calculate the edit distance of each candidate text element in the candidate text edit matrix to obtain a target candidate edit score to evaluate the computational complexity of each edit operation, which helps to improve the efficiency of subsequent translation optimization, helps to achieve more refined text adjustments during the translation optimization process, and improves the quality of the final translation result.

[0167] In step S401 of some embodiments, for each target candidate editing sub-operation, the initial text embedding feature is edited based on the target candidate editing sub-operation to obtain a target candidate editing embedding feature, which is used to calculate the distance between the target candidate editing embedding feature and the initial text embedding feature.

[0168] In step S402 of some embodiments, it can be assumed that the length of the initial text embedding feature is M and the length of the target candidate edit embedding feature is N. Then, a matrix is ​​constructed based on the target candidate edit embedding feature and the initial text embedding feature, and the obtained candidate text edit matrix can be a matrix of dimension (M+1)*(N+1), wherein the remaining positions of the first row of the matrix except the first element are the content of the initial text embedding feature, and the remaining positions of the first column of the matrix except the first element are the content of the target candidate edit embedding feature.

[0169] Specifically, the candidate text editing matrix is ​​set to D2, with a dimension of (M+1)*(N+1);

[0170] Then the candidate text element is recorded as D2[i][j], i∈(0,M), j∈(0,N);

[0171] The editing score is calculated for each candidate text element D2[i][j]. The specific calculation process is as follows:

[0172]

[0173] Among them, D2[i][j] is the target candidate edit score, which is obtained by editing calculation through dynamic programming algorithm, s2[i] is the translated text before editing, that is, the initial text embedding feature, and t2[j] is the translated text after editing, that is, the target candidate edit embedding feature, thereby verifying the difference before and after editing to drive editing optimization.

[0174] It should be noted that the otherwise corresponding cases are the cases other than i=0 and j=0. In the otherwise case, the specific calculation method is implemented by a dynamic programming algorithm, but is not limited thereto.

[0175] Specifically, if D2[i][j]=D2[i-1][j]+1, according to the preset editing behavior mapping rule, the target candidate editing operation is determined to be a deletion operation;

[0176] If D2[i][j]=D2[i][j-1]+1, according to the preset editing behavior mapping rule, the target candidate editing operation is determined to be an insert operation;

[0177] If D2[i][j]=D2[i-1][j-1]+(s2[i]≠t2[j]), the target candidate editing operation is determined to be a replacement operation according to a preset editing behavior mapping rule.

[0178] In step S403 of some embodiments, by performing distance calculation on each candidate text element, the shortest edit distance obtained recursively is the target candidate edit score. The specific implementation scheme is basically the same as the calculation method of the dynamic programming algorithm and is not limited thereto.

[0179] See also Figure 5 In some embodiments, step S303 may also include but is not limited to steps S501 to S502:

[0180] Step S501, selecting the score with the smallest value from the target candidate edit scores as the target edit score;

[0181] Step S502: Arrange target candidate editing operations according to the target editing scores to obtain a target editing operation plan.

[0182] In steps S501 to S502 shown in the embodiment of the present application, a dynamic programming algorithm is used to calculate the editing scores of the target candidate editing operations to obtain multiple target candidate editing scores, and the target candidate editing scores are screened to obtain the score with the smallest numerical value. Then, the multiple target candidate editing sub-operations are arranged according to the target editing scores to obtain the target editing operation plan, which can efficiently and accurately find the translation optimization plan with the smallest editing distance, thereby improving the efficiency of translation optimization and improving the quality and accuracy of translation optimization.

[0183] It should be noted that there are multiple target candidate editing scores, corresponding to multiple different editing schemes. Specifically, the target candidate editing score is used to characterize the editing distance required from the initial text embedding feature editing to the target candidate editing embedding feature, which can be specifically understood as the number of different editing operations. The more the number of editing operations, the more computing resources are required and the longer the editing time is. Therefore, it is necessary to screen out the target candidate editing score with the smallest value.

[0184] In step S502 of some embodiments, multiple target candidate editing sub-operations are arranged and fine-tuned according to the editing scheme determined by the target editing score to obtain a target editing operation scheme, wherein the target editing operation scheme includes at least one of the following: a deletion operation, an insertion operation, and a replacement operation.

[0185] See also Figure 6 In some embodiments, if the target editing operation scheme includes an insert operation, step S304 includes but is not limited to steps S601 to S603:

[0186] Step S601, determining the target element insertion position based on the insertion operation;

[0187] Step S602, predicting the inserted element based on the target element insertion position and the initial text embedding features to obtain the target inserted element;

[0188] Step S603: adding the target insertion element to the initial text embedding feature based on the target element insertion position to obtain the target text embedding feature.

[0189] In steps S601 to S603 shown in the embodiment of the present application, the operation type is identified by the operation identifier included in the target editing operation scheme. If the target editing operation scheme includes an insert operation, the target element insertion position is determined based on the insert operation, and the insert element is predicted based on the target element insertion position and the initial text embedding feature. The context information of the translated text is fully considered to accurately obtain the target insert element. Furthermore, the target insert element is added to the initial text embedding feature based on the target element insertion position to obtain the target text embedding feature, thereby improving the accuracy of machine translation.

[0190] It can be understood that, since the prediction of the insert operation is implemented by the target insert operation prediction model, the result output by the target insert operation prediction model includes an operation identifier for characterizing the insert operation and a corresponding position of the insert operation;

[0191] Therefore, the insertion position of the target element can be obtained from the corresponding position of the insertion operation in the insertion operation;

[0192] Specifically, one target element insertion position corresponds to one element.

[0193] In step S602 of some embodiments, a target insertion element is predicted from a preset vocabulary using a preset insertion element prediction model in combination with the number of target element insertion positions and context information;

[0194] In some embodiments, contextual information can be extracted via an attention mechanism.

[0195] Specifically, extracting context information through the attention mechanism may include but is not limited to the following steps:

[0196] Performing a linear transformation on each initial text element in the initial text embedding feature to obtain an initial element transformation matrix; wherein the initial element transformation matrix includes an initial query transformation matrix, an initial key transformation matrix and an initial value transformation matrix;

[0197] Obtaining a preset attention factor based on the data dimension of the initial query transformation matrix;

[0198] Based on the preset attention factor, the initial query transformation matrix and the initial key transformation matrix are aggregated and calculated to obtain the initial element attention score;

[0199] The initial element attention score is weighted by the activation function to obtain the initial element attention weight;

[0200] Perform weighted summation of the initial element attention weight and the initial value transformation matrix to obtain the initial element attention data;

[0201] Combine multiple initial element attention data to obtain contextual information.

[0202] It should be noted that the activation function can be a softmax function, a Tanh function, a ReLU function, etc., but is not limited thereto;

[0203] The preset attention factor is used to stabilize the gradient of the attention mechanism during calculation to ensure a better understanding of the associated information in the initial text elements and improve the feature learning ability.

[0204] The aggregation calculation is specifically as follows: multiply the initial query transformation matrix and the initial key transformation matrix to obtain the initial product data, and then divide the product data by the preset attention factor to obtain the initial element attention score.

[0205] By extracting contextual information through the attention mechanism, we can fully consider the correlation between elements in the initial text embedding features, so that the context can be considered when performing translation optimization, which improves the semantic expression ability and context sensitivity of the text embedding features and provides strong support for subsequent translation optimization tasks.

[0206] In step S603 of some embodiments, the target insertion element is inserted into the initial text embedding feature based on the target element insertion position to obtain the target text embedding feature.

[0207] It should be noted that if the target editing operation scheme also includes a deletion operation, a replacement operation, etc., then after step S603, the corresponding deletion operation and replacement operation need to be performed to obtain the final target text embedding feature.

[0208] See also Figure 7 In some embodiments, if the target editing operation scheme includes a delete operation, step S304 may also include but is not limited to steps S701 to S702:

[0209] Step S701, determining the target element deletion position according to the deletion operation;

[0210] Step S702: Deletion edit the initial text embedding feature based on the target element deletion position to obtain the target text embedding feature.

[0211] In steps S701 to S702 shown in the embodiment of the present application, the operation type is identified by the operation identifier included in the target editing operation scheme. If the target editing operation scheme includes a deletion operation, the target element deletion position is determined according to the deletion operation, and the initial text embedding feature is deleted and edited based on the target element deletion position to obtain the target text embedding feature, thereby improving the accuracy of machine translation.

[0212] It can be understood that, since the prediction of the deletion operation is implemented by the target deletion operation prediction model, the result output by the target deletion operation prediction model includes an operation identifier for characterizing the deletion operation and a corresponding position of the deletion operation;

[0213] Therefore, the target element deletion position can be obtained from the corresponding position of the deletion operation in the deletion operation;

[0214] Thus, the corresponding elements in the initial text embedding feature are deleted and edited according to the target element deletion position to obtain the target text embedding feature.

[0215] In some embodiments, if the target editing operation scheme includes a replacement operation, step S304 may also include but is not limited to:

[0216] Determine the target element replacement position and the target replacement element according to the replacement operation;

[0217] The initial text embedding feature is replaced and edited based on the target element replacement position and the target replacement element to obtain the target text embedding feature.

[0218] By identifying the operation type of the operation identifier contained in the target editing operation scheme, if the target editing operation scheme includes a replacement operation, the target element replacement position and the target replacement element are determined according to the replacement operation, and the initial text embedding features are replaced and edited based on the target element replacement position and the target replacement element to obtain the target text embedding features, thereby improving the accuracy of machine translation.

[0219] It can be understood, however, that since the replacement operation requires deleting the corresponding element and then inserting a new element, the target replacement element can be predicted from a preset vocabulary by a preset insertion element prediction model, combined with the number of target element replacement positions and context information; the specific implementation method is basically the same as the implementation method of the above-mentioned step S602 and will not be repeated here.

[0220] In step S305 of some embodiments, since the model is processed in vector representation, it is necessary to decode the target text embedding features finally obtained and convert them into text representation to obtain the target translated text.

[0221] See also Figure 8 The present application also provides a translation optimization device, which can implement the above translation optimization method, and the device includes:

[0222] The sample data acquisition module 801 is used to acquire a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text;

[0223] The sample text feature extraction module 802 is used to extract text features from the original sample translation text to obtain the original sample text embedding features, and to extract text features from the target sample translation text to obtain the target sample text embedding features;

[0224] The optimization model training module 803 is used to perform model training on a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model;

[0225] A preliminary translation module 804 is used to perform preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text;

[0226] The target text feature extraction module 805 is used to extract text features from the initial translation text to obtain initial text embedding features;

[0227] The target translation optimization module 806 is used to perform translation optimization on the initial text embedding features through a target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

[0228] The specific implementation of the translation optimization device is basically the same as the specific implementation of the above-mentioned translation optimization method, and will not be repeated here.

[0229] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above translation optimization method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0230] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0231] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0232] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the translation optimization method of the embodiment of this application;

[0233] Input / output interface 903, used to implement information input and output;

[0234] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0235] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0236] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0237] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned translation optimization method is implemented.

[0238] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0239] The translation optimization method and device, electronic device and storage medium provided by the embodiments of the present application obtain a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text; text feature extraction is performed on the original sample translation text to obtain the original sample text embedding feature, and text feature extraction is performed on the target sample translation text to obtain the target sample text embedding feature; model training is performed on a preset original translation optimization model based on the original sample text embedding feature and the target sample text embedding feature to obtain a target translation optimization model, thereby improving the learning ability and optimization ability of the translation optimization model, performing a preliminary translation on a pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text; text feature extraction is performed on the initial translation text to obtain the initial text embedding feature; translation optimization is performed on the initial text embedding feature through the target translation optimization model to obtain the target translation text; wherein the language of the target translation text is the same as the language of the initial translation text, thereby ensuring the semantic accuracy of the translation result and being more in line with the expression habits of the target language, thereby improving the accuracy of machine translation.

[0240] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0241] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0242] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0243] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0244] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0245] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0246] In the several embodiments provided in the present application, it should be understood that the disclosed 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 above 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.

[0247] The units described above 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.

[0248] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0249] If the integrated unit 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, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0250] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A translation optimization method, characterized in that: The method comprises: Obtaining a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text; Performing text feature extraction on the original sample translation text to obtain original sample text embedding features, and performing text feature extraction on the target sample translation text to obtain target sample text embedding features; Based on the embedding features of the original sample text and the embedding features of the target sample text, a preset original translation optimization model is trained to obtain a target translation optimization model; Performing a preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text; Performing text feature extraction on the initial translation text to obtain initial text embedding features; The initial text embedding features are translated and optimized by the target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

2. The method according to claim 1, characterized in that The step of performing translation optimization on the initial text embedding features through the target translation optimization model to obtain a target translation text includes: Performing editing operation prediction on the initial text embedding features through the target translation optimization model to obtain target candidate editing operations; Calculating an edit score for the target candidate edit operation to obtain a target candidate edit score; Determining a target editing operation plan based on the target candidate editing score; Editing the initial text embedding feature based on the target editing operation scheme to obtain a target text embedding feature; The target text embedding features are decoded to obtain the target translated text.

3. The method according to claim 2, characterized in that The step of calculating the edit score of the target candidate edit operation to obtain the target candidate edit score includes: Editing the initial text embedding feature based on the target candidate editing operation to obtain a target candidate editing embedding feature; A matrix is ​​constructed based on the target candidate edit embedding features and the initial text embedding features to obtain a candidate text edit matrix; wherein the candidate text edit matrix includes a plurality of candidate text elements; For each of the candidate text elements, an edit distance calculation is performed on the candidate text element to obtain the target candidate edit score.

4. The method according to claim 2, characterized in that: The determining of a target editing operation scheme based on the target candidate editing score comprises: Selecting the score with the smallest value from the target candidate edit scores as the target edit score; The target candidate editing operations are arranged according to the target editing scores to obtain the target editing operation plan.

5. The method according to claim 2, characterized in that: The target editing operation scheme includes an insert operation; and the initial text embedding feature is edited based on the target editing operation scheme to obtain the target text embedding feature, including: Determine the target element insertion position based on the insertion operation; Predicting an insertion element based on the target element insertion position and the initial text embedding feature to obtain a target insertion element; The target insertion element is added to the initial text embedding feature based on the target element insertion position to obtain the target text embedding feature.

6. The method according to claim 2, characterized in that The target editing operation scheme includes a deletion operation; and the initial text embedding feature is edited based on the target editing operation scheme to obtain the target text embedding feature, including: Determine the target element deletion position according to the deletion operation; The initial text embedding feature is deleted and edited based on the target element deletion position to obtain the target text embedding feature.

7. The method according to any one of claims 1 to 6, characterized in that: The method of training a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model includes: Predicting the editing operation of the original sample text embedding features by using the original translation optimization model to obtain sample candidate editing operations; Calculate an edit score based on the sample candidate edit operation to obtain a sample candidate edit score; Determining a sample editing operation plan based on the sample candidate editing score; Edit the embedded features of the original sample text based on the sample editing operation scheme to obtain sample translation optimization data; Performing loss calculation based on the sample translation optimization data and the target sample text embedding features to obtain translation optimization loss data; The parameters of the original translation optimization model are adjusted based on the translation optimization loss data to obtain the target translation optimization model.

8. A translation optimization device, characterized in that: The device comprises: A sample data acquisition module is used to acquire a translation optimization sample; wherein the translation optimization sample includes an original sample translation text and a target sample translation text; the language of the original sample translation text is the same as the language of the target sample translation text; A sample text feature extraction module is used to extract text features from the original sample translation text to obtain the original sample text embedding features, and to extract text features from the target sample translation text to obtain the target sample text embedding features; An optimization model training module, used to perform model training on a preset original translation optimization model based on the original sample text embedding features and the target sample text embedding features to obtain a target translation optimization model; A preliminary translation module, used to perform preliminary translation on the pre-acquired source language text to obtain an initial translation text; wherein the language of the initial translation text is different from the language of the source language text; A target text feature extraction module is used to extract text features from the initial translation text to obtain initial text embedding features; The target translation optimization module is used to perform translation optimization on the initial text embedding features through the target translation optimization model to obtain a target translation text; wherein the language of the target translation text is the same as the language of the initial translation text.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.