A Chinese-English automatic translation model training method and system

Through the training method of automatically generating negative samples in the Chinese and English automatic translation model, the problem of high training costs in the existing technology is solved, and more efficient and accurate training of Chinese and English automatic translation model is achieved.

CN118278428BActive Publication Date: 2025-03-07GUANGDONG VOCATIONAL COLLEGE OF SCI & TRADE
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410408006.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-07
Publication Date
2025-03-07
Estimated Expiration
2044-04-07

AI Technical Summary

Technical Problem

The prior art requires manual acquisition of large numbers of positive and negative samples when training language models, resulting in high training costs.

Method used

Provide a Chinese-English automatic translation model training method, which reduces the trouble of sample acquisition and classification by independently generating negative samples. The specific method includes training the original translation model as the first training sample set, then training the negative sample library and part of the positive samples as the second training sample set, training the first-order translation model, and automatically generating negative samples through reproduction tests and matching degree calculations.

Benefits of technology

By automatically generating negative samples, the training cost is reduced and the training efficiency and accuracy of the Chinese-English automatic translation model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118278428B_ABST
    Figure CN118278428B_ABST
Patent Text Reader

Abstract

The present application relates to a Chinese-English automatic translation model training method, device, computer equipment, storage medium and computer program product. The method comprises: using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model; using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model; randomly selecting a number of samples from the second training sample set to perform a recurrence test on the second-order training model, and calculating the translation probability; judging whether the translation probability is greater than a preset probability threshold; if so, terminating the training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of machine translation, and in particular to a Chinese-English automatic translation model training method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of globalization, international communication and information transmission have shown explosive growth. Traditional methods that rely on manual translation can no longer meet people's daily needs for cross-language communication. As a technology that can automatically provide accurate translation results, machine translation has gradually received widespread attention and research. From traditional rule-based translation methods to statistical machine translation methods, and then to the current mainstream neural machine translation methods, the performance of machine translation has made great progress.

[0003] Publication No. US20090164206A1 discloses a method for training a target language word inflection model based on a bilingual corpus, the method comprising establishing an initial TLWI model, preprocessing a source language corpus and a target language corpus, extracting patterns containing TLWI information, and training the TLWI model using the patterns based on the preprocessed source language corpus and the target language corpus.

[0004] However, when training a language model using this method, a large number of positive and negative samples need to be manually obtained in order to complete a machine translation model whose performance indicators meet the requirements, resulting in high training costs. Summary of the invention

[0005] Based on this, it is necessary to provide a Chinese-English automatic translation model training method, device, computer equipment, computer-readable storage medium and computer program product that can autonomously generate negative samples during the training process to address the above technical problems.

[0006] In a first aspect, the present application provides a Chinese-English automatic translation model training method, the method comprising:

[0007] Using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model;

[0008] Using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model;

[0009] Randomly select a number of samples from the second training sample set to perform a reproduction test on the second-order training model, and calculate the translation probability;

[0010] Determine whether the translation probability is greater than a preset probability threshold;

[0011] If yes, the training ends.

[0012] In one embodiment, using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model includes:

[0013] The Chinese-English comparison sample sentences included in the first training sample set are successively used as target sentences, input into the original translation model, and obtain the English / Chinese translations corresponding to the Chinese / English original sentences respectively;

[0014] Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree;

[0015] If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed;

[0016] If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation not being performed by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in a negative sample library;

[0017] Continue to calculate the second matching degree between the Chinese translation and the Chinese original text corresponding to the English original text;

[0018] If the second matching result is greater than or equal to the second preset threshold, the English-Chinese translation is considered passed;

[0019] If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation fails, and the English original text and the Chinese translation are combined to form a new negative sample, which is then stored in the negative sample library.

[0020] In one embodiment, the method for calculating the first matching degree includes:

[0021] The English translation is split into words to obtain a number of translation words contained in the English translation, and the word repetition rate W between the translation words and the English original words is calculated;

