Training sample enhancement method, device, computer equipment and storage medium

By acquiring and splicing source language statements and their associated statements, a real training sample pair is formed, which solves the problem of introducing pseudo-data in data enhancement in the prior art, and improves the accuracy and efficiency of machine translation.

CN113392657BActive Publication Date: 2025-01-17BEIJING IQIYI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110678838.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-18
Publication Date
2025-01-17
Estimated Expiration
2041-06-18

AI Technical Summary

Technical Problem

In existing machine translation technologies, data augmentation methods such as word replacement and backtranslation introduce a large amount of pseudo-data, which increases the number of training samples but also increases noise, resulting in increased machine learning difficulty, large workload and inflexibility.

Method used

By obtaining the source language statement and its associated statements, splicing it to form a new source language statement, and determining the target language statement based on the new statements to form a real training sample pair to avoid the generation of pseudo-data.

Benefits of technology

It reduces the negative impact of pseudo-data on machine translation models, improves translation quality, reduces workload, and achieves more flexible training sample expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392657B_ABST
    Figure CN113392657B_ABST
Patent Text Reader

Abstract

The present application relates to a training sample enhancement method, device, computer equipment and storage medium. The method comprises: obtaining a first source language sentence and associated sentences of the first source language sentence; splicing at least one sentence in the associated sentences with the first source language sentence to obtain a second source language sentence; determining a second target language sentence according to the second source language sentence; forming a sentence pair with the second source language sentence and using the sentence pair as a training sample. In the present application, the second source language sentence is real data, not pseudo data, which can reduce or avoid the negative impact of the noise generated by the pseudo data on the machine translation model.
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 training sample enhancement method and device, a machine translation model training method and device, a computer device, and a storage medium. Background Art

[0002] At present, machine translation is performed by translating a translation model obtained through sample training, translating the source language into the target language. The training of the translation model requires a large number of training samples, which are sentence pairs of the source language and the target language. The acquisition cost is very high, especially for minority languages, which require specialized translators to annotate. Therefore, technicians are increasingly favoring the use of data augmentation to expand training samples in order to reduce costs.

[0003] At present, the methods of data enhancement include word replacement and back translation. Among them, word replacement, for example, replace "very" in "this action is very cool" with "very". This method requires maintaining a completely correct synonym table, because once there is a problem with the synonym table, the replaced sentence will have a different meaning from the original sentence. Among them, back translation, for example, first translate "he looks good" into English "He looks good", and then translate it into Chinese "he looks good". Obviously, the meaning of the back-translated sentence is different from the original sentence. "Looks good" may not mean "very good looking". It can be seen that although this method increases the number of training samples, it also increases erroneous noise. In fact, the data added by word replacement and back translation are all pseudo data. While increasing the number of training samples, it also introduces a lot of noise, increases the difficulty of machine learning, and requires fine adjustment of the replacement rate and noise rate, so the workload is large and not flexible enough. Summary of the invention

[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the present application provides a training sample enhancement method, apparatus, computer equipment and storage medium.

[0005] In a first aspect, the present application provides a training sample enhancement method, comprising:

[0006] Acquire a first source language sentence and associated sentences of the first source language sentence;

[0007] concatenating at least one of the associated sentences with the first source language sentence to obtain a second source language sentence;

[0008] Determining a second target language sentence according to the second source language sentence;

[0009] The second source language sentence and the second target language sentence form a sentence pair, and the sentence pair is used as a training sample.

[0010] In a second aspect, the present application provides a machine translation model training method, comprising:

[0011] Acquire a training sample, wherein the training sample includes a plurality of sentence pairs, each sentence pair including a source language sentence and a corresponding target language sentence;

[0012] The training sample enhancement method provided in the first aspect expands the training sample;

[0013] Model training is performed based on the training samples and the expanded training samples.

[0014] In a third aspect, the present application provides a training sample enhancement device, comprising:

[0015] A sentence acquisition module, used to acquire a first source language sentence and associated sentences of the first source language sentence;

[0016] A first determining module, configured to concatenate at least one of the associated sentences with the first source language sentence to obtain a second source language sentence;

[0017] A second determining module, configured to determine a second target language sentence according to the second source language sentence;

[0018] The sentence pair forming module is used to form a sentence pair from the second source language sentence and the second target language sentence, and use the sentence pair as a training sample.

[0019] In a fourth aspect, the present application provides a machine translation model training device, comprising:

[0020] A sample acquisition device, used to acquire training samples, wherein the training samples include a plurality of sentence pairs, each sentence pair includes a source language sentence and a corresponding target language sentence;

[0021] The training sample enhancement device provided in the third aspect is used to expand the training samples;

[0022] The model training device is used to perform model training based on the training samples and the expanded training samples.

[0023] In a fifth aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0024] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method when executed by a processor.

