Translation model training, translation method and device

By calculating the information conversion difficulty index, screening out the training sample set and retraining the model, the problem of limited utilization of training data of existing machine translation models is solved, and the accuracy and performance of the translation model are improved.

CN115081462BActive Publication Date: 2025-01-10JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210678867.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-01-10
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

The existing machine translation model training data utilization technology has limited effect and is difficult to effectively improve translation performance.

Method used

By obtaining the training sample set, calculating the information conversion difficulty index, screening out the difficult sample set, inputting the remaining sample set to the translation model for training, and generating a new translation model to achieve knowledge distillation and data simplification.

Benefits of technology

It effectively improves the accuracy and performance of the translation model, simplifies the training data set, and helps improve the quality of the translation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115081462B_ABST
    Figure CN115081462B_ABST
Patent Text Reader

Abstract

The present application discloses a translation model training method and device, and relates to the field of machine translation technology. A specific implementation of the method includes: obtaining a training sample set; calculating the information conversion difficulty index of each training sample in the training sample set, and filtering out the first sub-training sample set in the training sample set to obtain a second sub-training sample set; for each source sentence in the first sub-training sample set, inputting the source sentence into a first translation model to obtain a corresponding new target sentence; training the first translation model based on the third sub-training sample set to obtain a second translation model. This implementation improves the accuracy of the translation model obtained by training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, specifically to the field of machine translation technology, and in particular to a translation model training, translation method and device. Background Art

[0002] Machine translation is an important research direction in the field of natural language processing and artificial intelligence, which aims to use computers to achieve automatic translation between natural languages. With the advent of the deep learning era, machine translation technology has made breakthrough progress, which not only comprehensively improves translation performance, but also provides the possibility for multi-modal and multi-language universal representation modeling.

[0003] Existing data utilization technologies mainly fall into two categories: the first category is to make full use of bilingual data, that is, to increase the information for model learning by simplifying the training data model or increasing data diversity; the second category is to use monolingual data to generate fake bilingual data, that is, to use monolingual data to fake bilingual data to increase the information for model learning. The evaluation indicators of translation datasets mainly include: dataset evaluation based on the source language, dataset evaluation based on the target language, and dataset evaluation based on the source and target.

[0004] The translation models obtained by using the above two data utilization techniques and evaluation indicators have limited model effects and need to be further improved. Summary of the invention

[0005] The embodiments of the present application provide a translation model training method, apparatus, device and storage medium.

[0006] According to the first aspect, an embodiment of the present application provides a translation model training method, the method comprising: obtaining a training sample set; calculating an information conversion difficulty index of each training sample in the training sample set, and filtering out a first sub-training sample set in the training sample set to obtain a second sub-training sample set; for each source sentence in the first sub-training sample set, inputting the source sentence into a first translation model to obtain a corresponding new target sentence; training the first translation model based on a third sub-training sample set to obtain a second translation model.

[0007] According to the second aspect, an embodiment of the present application provides a translation method, the method comprising: obtaining a sentence to be translated; inputting the sentence to be translated into the translation model to obtain a target sentence, wherein the translation model is a second translation model obtained by the method described in any implementation of the first aspect above.

[0008] According to a third aspect, an embodiment of the present application provides a translation model training device, which includes: a sample acquisition module, configured to acquire a training sample set; an index calculation module, configured to calculate an information conversion difficulty index of each training sample in the training sample set, and filter out the first sub-training sample set in the training sample set to obtain a second sub-training sample set; an input model module, configured to input each source sentence in the first sub-training sample set into a first translation model to obtain a corresponding new target sentence; and a generation model module, configured to train the first translation model based on the third sub-training sample set to obtain a second translation model.

[0009] According to a fourth aspect, an embodiment of the present application provides a translation device, comprising: a sentence acquisition module, configured to acquire a sentence to be translated; an output sentence module, configured to input the sentence to be translated into a translation model to obtain a target sentence, wherein the translation model is a second translation model obtained by the method described in any implementation of the first aspect above.

[0010] According to the fifth aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation method of the first aspect or the second aspect.