[0022] Mark the words in the English original text with serial numbers, and assign the same serial numbers to the same words in the English translation. Traverse the serial number sequence composed of the serial number marks of the words in the English translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of words contained in the English original text as the keyword matching degree K;

[0023] The words in the English translation are marked with secondary serial numbers again without overwriting the original serial number sequence, and the repetition rate of the meta-serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree P;

[0024] The word repetition rate W, the keyword matching degree K, and the word order matching degree P are weightedly calculated according to preset parameters to calculate a first matching degree F1 (W, K, P).

[0025] In one embodiment, the method for calculating the second matching degree includes:

[0026] Splitting the Chinese translation into individual Chinese characters to obtain a number of translated Chinese characters contained in the Chinese translation, and calculating a Chinese character repetition rate V between the translated Chinese characters and the Chinese original characters;

[0027] Mark the Chinese characters in the Chinese original text with serial numbers, and assign the same serial numbers to the same Chinese characters in the Chinese translation, traverse the serial number sequence composed of the serial number marks of the Chinese characters in the Chinese translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of Chinese characters contained in the Chinese original text as the keyword matching degree J;

[0028] The Chinese characters in the Chinese translation are marked with secondary serial numbers again without covering the previous serial number sequence, and the repetition rate of the previous serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree Q;

[0029] The Chinese character repetition rate V, the keyword matching degree J and the word order matching degree Q are weightedly calculated according to preset parameters to calculate the second matching degree F2 (V, J, Q).

[0030] In one embodiment, the Chinese-English automatic translation model training method further includes:

[0031] If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive and negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0032] In a second aspect, the present application also provides a Chinese-English automatic translation model training system, the device comprising:

[0033] A storage module, used for storing positive samples, negative samples, a first training sample set and a second training sample set;

[0034] The translation model module is used to store and run the original translation model, the first-order translation model, and the second-order training model;

[0035] The testing module is used to extract samples for recurrence testing and calculate the translation probability.

[0036] In one embodiment, the Chinese-English automatic translation model training system further includes:

[0037] A sentence splitting module, used to split Chinese samples or Chinese translations into individual Chinese characters, and to split English samples or English translations into words;

[0038] The matching degree calculation module is used to calculate the first matching degree or the second matching degree.

[0039] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0040] Using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model;

[0041] Using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model;

[0042] Randomly select a number of samples from the second training sample set to perform a reproduction test on the second-order training model, and calculate the translation probability;

[0043] Determine whether the translation probability is greater than a preset probability threshold;

[0044] If yes, then the training ends;

[0045] If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive and negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0046] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0047] Using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model;

[0048] Using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model;

[0049] Randomly select a number of samples from the second training sample set to perform a reproduction test on the second-order training model, and calculate the translation probability;

[0050] Determine whether the translation probability is greater than a preset probability threshold;

[0051] If yes, then the training ends;

[0052] If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive and negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0053] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0054] Using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model;

[0055] Using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model;

[0056] Randomly select a number of samples from the second training sample set to perform a reproduction test on the second-order training model, and calculate the translation probability;

[0057] Determine whether the translation probability is greater than a preset probability threshold;

[0058] If yes, then the training ends;

[0059] If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive and negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0060] The above-mentioned Chinese-English automatic translation model training method, device, computer equipment, storage medium and computer program product can automatically generate negative samples in the process of training the model, thereby reducing the trouble of sample acquisition and classification, and thus training a Chinese-English translation model training method that is more accurate in Chinese-English translation. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A diagram showing an application environment of a Chinese-English automatic translation model training method in one embodiment;

[0062] Figure 2 A flowchart of a Chinese-English automatic translation model training method in one embodiment;

[0063] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] 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.

[0065] The Chinese-English automatic translation model training method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0066] In one embodiment, Figure 2 As shown in FIG, a method for training a Chinese-English automatic translation model is provided, and the method is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0067] Step S100: Using the positive sample library storing positive samples as the first training sample set, the original translation model is trained to obtain a first-order translation model. The specific steps of step S100 include:

[0068] Step S110: taking the Chinese-English comparison sample sentences included in the first training sample set as target sentences, inputting them into the original translation model, and obtaining the English / Chinese translations corresponding to the Chinese / English original sentences respectively.

[0069] Step S120: Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree.

[0070] The calculation method of the first matching degree is as follows:

[0071] The English translation is split into words to obtain a number of translation words contained in the English translation, and the word repetition rate W between the translation words and the English original words is calculated;

[0072] Mark the words in the English original text with serial numbers, and assign the same serial numbers to the same words in the English translation. Traverse the serial number sequence composed of the serial number marks of the words in the English translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of words contained in the English original text as the keyword matching degree K;

[0073] The words in the English translation are marked with secondary serial numbers again without overwriting the original serial number sequence, and the repetition rate of the meta-serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree P;

[0074] The word repetition rate W, the keyword matching degree K, and the word order matching degree P are weightedly calculated according to preset parameters to calculate the first matching degree F1 (W, K, P). In particular, the embodiment of the present application provides a reference calculation formula for the first matching degree F1 (W, K, P), which is as follows:

[0075] Step S131: If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed.

[0076] Step S132: If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation not being possible by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in a negative sample library.

[0077] Step S140: Continue to calculate the second matching degree between the Chinese translation corresponding to the English original text and the Chinese original text.

[0078] The specific steps of the second matching degree include:

[0079] Splitting the Chinese translation into individual Chinese characters to obtain a number of translated Chinese characters contained in the Chinese translation, and calculating a Chinese character repetition rate V between the translated Chinese characters and the Chinese original characters;

[0080] Mark the Chinese characters in the Chinese original text with serial numbers, and assign the same serial numbers to the same Chinese characters in the Chinese translation, traverse the serial number sequence composed of the serial number marks of the Chinese characters in the Chinese translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of Chinese characters contained in the Chinese original text as the keyword matching degree J;

[0081] The Chinese characters in the Chinese translation are marked with secondary serial numbers again without covering the previous serial number sequence, and the repetition rate of the previous serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree Q;

[0082] According to the preset parameters, the Chinese character repetition rate V, the keyword matching degree J, and the word order matching degree Q are weighted to calculate the second matching degree F2 (V, J, Q). In particular, the embodiment of the present application provides a reference calculation formula for the first matching degree F2 (V, J, Q), which is as follows:

[0083] Step S151: If the second matching result is greater than or equal to the second preset threshold, it is recorded as passing the English-Chinese translation.

[0084] Step S152: If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation failed, and the English original text and the Chinese translation are combined to form a new negative sample, and the negative sample is stored in the negative sample library.

[0085] Step S200: using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, and training a first-order translation model to obtain a second-order training model.

[0086] Step S300: randomly selecting a number of samples from the second training sample set to perform a reproduction test on the second-order training model and calculate the translation probability.

[0087] Step S400: If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive-negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0088] Step S500: determine whether the translation probability is greater than a preset probability threshold, and then end the training.

[0089] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0090] Based on the same inventive concept, the embodiment of the present application also provides a Chinese-English automatic translation model training system for implementing the Chinese-English automatic translation model training method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more Chinese-English automatic translation model training system embodiments provided below can refer to the limitations of the Chinese-English automatic translation model training method above, and will not be repeated here.

[0091] In one embodiment, a Chinese-English automatic translation model training system is provided, comprising:

[0092] A storage module, used for storing positive samples, negative samples, a first training sample set and a second training sample set;

[0093] The translation model module is used to store and run the original translation model, the first-order translation model, and the second-order training model;

[0094] The testing module is used to extract samples for recurrence testing and calculate the translation probability;

[0095] A sentence splitting module, used to split Chinese samples or Chinese translations into individual Chinese characters, and to split English samples or English translations into words;

[0096] And, a matching degree calculation module is used to calculate the first matching degree or the second matching degree.

[0097] Each module in the above-mentioned Chinese-English automatic translation model training system can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0098] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a Chinese-English automatic translation model training method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse.