[0025] In the present application, at least one of the associated sentences is concatenated with the first source language sentence to obtain a second source language sentence, and then a new data pair is formed based on the second source language sentence. The second source language sentence is real data, not pseudo data, which can reduce or avoid the negative impact of noise generated by pseudo data on the machine translation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

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

[0028] Figure 1 A flowchart of a training sample enhancement method provided in an embodiment of the present application;

[0029] Figure 2 A schematic diagram of the structure of a training sample enhancement device provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0032] In a first aspect, an embodiment of the present application provides a training sample enhancement method, such as Figure 1 As shown, the method comprises the following steps:

[0033] S110, acquiring a first source language sentence and associated sentences of the first source language sentence;

[0034] It is understandable that the solution provided in the present application can be applied to various scenarios where text translation is required, such as long text scenarios of lines, short text scenarios of lines, and dialogue scenarios.

[0035] In a specific implementation, the first source language sentence can be obtained from a training sample set. In fact, the training sample set may include multiple sentence pairs, each of which includes a source language sentence and a corresponding target language sentence. After executing this solution to obtain a new sentence pair, the new sentence pair is also added to the training sample set, thereby expanding the training sample set.

[0036] It is understandable that the role of the training sample set is to train the model and then obtain the machine translation model, which can translate one language into another, for example, Chinese into English, where Chinese is the source language and English is the target language. A sentence pair in the training sample set, for example, "She is a beautiful girl" and "She is a beautiful girl".

[0037] It is understandable that the specific meanings of the above-mentioned related sentences may be different in different application scenarios, but no matter in which scenario, the related sentences usually refer to sentences that have a certain interpretation effect on the translation sentence. For example, in the scenario of translating dialogue texts, the related sentences of the first source language sentence can be the previous sentence of the first source language sentence, the following sentence of the first source language sentence, or the previous sentence and the following sentence of the first source language sentence. Of course, in addition to the context sentences, the related sentences can also be the relevant annotation text, annotation text, annotation text, etc. of the sentence to be translated.

[0038] In specific implementation, the number of associated sentences can be selected as needed. For example, the associated sentences are context sentences. If the number n is set to 1, the previous sentence a and the next sentence c of the first source language sentence b in the source text are selected as context sentences. If n is set to 2, the previous two sentences a and b and the next two sentences d and e of the first source language sentence c in the source text are selected as context sentences.

[0039] Among them, there are many types of source texts, such as movies, TV series, articles, books, etc. Assuming that a machine training model is mainly used to translate lines in TV series, then the training sample set of this machine training model needs to contain lines corresponding to many TV series. In order to distinguish different TV series, a source identifier is set for each TV series. Different TV series correspond to different source identifiers. Therefore, all lines from the same TV series in the training sample set correspond to a source identifier. Of course, the lines in the training sample set have source language sentences and target language sentences. In order to distinguish sentence pairs from the same source text in the training sample set, and to facilitate the extraction of context sentences as related sentences, position identifiers can be set for source language sentences from the same source text. The position identifier is used to indicate the position of a source language sentence in its source text.

[0040] That is to say, the method provided by the present application may also include:

[0041] S100, setting a position index for source language sentences having the same source identifier, wherein the position index is a position number of the source language sentence in the source text corresponding to the source identifier;