[0011] According to the sixth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner of the first aspect or the second aspect.

[0012] The present application obtains a training sample set; calculates the information conversion difficulty index of each training sample in the training sample set, and screens out the first sub-training sample set in the training sample set to obtain a second sub-training sample set; for each source sentence in the first sub-training sample set, inputs the source sentence into a first translation model to obtain a corresponding new target sentence; trains the first translation model based on the third sub-training sample set to obtain a second translation model, that is, through the conversion difficulty from the source sentence to the target sentence, that is, the information conversion difficulty index, to implement knowledge distillation on the training data set, thereby simplifying the training data set, which helps to effectively improve the accuracy of the translation model obtained through training.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1is an exemplary system architecture diagram to which the present application may be applied;

[0015] Figure 2 is a flowchart of an embodiment of a translation model training method according to the present application;

[0016] Figure 3 is a schematic diagram of an application scenario of the translation model training method according to the present application;

[0017] Figure 4 is a flowchart of another embodiment of the translation model training method according to the present application;

[0018] Figure 5 is a flowchart of another embodiment of the translation method according to the present application;

[0019] Figure 6 is a schematic diagram of an embodiment of a translation model training device according to the present application;

[0020] Figure 7 is a schematic diagram of an embodiment of a translation device according to the present application;

[0021] Figure 8 It is a structural diagram of a computer system suitable for implementing a server of an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the translation model training method of the present application can be applied.

[0025] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0026] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications, such as translation applications, communication applications, etc., may be installed on the terminal devices 101, 102, 103.

[0027] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to mobile phones and laptops. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide services for translation model training), or it can be implemented as a single software or software module. No specific limitation is made here.

[0028] The server 105 may be a server that provides various services, for example, obtaining a training sample set; calculating an information conversion difficulty index of each training sample in the training sample set, and filtering out a first sub-training sample set in the training sample set to obtain a second sub-training sample set; for each source sentence in the first sub-training sample set, inputting the source sentence into a first translation model to obtain a corresponding new target sentence; and training the first translation model based on a third sub-training sample set to obtain a second translation model.

[0029] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, for providing translation model training services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0030] It should be noted that the translation model training method provided in the embodiments of the present disclosure can be executed by the server 105, or by the terminal devices 101, 102, 103, or by the server 105 and the terminal devices 101, 102, 103 in cooperation with each other. Accordingly, the various parts (such as various units, sub-units, modules, sub-modules) included in the translation model training apparatus can be all set in the server 105, or all set in the terminal devices 101, 102, 103, or respectively set in the server 105 and the terminal devices 101, 102, 103.

[0031] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0032] Figure 2 A flowchart 200 of an embodiment of a translation model training method that can be applied to the present application is shown. In this embodiment, the translation model training method includes the following steps:

[0033] Step 201: Obtain a training sample set.

[0034] In this embodiment, the execution subject (such as Figure 1 The server 105 or terminal devices 101, 102, 103) shown in the figure can obtain the training sample set from a local or remote server storing the training samples.

[0035] The training samples include source sentences and target sentences, and the target sentences are translation sentences of the source sentences.

[0036] Here, the language categories of the source sentence and the target sentence are different. For example, the source sentence is a Chinese sentence and the target sentence is an English sentence; the source sentence is an English sentence and the target sentence is a Chinese sentence, etc. This application does not limit this.

[0037] Specifically, the training sample set can be expressed in the following form:

[0038]

[0039] Where N is the total number of samples, x and y represent the source sentence and target sentence respectively.

[0040] Step 202 , calculate the information conversion difficulty index of each training sample in the training sample set, and filter out the first sub-training sample set in the training sample set to obtain the second sub-training sample set.

[0041] In this embodiment, the execution entity can calculate the information conversion difficulty index of each training sample in the training sample set based on at least one of the following parameters of the source sentence and / or target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, and sort each training sample according to the size of the information conversion difficulty index of each training sample.

[0042] Among them, the information conversion difficulty index is used to indicate the difficulty of converting the source sentence into the target sentence.