[0099] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0100] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0101] Step S100: Using the positive sample library storing positive samples as the first training sample set, the original translation model is trained to obtain a first-order translation model. The specific steps of step S100 include:

[0102] Step S110: taking the Chinese-English comparison sample sentences included in the first training sample set as target sentences, inputting them into the original translation model, and obtaining the English / Chinese translations corresponding to the Chinese / English original sentences respectively.

[0103] Step S120: Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree.

[0104] Step S131: If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed.

[0105] Step S132: If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation not being possible by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in a negative sample library.

[0106] Step S140: Continue to calculate the second matching degree between the Chinese translation corresponding to the English original text and the Chinese original text.

[0107] Step S151: If the second matching result is greater than or equal to the second preset threshold, it is recorded as passing the English-Chinese translation.

[0108] Step S152: If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation failed, and the English original text and the Chinese translation are combined to form a new negative sample, and the negative sample is stored in the negative sample library.

[0109] Step S200: using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, and training a first-order translation model to obtain a second-order training model.

[0110] Step S300: randomly selecting a number of samples from the second training sample set to perform a reproduction test on the second-order training model and calculate the translation probability.

[0111] Step S400: If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive-negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0112] Step S500: determine whether the translation probability is greater than a preset probability threshold, and then end the training.

[0113] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0114] Step S100: Using the positive sample library storing positive samples as the first training sample set, the original translation model is trained to obtain a first-order translation model. The specific steps of step S100 include:

[0115] Step S110: taking the Chinese-English comparison sample sentences included in the first training sample set as target sentences, inputting them into the original translation model, and obtaining the English / Chinese translations corresponding to the Chinese / English original sentences respectively.

[0116] Step S120: Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree.

[0117] Step S131: If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed.

[0118] Step S132: If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation not being possible by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in a negative sample library.

[0119] Step S140: Continue to calculate the second matching degree between the Chinese translation corresponding to the English original text and the Chinese original text.

[0120] Step S151: If the second matching result is greater than or equal to the second preset threshold, it is recorded as passing the English-Chinese translation.

[0121] Step S152: If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation failed, and the English original text and the Chinese translation are combined to form a new negative sample, and the negative sample is stored in the negative sample library.

[0122] Step S200: using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, and training a first-order translation model to obtain a second-order training model.

[0123] Step S300: randomly selecting a number of samples from the second training sample set to perform a reproduction test on the second-order training model and calculate the translation probability.

[0124] Step S400: If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive-negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0125] Step S500: determine whether the translation probability is greater than a preset probability threshold, and then end the training.

[0126] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0127] Step S100: Using the positive sample library storing positive samples as the first training sample set, the original translation model is trained to obtain a first-order translation model. The specific steps of step S100 include:

[0128] Step S110: taking the Chinese-English comparison sample sentences included in the first training sample set as target sentences, inputting them into the original translation model, and obtaining the English / Chinese translations corresponding to the Chinese / English original sentences respectively.

[0129] Step S120: Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree.

[0130] Step S131: If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed.

[0131] Step S132: If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation not being possible by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in a negative sample library.

[0132] Step S140: Continue to calculate the second matching degree between the Chinese translation corresponding to the English original text and the Chinese original text.

[0133] Step S151: If the second matching result is greater than or equal to the second preset threshold, it is recorded as passing the English-Chinese translation.

[0134] Step S152: If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation failed, and the English original text and the Chinese translation are combined to form a new negative sample, and the negative sample is stored in the negative sample library.

[0135] Step S200: using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, and training a first-order translation model to obtain a second-order training model.

[0136] Step S300: randomly selecting a number of samples from the second training sample set to perform a reproduction test on the second-order training model and calculate the translation probability.

[0137] Step S400: If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive-negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

[0138] Step S500: determine whether the translation probability is greater than a preset probability threshold, and then end the training.