[0042] Based on step S100, the process of obtaining the associated sentences of the first source language sentence in step S110 may include: selecting the associated text of the first source language sentence in the corresponding source text according to the position index of the first source language sentence. For example, if the position index of the first source language sentence is b, the context sentences of the first source language sentence may include the previous sentence a and the following sentence c. It can be seen that by setting the position index, the context sentences of the first source language sentence can be found more simply and conveniently as the associated text.

[0043] S120, concatenating at least one of the associated sentences with the first source language sentence to obtain a second source language sentence;

[0044] For example, assuming that the context sentences are taken as associated sentences, the number n=1 is set, the first source language sentence is b, and the corresponding first target language sentence is B; the previous sentence of sentence b is a, and the target language sentence corresponding to the previous sentence a is A; the following sentence of sentence b is c, and the target language sentence corresponding to the following sentence c is C. At least one of the context sentences a and c is concatenated with the first source language sentence b to obtain the second source language sentence b', so the second source language sentence b' includes three types: a+b, b+c, and a+b+c.

[0045] For another example, the number n=2, the first source language sentence is c, and the corresponding first target language sentence is C; the preceding sentences of sentence c are a and b, and the preceding sentences a and b correspond to target language sentences A and B respectively; the following sentences of sentence c are d and e, and the following sentences d and e correspond to target language sentences D and E respectively. At least one of the context sentences a, b, d, and e is concatenated with the first source language sentence c to obtain a second source language sentence c', so the second source language sentence c' includes 15 types: (1) Any one of the context sentences a, b, d, and e is concatenated with the first source language sentence c, and the obtained second source language sentence c' includes four: a+c, b+c, c+d, and c+e; (2) Any two of the context sentences a, b, d, and e are concatenated with the first source language sentence c, and the obtained second source language sentence c' includes The context sentences a, b, d, and e are concatenated with the first source language sentence c, and the second source language sentence c' includes four sentences: a+b+c+d, a+b+c+e, b+c+d+e, and a+c+d+e; (4) The context sentences a, b, d, and e are concatenated with the first source language sentence c, and the second source language sentence c' includes a+b+c+d+e. It can be seen that when n is 2, there are 15 second source language sentences c'.

[0046] Among them, the first source language sentence and the first target language sentence correspond to each other and come from a sentence pair. After analysis, the larger the n, the more the number of second source language sentences is, and the specific number is (2 2n -1).

[0047] It can be seen that the second source language sentence obtained through step S120 is real data, not pseudo data.

[0048] S130, determining a second target language sentence according to the second source language sentence;

[0049] In specific implementation, there are multiple ways to determine the second target language sentence in step S130, two of which are described below:

[0050] (1) Using a first target language sentence corresponding to the first source language sentence as the second target language sentence.

[0051] For example, the number n=1, the first source language sentence is b, and the corresponding first target language sentence is B. In this case, the first target language sentence B is the first target language sentence B'. In this case, the corresponding relationship between the second source language sentence and the second target language sentence is: a+b→B, b+c→B, a+b+c→B. The second source language sentence and the second target language sentence with the corresponding relationship can form a sentence pair.

[0052] For another example, the number n=2, the first source language sentence is c, and the corresponding first target language sentence is C. In this case, the first target language sentence C is the first target language sentence C', that is, the 15 second source language sentences c' listed above all correspond to C.

[0053] (2) Determine the second target language sentence based on the first source language sentence and a sentence in the second source language sentence other than the first source language sentence.

[0054] That is to say, when selecting the second target language sentence, it is not only based on the first target language sentence, but also based on at least one sentence in the associated sentences based on which the second source language sentence is determined in step S120.

[0055] For example, the number n=1, the first source language sentence is b, and at least one associated sentence selected when determining a second source language sentence is the context sentence a, then the second target language sentence is determined based on sentences a and b. When at least one associated sentence selected when determining a second source language sentence is the context sentences a and c, then the second target language sentence is determined based on sentences a, b, and c.

[0056] In a specific implementation, the second method may include: selecting a sentence or a combination of sentences adjacent to the first source language sentence from the sentences in the second source language sentence other than the first source language sentence, and concatenating the target language sentence corresponding to the selected sentence or combination of sentences with the first target language sentence corresponding to the first source language sentence to obtain the second target language sentence.