[0043] Here, the translated text usually has three important characteristics: simplification, explicitation and interference. Lexical diversity is usually used to represent the degree of explicitation, lexical density is used to represent the degree of simplification, and sentence length is used to represent the degree of interference.

[0044] Among them, the vocabulary diversity can be determined based on the number of content words in a sentence, the vocabulary density can be determined based on the density of content words in a sentence, and the sentence length can be determined based on the sentence length of the sentence.

[0045] Here, the content word density can be determined based on the sum of the densities of each content word in the sentence, or can be determined based on the average of the densities of each content word, and this application does not limit this.

[0046] The density of each content word may be determined based on the ratio of the number of occurrences of the content word in the current sentence to the number of occurrences of the content word in the sample set.

[0047] Here, the information conversion difficulty index can be determined based on the lexical diversity of the target sentence, or based on the ratio of the lexical diversity of the target sentence to the lexical diversity of the source sentence; can be determined based on the lexical density of the target sentence, or based on the ratio of the lexical density of the target sentence to the lexical density of the source sentence; can be determined based on the sentence length of the target sentence, or based on the ratio of the sentence length of the target sentence to the sentence length of the source sentence, and this application does not limit this. In this way, the greater the value of the information conversion difficulty index, the greater the difficulty of information conversion.

[0048] In addition, it should be pointed out that the information conversion difficulty index can be determined based on the ratio of the lexical diversity of the source sentence to the lexical diversity of the target sentence, can be determined based on the ratio of the lexical density of the source sentence to the lexical density of the target sentence, can be determined based on the ratio of the sentence length of the source sentence to the sentence length of the target sentence, and this application does not limit this. In this way, the smaller the value of the information conversion difficulty index, the greater the difficulty of information conversion.

[0049] Furthermore, the execution entity may filter out the first sub-training sample set in the training sample set to obtain the second sub-training sample set.

[0050] The first sub-training sample set is composed of a preset number of training samples with the greatest conversion difficulty in the training sample set.

[0051] Here, the preset number can be set according to actual needs, for example, 10, 100, etc., and this application does not limit this.

[0052] Specifically, the training sample set includes 100 training samples. The execution entity calculates the information conversion difficulty index of each training sample in the 100 training samples. The information conversion difficulty index is determined based on the ratio of the lexical diversity information of the target sentence to the lexical diversity of the source sentence, and a preset number of, for example, 10, training samples in the training sample set with the greatest information conversion difficulty, that is, the value of the information conversion difficulty index is the largest, are screened out to obtain a second sub-training sample set, which includes 90 training samples.

[0053] Step 203: for each source sentence in the first sub-training sample set, the source sentence is input into the first translation model to obtain a corresponding new target sentence.

[0054] In this embodiment, for each source sentence in the first sub-training sample set, the execution subject may input the source sentence into the first translation model to obtain a corresponding new target sentence.

[0055] The first translation model can be obtained by training the initial translation model based on the second sub-training sample set.

[0056] Here, the initial translation model may be a neural network model in existing technology or future development technology, such as a convolutional neural network, a back propagation neural network, a feedback neural network, etc.

[0057] Specifically, the initial translation model may be a model based on the Transformer architecture.

[0058] Step 204: Train the first translation model based on the third sub-training sample set to obtain a second translation model.

[0059] In this embodiment, the execution subject can obtain a third sub-training sample set based on the source sentence in the first sub-training sample set and the corresponding new target sentence, and train the first translation model based on the third sub-training sample set to obtain a second translation model. The second translation model can be used to translate sentences.

[0060] Specifically, the training sample set is According to the information conversion difficulty index, namely DIT, the rearranged data set is is the part with the greatest difficulty in information conversion, that is, the first sub-training sample set. is the remaining part, i.e., the second sub-training sample set, and M1 is used The trained first translation model will The source data is generated through the M1 model to obtain simplified data That is, the third sub-training sample set, and M1 is trained according to the third sub-training sample set to obtain the second translation model, and new training data can be synthesized at the same time

[0061]

[0062]

[0063]

[0064]

[0065]

[0066]