[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0140] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0141] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A Chinese-English automatic translation model training method, characterized in that: The method comprises: Using a positive sample library storing positive samples as a first training sample set, training the original translation model to obtain a first-order translation model; Using a negative sample library storing negative samples and a random portion of positive samples in the first training sample set as a second training sample set, training the first-order translation model to obtain a second-order training model; Randomly select a number of samples from the second training sample set to perform a reproduction test on the second-order training model, and calculate the translation probability; Determine whether the translation probability is greater than a preset probability threshold; If yes, then the training ends; The step of using the positive sample library storing positive samples as the first training sample set and training the original translation model to obtain a first-order translation model includes: The Chinese-English comparison sample sentences included in the first training sample set are successively used as target sentences, input into the original translation model, and obtain the English / Chinese translations corresponding to the Chinese / English original sentences respectively; Matching the English translation corresponding to the Chinese original text with the English original text to calculate a first matching degree; If the first matching result is greater than or equal to the first preset threshold, it is recorded as the Chinese-English translation passed; If the first matching result is less than the first preset threshold, it is recorded as Chinese-English translation failure by combining the Chinese original text with the English translation to form a negative sample, and the negative sample is stored in the negative sample library; Continue to calculate the second matching degree between the Chinese translation and the Chinese original text corresponding to the English original text; If the second matching result is greater than or equal to the second preset threshold, the English-Chinese translation is considered passed; If the second matching result is less than the second preset threshold, it is recorded as the English-Chinese translation failed, and the English original text and the Chinese translation are combined to form a new negative sample, and the negative sample is stored in the negative sample library; The calculation method of the first matching degree includes: The English translation is split into words to obtain a number of translation words contained in the English translation, and the word repetition rate W between the translation words and the English original words is calculated; Mark the words in the English original text with serial numbers, and assign the same serial numbers to the same words in the English translation. Traverse the serial number sequence composed of the serial number marks of the words in the English translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of words contained in the English original text as the keyword matching degree K; The words in the English translation are marked with secondary serial numbers again without overwriting the original serial number sequence, and the repetition rate of the meta-serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree P; The word repetition rate W, the keyword matching degree K, and the word order matching degree P are weightedly calculated according to preset parameters to calculate a first matching degree F1 (W, K, P).

2. The Chinese-English automatic translation model training method according to claim 1, characterized in that: The calculation method of the second matching degree includes: Splitting the Chinese translation into individual Chinese characters to obtain a number of translated Chinese characters contained in the Chinese translation, and calculating a Chinese character repetition rate V between the translated Chinese characters and the Chinese original characters; Mark the Chinese characters in the Chinese original text with serial numbers, and assign the same serial numbers to the same Chinese characters in the Chinese translation, traverse the serial number sequence composed of the serial number marks of the Chinese characters in the Chinese translation, obtain the maximum continuous serial number length in the serial number sequence, and calculate the ratio of the maximum continuous serial number length to the number of Chinese characters contained in the Chinese original text as the keyword matching degree J; The Chinese characters in the Chinese translation are marked with secondary serial numbers again without covering the previous serial number sequence, and the repetition rate of the previous serial number sequence and the secondary serial number sequence is compared to calculate the word order matching degree Q; The Chinese character repetition rate V, the keyword matching degree J and the word order matching degree Q are weightedly calculated according to preset parameters to calculate the second matching degree F2 (V, J, Q).

3. The Chinese-English automatic translation model training method according to any one of claims 1 to 2, characterized in that: The method further comprises: If the translation probability is not greater than the preset probability threshold, then according to the preset translation probability-positive and negative sample ratio relationship, a number of positive samples and negative samples are extracted from the positive sample library and the negative sample library to form an n-order training sample, and the second-order training model is trained to obtain an n-order training model.

4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to claim 1 are implemented.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.

6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.

Citation Information

Patent Citations

  • Method and apparatus for training a target language word inflection model based on a bilingual corpus, a TLWI method and apparatus, and a translation method and system for translating a source language text into a target language translation

    US20090164206A1

  • Machine translation model training method and device, electronic equipment and storage medium

    CN111859995A

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

    CN112380879A