[0057] It is understandable that if one of the multiple adjacent sentences in the second source language sentence other than the first source language sentence is adjacent to the first source language sentence, the multiple adjacent sentences constitute a sentence combination.

[0058] For example, if n is 1, the first source language sentence is b, the second source language sentence b'=a+b, and sentence a is adjacent to the first source language sentence b, then A and B are concatenated to obtain B', that is, B'=A+B. At this time, the corresponding relationship between the second source language sentence and the second target language sentence is: b'=a+b→B'=A+B. If the second source language sentence is b'=b+c, ​​and sentence c is adjacent to the first source language sentence b, then C and B are concatenated to obtain B', that is, B'=B+C. At this time, the corresponding relationship between the second source language sentence and the second target language sentence is: b'=b+c→B'=B+C.

[0059] It is understandable that the sentences selected from the sentences other than the first source language sentence in the second source language sentence that are adjacent to the first source language sentence may be one or more. When the selected sentence is one, for example, b'=a+b+c→B'=B+C, b'=a+b+c→B'=A+B, when the selected sentences are multiple, for example, b'=a+b+c→B'=A+B+C.

[0060] For another example, n is 2, the first source language sentence is c, and the associated sentences are context sentences a, b, d, and e. The process of determining the second target language sentence is similar to the case where n=1 and the first source language sentence is b. For example, assuming that the sentences selected when splicing to form a second source language sentence are a, b, d, and e, that is, the second source language sentence c' includes a, b, c, d, and e. In sentences a, b, d, and e, sentences b and d are both adjacent to sentence c, so the corresponding second target language sentence may include: B+C, C+D. At this time, the corresponding relationship between the second source language sentence and the second target language sentence is: c'=a+b+c+d+e→C'=B+C, c'=a+b+c+d+e→C'=C+D.

[0061] Furthermore, a and b are adjacent sentences, and sentence b is adjacent to sentence c, so it can be seen that sentences a and b form a sentence combination, and the corresponding relationship between the second source language sentence and the second target language sentence is: c'=a+b+c+d+e→C'=A+B+C. d and e are adjacent sentences, and sentence d is adjacent to sentence c, so it can be seen that sentences d and e form a sentence combination, and the corresponding relationship between the second source language sentence and the second target language sentence is: c'=a+b+c+d+e→C'=C+D+E.

[0062] For sentence combinations, there is another corresponding relationship: c'=a+b+c+d+e→C'=A+B+C+D+E. This special case is actually: the target language sentences corresponding to the sentences in the second source language sentence except the first source language sentence are concatenated with the first target language sentence to obtain the second target language sentence. For this special method, the correspondence between the 15 second source language sentences c' and the second target language sentences in the above text is: a+c→A+C, b+c→B+C, c+d→C+D, c+e→C+E; a+b+c→A+B+C, b+c+d→B+C+D, c+d+e→C+D+E, a+c+d→A+C+D, a+c+e→A+C+E, b+c+e→B+C+E; a+b+c+d→A+B+C+D, a+b+c+e→A+B+C+E, b+c+d+e→B+C+D+E, a+c+d+e→A+C+D+E; a+b+c+d+e→A+B+C+D+E.

[0063] It can be seen that the second target language sentences obtained by either method (1) or method (2) are real data, not pseudo data.

[0064] S140: Form a sentence pair from the second source language sentence and the second target language sentence, and use the sentence pair as a training sample.

[0065] For example, n=1, the first source language sentence is b, and there are 8 new sentence pairs obtained through sample enhancement: a+b→B, b+c→B, a+b+c→B, a+b→A+B, b+c→B+C, a+b+c→B+C, a+b+c→A+B, a+b+c→A+B+C. These 8 new sentence pairs are added to the training sample set to expand the training sample set. Of course, when n=2, the number of new sentence pairs will be greater.

[0066] It is understandable that the method provided by the present application is suitable for many types of sentences, especially dialogue sentences. The characteristics of dialogue sentences are: the lengths of dialogue sentences vary, a single dialogue sentence may not be a complete sentence, and there is a certain connection between the contexts of dialogue sentences. The context sentences are used as related sentences to expand the training samples.