[0067] In some optional embodiments, training the first translation model based on the third sub-training sample set to obtain the second translation model includes: training the first translation model based on the third sub-training sample set and the second sub-training sample set to obtain the second translation model.

[0068] In this implementation, the execution entity can obtain a third sub-training sample set based on the source sentences in the first sub-training sample set and the corresponding new target sentences, and train the first translation model based on the third sub-training sample set and the second sub-training sample set to obtain a second translation model.

[0069] This implementation method obtains a second translation model by training the first translation model based on the third sub-training sample set and the second sub-training sample set, that is, the first translation model is trained based on a training sample set reconstructed from the third sub-training sample and the second sub-training sample set to obtain the second translation model, that is, the first translation model is trained based on the simplified entire training sample set to obtain the second translation model, so that the translation model can enhance its memory of the second sub-training sample set, which helps to further improve the accuracy of the translation model obtained by training.

[0070] Continue to see Figure 3 , Figure 3 It is a schematic diagram of an application scenario of the method for training a translation model according to this embodiment.

[0071] exist Figure 3 In the application scenario, the execution subject 301 can obtain the training sample set 302 in a wired or wireless manner, and the training sample includes a source sentence and a target sentence, and the target sentence is a translation sentence of the source sentence; the execution subject can calculate the information conversion difficulty index 303 of each training sample in the training sample set based on at least one of the following parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, sentence length, such as the vocabulary diversity of the target sentence, and filter out the first sub-training sample set 304 in the training sample set to obtain the second sub-training sample set 305, wherein the information conversion difficulty index 303 is used to indicate the conversion difficulty of the source sentence into the target sentence. The difficulty of converting to the target sentence is that the first sub-training sample set 304 is composed of a preset number of training samples with the greatest conversion difficulty in the training sample set; for each source sentence in the first sub-training sample set 304, the source sentence is input into the first translation model 306 to obtain the corresponding new target sentence, and the first translation model 306 is trained based on the second sub-training sample set 305; the first translation model 306 is trained based on the third sub-training sample set 307 to obtain the second translation model 308, and the third sub-training sample set 307 is composed of the source sentences in the first sub-training sample set 304 and the corresponding new target sentences.

[0072] The method for training a translation model disclosed in the present invention comprises the following steps: obtaining a training sample set; calculating an information conversion difficulty index of each training sample in the training sample set, and filtering out a first sub-training sample set in the training sample set to obtain a second sub-training sample set; for each source sentence in the first sub-training sample set, inputting the source sentence into a first translation model to obtain a corresponding new target sentence; and training the first translation model based on a third sub-training sample set to obtain a second translation model, thereby effectively improving the accuracy of the translation model obtained through training.

[0073] Further references Figure 4 , which shows Figure 2 A process 400 of another embodiment of a translation model training method is shown. In this embodiment, the process 400 may include the following steps:

[0074] Step 401: Obtain a training sample set.

[0075] In this embodiment, the implementation details and technical effects of step 401 can refer to the description of step 201 and will not be repeated here.

[0076] Step 402, based on at least two of the following parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, sentence length, calculate the information conversion difficulty index of each training sample in the training sample set, and filter out the first sub-training sample set in the training sample set to obtain the second sub-training sample set.

[0077] In this embodiment, the execution entity can calculate the information conversion difficulty index of each training sample in the training sample set based on at least two of the following parameters of the source sentence and / or target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, and sort each training sample according to the size of the information conversion difficulty index of each training sample.

[0078] Here, the information conversion difficulty index can be determined based on the lexical diversity and lexical density of the source sentences and / or target sentences of the training samples, can be determined based on the lexical diversity and sentence length of the source sentences and / or target sentences of the training samples, or can be determined based on the lexical density and sentence length of the source sentences and / or target sentences of the training samples. This application does not limit this.

[0079] Specifically, the information conversion difficulty index can be determined based on the lexical diversity of the target sentence and the lexical density of the target sentence.

[0080] Furthermore, the execution entity may filter out a first sub-training sample set consisting of a preset number of training samples with the greatest information conversion difficulty in the training sample set to obtain a second sub-training sample set.

[0081] Among them, the preset number can be set according to actual needs, for example, 10, 100, etc., and this application does not limit this.

[0082] In some optional methods, based on at least two of the following parameters of the source sentence and / or the target sentence of each training sample: lexical diversity, lexical density, and sentence length, an information conversion difficulty index of each training sample in the training sample set is calculated, including: based on the following three parameters of the source sentence and / or the target sentence of each training sample: lexical diversity, lexical density, and sentence length, an information conversion difficulty index of each training sample in the training sample set is calculated.

[0083] In this implementation, the execution entity can calculate the information conversion difficulty index of each training sample in the training sample set based on the following three parameters of the source sentence and / or target sentence of each training sample: lexical diversity, lexical density, and sentence length, that is, determine the information conversion difficulty index based on the lexical diversity, lexical density and sentence length of the source sentence and / or target sentence of the training sample, and sort each training sample according to the size of the information conversion difficulty index of each training sample.

[0084] Specifically, the information conversion difficulty index of each training sample can be determined based on the first index, the second index and the third index of the training sample, wherein the first index is used to indicate the ratio of the lexical diversity of the source sentence to the lexical diversity of the target sentence, the second index is used to indicate the ratio of the lexical density of the source sentence to the lexical density of the target sentence, and the third index is used to indicate the ratio of the sentence length of the source sentence to the sentence length of the target sentence.

[0085] Here, the information conversion difficulty index DIT can be expressed by the following formula:

[0086]

[0087] Among them, LV(x) represents the lexical diversity of the source sentence, LD(x) represents the lexical density of the source sentence, and L(x) represents the sentence length of the source sentence; LV(y) represents the lexical diversity of the target sentence, LD(y) represents the lexical density of the target sentence, and L(y) represents the sentence length of the target sentence.

[0088] Furthermore, the execution entity may filter out a first sub-training sample set consisting of a preset number of training samples with the greatest information conversion difficulty in the training sample set to obtain a second sub-training sample set.

[0089] This implementation method improves the accuracy of the obtained information conversion difficulty index by calculating the information conversion difficulty index of each training sample in the training sample set based on the following three parameters of the source sentence and / or target sentence of each training sample: lexical diversity, lexical density, and sentence length, and determines a third sub-training sample set based on the information conversion difficulty index of each training sample, trains the first translation model based on the third sub-training sample set, and obtains a second translation model, thereby further improving the accuracy of the translation model obtained by training.

[0090] In some optional methods, based on the following three parameters of the source sentence and / or target sentence of each training sample: lexical diversity, lexical density, and sentence length, the information conversion difficulty index of each training sample in the training sample set is calculated, including: based on the lexical diversity of the target sentence of each training sample, the lexical density of the target sentence, and the ratio of the sentence length of the target sentence to the sentence length of the source sentence, the information conversion difficulty index of each training sample in the training sample set is calculated.

[0091] In this implementation, the execution entity can calculate the information conversion difficulty index of each training sample in the training sample set based on the vocabulary diversity of the target sentence of each training sample, the vocabulary density of the target sentence, and the ratio of the sentence length of the target sentence to the sentence length of the source sentence.

[0092] This implementation method calculates the information conversion difficulty index of each training sample in the training sample set based on the vocabulary diversity of the target sentence, the vocabulary density of the target sentence, and the ratio of the sentence length of the target sentence to the sentence length of the source sentence of each training sample, and determines the third sub-training sample set based on the information conversion difficulty index of each training sample, trains the first translation model based on the third sub-training sample set, and obtains the second translation model, thereby further improving the accuracy of the trained translation model and at the same time improving the efficiency of the trained translation model.

[0093] Step 403: For each source sentence in the first sub-training sample set, the source sentence is input into the first translation model to obtain a corresponding new target sentence.

[0094] In this embodiment, the implementation details and technical effects of step 403 may refer to the description of step 203 and will not be repeated here.

[0095] Step 404: Train the first translation model based on the third sub-training sample set to obtain a second translation model.

[0096] In this embodiment, the implementation details and technical effects of step 404 can refer to the description of step 204 and will not be repeated here.