[0067] For example, the source language is Chinese and the target language is Malay. First, a training sample set originally containing 1,000 training samples is used for model training to obtain the first model; after the original training sample set is expanded by the training sample enhancement method provided in this application, the expanded training sample set is used for model training to obtain the second model. Then, the two models are evaluated using the parameter BLEU. Among them, BLEU stands for Bilingual Evaluation Understudy, which means bilingual evaluation substitute, that is, evaluating the translation results instead of people. The higher the value, the higher the translation quality of the model. Through calculation, the BLEU of the first model is 19.11, and the BLEU of the second model is 19.99. It can be seen that the parameter BLEU of the second model has been improved, which shows that the translation quality of the second model is higher than that of the first model.

[0068] The training sample enhancement method provided in the present application concatenates at least one of the associated sentences with the first source language sentence to obtain a second source language sentence, and then forms a new data pair based on the second source language sentence. The second source language sentence is real data, not pseudo data, which can reduce or avoid the negative impact of noise generated by pseudo data on the machine translation model.

[0069] In a second aspect, the present application provides a machine translation model training method, which specifically includes:

[0070] S210, obtaining a training sample, wherein the training sample includes a plurality of sentence pairs, each sentence pair including a source language sentence and a corresponding target language sentence;

[0071] S220, expanding the training samples using the training sample enhancement method provided in the first aspect;

[0072] S230: Perform model training according to the training samples and the expanded training samples.

[0073] Of course, during the training process in S230, it is generally necessary to verify the correctness of the text and determine whether the convergence conditions are met. When the convergence conditions are met, the model training is completed.

[0074] In a third aspect, the present application provides a training sample enhancement device, such as Figure 2 As shown, the device 100 includes the following modules:

[0075] A sentence acquisition module 110, configured to acquire a first source language sentence and associated sentences of the first source language sentence;

[0076] A first determining module 120, configured to concatenate at least one of the associated sentences with the first source language sentence to obtain a second source language sentence;

[0077] A second determination module 130, configured to determine a second target language sentence according to the second source language sentence;

[0078] The sentence pair forming module 140 is used to form a sentence pair from the second source language sentence and the second target language sentence, and use the sentence pair as a training sample.

[0079] It is understandable that the explanation, examples, beneficial effects, etc. of the training sample enhancement device provided in the embodiment of the present application can refer to the corresponding parts in the first aspect and will not be repeated here.

[0080] In a fourth aspect, the present application provides a machine translation model training device, specifically comprising:

[0081] A sample acquisition device, used to acquire training samples, wherein the training samples include a plurality of sentence pairs, each sentence pair includes a source language sentence and a corresponding target language sentence;

[0082] The training sample enhancement device 100 provided in the third aspect is used to expand the training sample;

[0083] The model training device is used to perform model training based on the training samples and the expanded training samples.

[0084] In a fifth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the training sample enhancement method provided in the first aspect or the machine translation model training method provided in the second aspect when executing the computer program. For example, the following steps in the method provided in the first aspect may be implemented: obtaining a first source language sentence and associated sentences of the first source language sentence; concatenating at least one of the associated sentences with the first source language sentence to obtain a second source language sentence; determining a second target language sentence based on the second source language sentence; forming a sentence pair with the second source language sentence and the second target language sentence, and using the sentence pair as a training sample.

[0085] Figure 3 FIG. 2 shows an internal structure diagram of a computer device in one embodiment. Figure 3 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and can also store a computer program. When the computer program is executed by the processor, the processor can implement the training sample enhancement method. The internal memory can also store a computer program. When the computer program is executed by the processor, the processor can execute the training sample enhancement method. The display screen of the computer device can be a liquid crystal display or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse.

[0086] Those skilled in the art will understand that Figure 2 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.

[0087] In one embodiment, the training sample enhancement device provided in the present application can be implemented in the form of a computer program. The computer program can be Figure 3 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the expansion device, for example, Figure 2The sentence acquisition module 110, the first determination module 120, the second determination module 130, and the sentence pair formation module 140 are shown. For example, the sample acquisition device, the training sample enhancement device, and the model training device. These devices are actually program modules. The computer program composed of each program module enables the processor to execute the steps in the training sample enhancement method of each embodiment of the present application described in this specification.