[0097] from Figure 4It can be seen that this embodiment mainly highlights at least two of the following parameters of the source sentence and / or the target sentence based on each training sample: vocabulary diversity, vocabulary density, sentence length, calculates the information conversion difficulty index of each training sample in the training sample set, improves the accuracy of the obtained information conversion difficulty index, and determines the third sub-training sample set based on the information conversion difficulty index of each training sample, trains the first translation model based on the third sub-training sample set, and obtains the second translation model, which further improves the accuracy of the translation model obtained by training.

[0098] Continue to refer Figure 5 , shows a process 500 of an embodiment of a translation method according to the present application. The translation method comprises the following steps:

[0099] Step 501: Obtain a sentence to be translated.

[0100] In this embodiment, the execution subject can obtain the sentence to be translated through a wired or wireless connection.

[0101] The wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0102] Step 502: Input the sentence to be translated into the translation model to obtain the target sentence.

[0103] In this embodiment, the execution subject may input the sentence to be translated into the translation model to obtain the corresponding target sentence.

[0104] Here, the translation model is Figure 2 The second translation model obtained by the method described in the corresponding embodiment will not be described in detail here.

[0105] The translation method provided by the embodiment of the present disclosure obtains a sentence to be translated; inputs the sentence to be translated into a translation model to obtain a target sentence, wherein the translation model is as follows: Figure 2 The second translation model obtained by the method described in the embodiment helps to improve the accuracy of translating the sentence to be translated.

[0106] Further references Figure 6 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a translation model training device, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0107] like Figure 6As shown, the model training device 600 of this embodiment includes: a sample acquisition module 601, an indicator calculation module 602, an input model module 603 and a model generation module 604.

[0108] The sample acquisition module 601 may be configured to acquire a training sample set.

[0109] The calculation index module 602 may be configured to calculate the information conversion difficulty index of each training sample in the training sample set, and filter out the first sub-training sample set in the training sample set to obtain the second sub-training sample set.

[0110] The input model module 603 may be configured to input each source sentence in the first sub-training sample set into the first translation model to obtain a corresponding new target sentence.

[0111] The model generation module 604 may be configured to train the first translation model based on the third sub-training sample set to obtain a second translation model.

[0112] In some optional embodiments of this embodiment, the calculation index module is further configured to calculate the information conversion difficulty index of each training sample in the training sample set based on at least two of the following parameters of the source sentence and / or target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length.

[0113] In some optional embodiments of this embodiment, the calculation index module is further configured to calculate the information conversion difficulty index of each training sample in the training sample set based on the following three parameters of the source sentence and / or target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length.

[0114] In some optional embodiments of this embodiment, the index calculation module is further configured to calculate the information conversion difficulty index of each training sample in the training sample set based on the vocabulary diversity of the target sentence of each training sample, the vocabulary density of the target sentence, and the ratio of the sentence length of the target sentence to the sentence length of the source sentence.

[0115] In some optional aspects of this embodiment, the model generation module is further configured to train the first translation model based on the third training sample and the second training sample to obtain the second translation model.

[0116] Further references Figure 7 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a translation device, which is similar to Figure 5 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0117] like Figure 7As shown, the translation device 700 of this embodiment includes: a sentence acquisition module 701 and a sentence output module 702.

[0118] The sentence acquisition module 701 may be configured to acquire a sentence to be translated.

[0119] The output sentence module 702 may be configured to input the sentence to be translated into the translation model to obtain the target sentence.

[0120] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0121] like Figure 8 , which is a block diagram of an electronic device according to the method for training a translation model in an embodiment of the present application.

[0122] 800 is a block diagram of an electronic device according to the method of translation model training of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present application described and / or required herein.

[0123] like Figure 8 As shown, the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 801 is taken as an example.

[0124] The memory 802 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the method for training a translation model provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for training a translation model provided in the present application.

[0125] The memory 802 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the model training method in the embodiment of the present application (for example, the attached Figure 6 The processor 801 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 802, that is, the method for training the translation model in the above method embodiment is implemented.

[0126] The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of the electronic device for translation model training, etc. In addition, the memory 802 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 802 may optionally include a memory remotely arranged relative to the processor 801, and these remote memories may be connected to the electronic device for translation model training 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.

[0127] The electronic device of the translation model training method may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803 and the output device 804 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0128] The input device 803 can receive input digital or character information, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a track ball, a joystick, and other input devices. The output device 804 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0129] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0130] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0132] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0133] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0134] According to the technical solution of the embodiment of the present application, the accuracy of the trained translation model is effectively improved.

[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0136] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A translation model training method, the method comprising: Acquire a training sample set, wherein the training sample includes a source sentence and a target sentence, wherein the target sentence is a translation sentence of the source sentence; Calculating an information conversion difficulty index for each training sample in the training sample set, and filtering out a first sub-training sample set in the training sample set to obtain a second sub-training sample set, wherein the information conversion difficulty index is used to indicate the difficulty of converting a source sentence into a target sentence, and the first sub-training sample set is composed of a preset number of training samples with the greatest conversion difficulty in the training sample set; For each source sentence in the first sub-training sample set, input the source sentence into a first translation model to obtain a corresponding new target sentence, wherein the first translation model is trained based on the second sub-training sample set; The first translation model is trained based on a third sub-training sample set to obtain a second translation model, wherein the third sub-training sample set is composed of source sentences in the first sub-training sample set and corresponding new target sentences.

2. The method according to claim 1, wherein: The calculating the information conversion difficulty index of each training sample in the training sample set includes: Based on at least two of the following parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, an information conversion difficulty index of each training sample in the training sample set is calculated.

3. The method according to claim 2, wherein: Based on at least two of the following parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, calculating the information conversion difficulty index of each training sample in the training sample set, including: Based on the following three parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, the information conversion difficulty index of each training sample in the training sample set is calculated.

4. The method according to claim 3, wherein: The information conversion difficulty index of each training sample in the training sample set is calculated based on the following three parameters of the source sentence and / or the target sentence of each training sample: vocabulary diversity, vocabulary density, and sentence length, including: Based on the lexical diversity of the target sentence of each training sample, the lexical density of the target sentence, and the ratio of the sentence length of the target sentence to the sentence length of the source sentence, the information conversion difficulty index of each training sample in the training sample set is calculated.

5. The method according to claim 1, wherein: The step of training the first translation model based on the third sub-training sample set to obtain a second translation model includes: The first translation model is trained based on the third sub-training sample set and the second sub-training sample set to obtain a second translation model.

6. A translation method comprising: Get the sentence to be translated; The sentence to be translated is input into the translation model to obtain a target sentence, wherein the translation model is the second translation model obtained by the method according to any one of claims 1 to 5 above.

7. A translation model training device, comprising: A sample acquisition module is configured to acquire a training sample set, wherein the training sample includes a source sentence and a target sentence, wherein the target sentence is a translation sentence of the source sentence; a calculation index module configured to calculate an information conversion difficulty index of each training sample in the training sample set, and to filter out a first sub-training sample set in the training sample set to obtain a second sub-training sample set, wherein the information conversion difficulty index is used to indicate the difficulty of converting a source sentence into a target sentence, and the first sub-training sample set is composed of a preset number of training samples with the greatest conversion difficulty in the training sample set; An input model module is configured to input each source sentence in the first sub-training sample set into a first translation model to obtain a corresponding new target sentence, wherein the first translation model is trained based on the second sub-training sample set; The model generation module is configured to train the first translation model based on a third sub-training sample set to obtain a second translation model, wherein the third sub-training sample set is composed of source sentences in the first sub-training sample set and corresponding new target sentences.

8. A translation device, comprising: A sentence acquisition module is configured to acquire sentences to be translated; The output sentence module is configured to input the sentence to be translated into the translation model to obtain a target sentence, wherein the translation model is the second translation model obtained in the method of any one of claims 1 to 5.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 6.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Model training method and device, computer readable storage medium and computer equipment

    CN110263350A

  • Text translation method and device, computer equipment and storage medium

    CN113761888A