[0088] For example, Figure 3 The computer device shown can be Figure 2 The sentence acquisition module 110 in the training sample enhancement device shown in the figure acquires a first source language sentence and a sentence associated with the first source language sentence. The computer device can execute, through the first determination module 120, splicing at least one of the associated sentences with the first source language sentence to obtain a second source language sentence. The computer device can execute, through the second determination module 130, determining a second target language sentence according to the second source language sentence. The computer device can execute, through the sentence pair formation module 140, forming a sentence pair from the second source language sentence and the second target language sentence, and using the sentence pair as a training sample.

[0089] It is understandable that the explanations, examples, beneficial effects, etc. of the relevant contents of the computer device provided in the embodiments of the present application may refer to the corresponding parts in the first aspect or the second aspect and will not be repeated here.

[0090] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps in the training sample enhancement method provided in the first aspect or the machine translation model training method provided in the second aspect.

[0091] It is understandable that the computer-readable storage medium provided in the embodiments of the present application, the explanations, examples, beneficial effects, etc. of the relevant contents can refer to the corresponding parts in the first aspect or the second aspect, and will not be repeated here.

[0092] It is understood that any reference to memory, storage, database or other media used in the embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

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

[0094] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A training sample enhancement method, characterized in that: include: Acquire a first source language sentence and associated sentences of the first source language sentence; concatenating at least one of the associated sentences with the first source language sentence to obtain a second source language sentence; Determining a second target language sentence according to the second source language sentence; The second source language sentence and the second target language sentence form a sentence pair, and use the sentence pair as a training sample; The training sample includes a plurality of the sentence pairs; The step of determining a second target language sentence according to the second source language sentence includes: A sentence or a sentence combination adjacent to the first source language sentence is selected from the sentences in the second source language sentence other than the first source language sentence, and a target language sentence corresponding to the selected sentence or sentence combination is concatenated with a first target language sentence corresponding to the first source language sentence to obtain the second target language sentence.

2. The method according to claim 1, characterized in that The method further includes: setting a position index for source language sentences having the same source identifier, wherein the position index is a position number of the source language sentence in the source text corresponding to the source identifier; Acquiring the associated sentences of the first source language sentence includes: selecting the associated text of the first source language sentence in the corresponding source text according to the position index of the first source language sentence.

3. A machine translation model training method, characterized in that: include: Acquire a training sample, wherein the training sample includes a plurality of sentence pairs, each sentence pair including a source language sentence and a corresponding target language sentence; Expanding the training samples using the training sample enhancement method described in any one of claims 1 to 2; Model training is performed based on the training samples and the expanded training samples.

4. A training sample enhancement device, characterized in that: include: A sentence acquisition module, used to acquire a first source language sentence and associated sentences of the first source language sentence; A first determining module, configured to concatenate at least one of the associated sentences with the first source language sentence to obtain a second source language sentence; A second determining module, configured to determine a second target language sentence according to the second source language sentence; a sentence pair forming module, configured to form a sentence pair from the second source language sentence and the second target language sentence, and use the sentence pair as a training sample; The training sample includes a plurality of the sentence pairs; The second determining module includes: A sentence or a sentence combination adjacent to the first source language sentence is selected from the sentences in the second source language sentence other than the first source language sentence, and a target language sentence corresponding to the selected sentence or sentence combination is concatenated with a first target language sentence corresponding to the first source language sentence to obtain the second target language sentence.

5. A machine translation model training device, characterized in that: include: A sample acquisition device, used to acquire training samples, wherein the training samples include a plurality of sentence pairs, each sentence pair includes a source language sentence and a corresponding target language sentence; The training sample enhancement device according to claim 4 is used to expand the training samples; The model training device is used to perform model training based on the training samples and the expanded training samples.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 and / or the steps of the method according to claim 3 are implemented.

7. 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 any one of claims 1 to 2 and / or the steps of the method according to claim 3 are implemented.

Citation Information

Patent Citations

  • Machine translation method, machine translation model training method and device and storage medium

    CN112765998A