Sentence generation device, learning data generation device, and program
The sentence generation device uses a neural machine translator with control parameters to manage incremental sentence generation, addressing the lack of control in current models and ensuring accurate and varied translation outcomes.
Patent Information
- Application Number
- JP2023031582
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-12
AI Technical Summary
Current language generation models lack the ability to control the progression of sentence generation in incremental steps, making it difficult to check intermediate results and adjust the editing process.
A sentence generation device equipped with a neural machine translator that uses control parameters, such as edit distance, to manage the generation of sentences in incremental stages, allowing for the control and adjustment of intermediate results.
Enables the control of sentence generation through incremental editing, ensuring accurate and controlled progression of translation or text generation, maintaining translation accuracy while allowing for variations in the final output.
Smart Images

Figure 2024123840000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a sentence generation device, a training data generation device, and a program. [Background technology]
[0002] Natural language processing technology using neural networks can be used in various fields, and research is being conducted on this technology. One field included in natural language processing is language generation. Language generation tasks include, for example, language translation, question answering, text summarization, and style conversion. All of these language generation tasks involve inputting an input sentence into a neural network, which then generates an output sentence (respectively a translation, an answer, a summary, a style-converted sentence, etc.) corresponding to the input sentence.
[0003] In the current mainstream models for language generation tasks, only the final result (refined result) is observable. In other words, the current mainstream models are not incremental models that make corrections to the generated result and output the final result.
[0004] On the other hand, if we take the process of humans generating sentences as a reference, it is possible to generate sentences using an incremental approach (for example, generating a translated sentence).
[0005] Non-Patent Document 1 describes DIFFUSER (Diffusion via Edit-based Reconstruction), a model with a function for correcting existing text. DIFFUSER is an edit-based model that generates data incrementally. In other words, DIFFUSER assumes that data is revised based on editing steps. [Prior art documents] [Non-patent literature]
[0006] [Non-Patent Document 1] Machel Reid, Vincent J. Hellendoorn, Graham Neubig, Diffuser: Discrete diffusion via edit-based reconstruction, 2022, arXiv:2210.16886, https: / / arxiv.org / pdf / 2210.16886.pdf Summary of the Invention [Problem to be solved by the invention]
[0007] However, in the process of incrementally generating data, there may be cases where it is desired to control the degree of gradual progress in one editing step. For example, in the incremental generation process in language translation, it is desirable to be able to check intermediate results and to be given parameters for controlling, for example, the amount of editing for the intermediate results. To generalize this, it is desirable to be able to control the generation status with parameters in sentence generation using a neural network. The technology described in Non-Patent Document 1 has a problem in that it is not possible to control the generation of sentences in such a one-step manner.
[0008] The present invention has been made based on the recognition of the above problems, and aims to provide a sentence generation device that can control the manner of the sentences to be generated, a learning data generation device that generates learning data for the sentence generation device, and programs for each device. [Means for solving the problem]
[0009] [1] In order to solve the above problems, a sentence generation device according to one embodiment of the present invention is provided with a machine learning capable model, and includes a sentence generator that inputs an original sentence, a sentence of a t-th stage (where t≧0), and a t-th stage control parameter for performing a generation process based on the sentence of the t-th stage, and generates a sentence of a (t+1)-th stage based on the original sentence, the sentence of the t-th stage, and the control parameter.
[0010] [2] Another aspect of the present invention is that, in the sentence generation device of [1] above, the source sentence is a source language sentence, a sentence generated by the sentence generator based on the source language sentence is a target language sentence, and the sentence generator is a machine translator that generates the target language sentence based on the source language sentence.
[0011] [3] Another aspect of the present invention is a sentence generation device according to the above [1] or [2], wherein the control parameter is for controlling an edit distance between the sentence in the t stage and the sentence in the (t+1) stage.
[0012] [4] According to another aspect of the present invention, a training data generation device generates training data for machine learning of a sentence generator included in the sentence generation device according to [1] above, the training data generation device including an input unit for acquiring a pair of an input source sentence (s) and a reference translation (r) corresponding to the source sentence (s), and a second translation (U A ), and a first machine translator that receives the source sentence (s) and outputs a second translation sentence (U B ), wherein the first translation (U A ) different from the second translation (U B ), and a second machine translator that outputs the source sentence (s), the reference translation sentence (r), and the first translation sentence (U A ) and the second translation (U B ), and a data generation unit that generates the learning data based on the first translation sentence (U A ) and the reference translation (r), which is the first edit distance (e r-uA ) and the second translation (U B ) and the reference translation (r), r-uB ) and a third edit distance (e uA-uB Or e uB-uA ) and calculate the first edit distance (e r-uA ) is the second edit distance (e r-uB ), the original sentence (s) and the second translated sentence (UB ) and the third edit distance (e uA-uB ) as input data to the sentence generator, A ) is the correct data, and the training data (s|u B |e uA-uB , u A ) and generate the second edit distance (e r-uB ) is the first edit distance (e r-uA ), the original sentence (s) and the first translated sentence (U A ) and the third edit distance (e uB-uA ) as input data to the sentence generator, B ) is the correct data, and the training data (s|u A |e uB-uA , u B ) at least.
[0013] [5] In addition, one aspect of the present invention is the training data generation device according to the above [4], wherein the data generation unit generates a training data set based on the source sentence (s) and the first translation sentence (U A ) and the first edit distance (e r-uA ) as input data to the sentence generator, and the reference translation (r) as correct answer data. A |e r-uA , r), the original sentence (s) and the second translation sentence (U B ) and the second edit distance (e r-uB ) as input data to the sentence generator, and the reference translation (r) as correct answer data. B |e r-uB The method further generates at least one of the training data (s|r|0, r) in which a pair of the original sentence (s), the reference translation (r), and an edit distance of 0 (zero) is used as input data to the sentence generator, and the reference translation (r) is used as correct answer data.
[0014] [6] Another aspect of the present invention is a program for causing a computer to function as any one of the sentence generation devices described above in [1] to [3].
[0015] [7] Another aspect of the present invention is a program for causing a computer to function as the training data generation device according to [4] or [5] above. Effect of the Invention
[0016] According to the invention, the sentences generated by the sentence generator can be controlled by using control parameters. [Brief description of the drawings]
[0017] [Figure 1] 1 is a block diagram showing a schematic functional configuration of a translation system according to a first embodiment of the present invention. [Diagram 2] FIG. 2 is a schematic diagram showing a configuration of input / output data of the neural machine translator in the first embodiment. [Diagram 3] 1 is a block diagram showing a schematic internal functional configuration of a training data generation device according to a first embodiment. [Figure 4] 4 is a flowchart (1 / 2) showing a processing procedure for generating training data by the training data generation device according to the first embodiment. [Diagram 5] 11 is a flowchart (2 / 2) showing the procedure of a process for generating training data by the training data generation device according to the first embodiment. [Figure 6] FIG. 2 is a schematic diagram showing a step-by-step translation process using a neural machine translator according to the first embodiment; [Figure 7] FIG. 11 is a block diagram showing a schematic functional configuration of a text generation system according to a second embodiment. [Figure 8] FIG. 2 is a block diagram showing an example of the internal configuration of an apparatus according to the first embodiment, the second embodiment, etc.; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] Next, a number of embodiments of the present invention will be described with reference to the drawings. In the embodiments described below, the configuration of a neural machine translator that can check intermediate generation results and can be controlled will be described. One example of an object to be controlled is the amount of editing before and after editing. The method of the embodiments uses a model that inputs the machine translation result before editing and control parameters in addition to the original sentence to be translated, and outputs the translation result after editing. The translation result output by the model and the control parameters are repeatedly input into the same model to obtain the final translation result. The control parameter uses a score based on the editing distance between the translation results before and after editing. By using a gradual approach based on the process of human content generation, not only can intermediate results be checked, but the amount of editing can be controlled by giving a score according to the editing distance to indicate how much editing should be done on the intermediate translation result.
[0019] [First embodiment] FIG. 1 is a block diagram showing a schematic functional configuration of a translation system according to a first embodiment. As shown in the figure, the translation system 1 includes a neural machine translator 11, a learning control unit 12, and a learning data generating device 13. The neural machine translator 11, the learning control unit 12, and the learning data generating device 13 can each be realized by, for example, a computer and a program. Each component has a storage means as necessary. The storage means is, for example, a variable in the program or a memory allocated by the execution of the program. Also, non-volatile storage means such as a magnetic hard disk drive or a solid state drive (SSD) may be used as necessary. Also, at least a part of the function of each component may be realized as a dedicated electronic circuit rather than a program. The function of each component will be described below.
[0020] The neural machine translator 11 is configured using a neural network, and translates a source language sentence x0 and a t-th stage sentence x t and the control parameter e at the tth stage t and the (t+1)th stage translation x t+1(target sentence) is calculated and output. Note that x0 is the source sentence, and x t (where t≧1) is a target language sentence. In other words, the neural machine translator 11 is capable of gradually translating a source language sentence into a translated sentence (target language sentence). The neural machine translator 11 is a device that generates a translated sentence, and is also called a "sentence generator." In other words, the neural machine translator 11 generates a translated sentence (target language sentence) by performing a translation process. The neural network may be in the form of, for example, a Transformer or a CNN (Convolutional Neural Network). However, the type of neural network is not limited to those exemplified here.
[0021] In the translation system 1 of this embodiment, a sentence (a source language sentence or a target language sentence in a translation process) is represented as data of a string of tokens, each of which corresponds to a word or symbol constituting a sentence.
[0022] As a feature of this embodiment, the neural machine translator 11 uses the control parameter e t It accepts input of the control parameter e t An example of the edit distance is the edit distance (amount of edits). This edit distance is a non-negative integer. In this case, when the neural machine translator 11 translates the sentence x t Based on the (t+1)th stage sentence x t+1 When generating the statement x t and sentence x t+1 The edit distance between t or the edit distance is equal to the value e t The control parameters are controlled so that the value becomes close to . As the edit distance, the Levenshtein distance on a token-by-token basis may be used. In other words, the edit distance between sentences A and B in this embodiment may be the number of token insertions / deletions / substitutions required to arrive at the token string of sentence B from the token string of sentence A.
[0023] That is, in the processing of the neural machine translator 11 of this embodiment, one control parameter is for controlling the edit distance between a sentence in the tth stage (where t≧0) and a sentence in the (t+1)th stage.
[0024] In addition, the edit distance defined by another parameter e t The control parameters other than the edit distance may be used. For example, different document styles may be used as control parameters according to the genre of the document. The genre is, for example, a distinction between news content and drama content, between sports news and economic news, or even more detailed distinctions according to differences between authors. By preparing learning data for each genre, a neural machine translator that generates documents according to the specified genre parameters can be realized. In addition to the edit distance, position information in the sentence before editing may be used as a control parameter. This allows more detailed and specific instructions to be given via the control parameters. Furthermore, a wide variety of other control parameters may be used. A collection of multiple control parameters (for example, a collection of multiple control parameters as a multidimensional vector) may be used as a control parameter.
[0025] The neural machine translator 11 can operate in two modes: a learning mode and a translation execution mode. In the learning mode, the neural machine translator 11 uses training data to train its internal neural network (adjustment and optimization of internal parameters). In the translation execution mode, the neural machine translator 11 uses the trained neural network to t |e t ) based on the output data (x t+1 ) is calculated.
[0026] That is, the neural machine translator 11 (sentence generator) is provided with a model capable of machine learning, and receives an original sentence, a sentence in a t-th stage (where t≧0), and a control parameter in a t-th stage for performing a generation process based on the sentence in the t-th stage, and generates a sentence in a (t+1)-th stage based on the original sentence, the sentence in the t-th stage, and the control parameter. Here, the original sentence is a source language sentence. Furthermore, the sentence generated by the neural machine translator 11 (sentence generator) based on the source language sentence is a target language sentence. That is, the neural machine translator 11 generates the target language sentence based on the source language sentence.
[0027] An apparatus equipped with the neural machine translator 11 may be called a translation apparatus 20. The translation apparatus 20 is also called a "sentence generation apparatus."
[0028] The learning control unit 12 controls the learning of the neural machine translator 11. Specifically, the learning control unit 12 supplies learning data when the neural machine translator 11 performs learning. The learning data is a set of pairs of input data to the neural machine translator 11 and output data (correct answer data) corresponding to the input data. For example, the learning control unit 12 can supply learning data generated by the learning data generating device 13 for the neural machine translator 11 to learn. When the neural machine translator 11 learns, the internal parameters of the neural machine translator 11 are adjusted based on the difference (loss) between the output data generated by the neural machine translator 11 based on the input data to the neural machine translator 11 and the correct answer data of the output data included in the learning data. As a method at this time, an error backpropagation method is used.
[0029] The training data generation device 13 performs a process of generating training data to be used for machine learning of the neural machine translator 11 (sentence generator). Although the training data may be created manually, in order to efficiently train the neural machine translator 11, it is preferable to use training data automatically generated by the training data generation device 13. The procedure by which the training data generation device 13 generates the training data will be described later.
[0030] As mentioned above, the data input to the neural machine translator 11 is the source language sentence x0 and the tth stage sentence x t and the control parameter e at the tth stage t (where t≧0). The neural machine translator 11 accepts as input a string of these data separated by an appropriate delimiter. When the delimiter is "|", the input to the neural machine translator 11 is "x0|x t |e t " is expressed as follows.
[0031] 2 is a schematic diagram showing the configuration of input / output data of the neural machine translator 11 in this embodiment. FIG. 2(A) shows the configuration of a token sequence that is input to the neural machine translator 11. As shown in the figure, the input token sequence is composed of a token sequence 601 that represents a source language sentence x0, a token 604 that represents a delimiter, and a token 605 that represents a t-th stage sentence x0. t , a token sequence 602 representing a delimiter, and a control parameter e t The control parameter e is arranged in order. t In this embodiment, the input token sequence is a source language sentence x0, a t-th stage sentence x t , and the control parameter e t However, this order may be changed. FIG. 1B shows the structure of the token sequence that is input to the neural machine translator 11. As shown in the figure, the output token sequence is the (t+1)th stage sentence x t+1 Here is a token sequence 611 representing:
[0032] 3 is a block diagram showing a schematic internal functional configuration of training data generation device 13. As shown in the figure, training data generation device 13 includes an input unit 131, machine translators 132A and 132B, and a data generation unit 133.
[0033] The input unit 131 acquires data that is the basis for generating training data. The input unit 131 accepts, as input data, a set of pairs of a source language sentence s and a reference translation sentence (target language sentence, correct translation) r corresponding to the source language sentence s. In other words, the input unit 131 acquires a pair of an input source sentence (s, source language sentence) and a reference translation sentence (r, target language sentence) corresponding to the source sentence. The training data generation device 13 generates training data for each pair of the source language sentence s and the reference translation sentence r by the procedure described below.
[0034] Each of the machine translators 132A and 132B is a machine translator configured using a neural network or the like. The machine translators 132A and 132B perform a language translation process on the source language sentence s acquired by the input unit 131, and thereby generate a translation sentence (target language sentence) U A and U B Unlike the neural machine translator 11 described above, the machine translators 132A and 132B are not intended for step-by-step translation processing. In other words, each of the machine translators 132A and 132B outputs a translation in the middle stage and a control parameter (the above-mentioned e t The machine translators 132A and 132B do not accept inputs such as . The machine translators 132A and 132B use different models to translate the source language sentence s. The machine translators 132A and 132B may be realized, for example, using neural networks of different types (structures). Alternatively, the machine translators 132A and 132B may be realized using neural networks of the same type (structure), but even in this case, the respective models are trained using different training data. As a result, the translation sentences U output by the machine translators 132A and 132B for the same source language sentence s are A and U B are generally different sentences.
[0035] That is, the machine translator 132A (first machine translator) receives an original sentence (s) and generates a first translated sentence (U AThe machine translator 132B (second machine translator) receives the original sentence (s) and outputs a second translation sentence (U B ), wherein the first translation (U A ) different from the second translation (U B ) to output.
[0036] The data generation unit 133 receives a pair of a source language sentence s and a reference translation sentence r from the input unit 131 and generates translation sentences U and U respectively from the machine translators 132A and 132B. A and U B Specifically, the data generator 133 receives a source language sentence s, a reference translation sentence r, a translation sentence U A , and the translation U B Based on the above, the following four types of training data are generated. If the training data is expressed in the form of a pair of "(input data, correct answer data)", the first is (s|r|0, r). The second is (s|u A |e r-uA , r). The third is (s|u B |e r-uB , r). The fourth is the translation u A and u B Depending on (s|u A |e uB-uA , u B ) or (s|u B |e uA-uB , u A ) More specifically, the fourth training data is either one of the edit distance e r-uA and e r-uA It depends on the magnitude relationship between e r-uA <e r-uB (i.e., reference sentence r and translation sentence u A The distance between the reference sentence r and the translation sentence u is B When the distance between s and u is smaller than the distance between s and u, B |e uA-uB , u A ) is the fourth training data. Also, e r-uA >e r-uB (i.e., reference sentence r and translation sentence uB The distance between the reference sentence r and the translation sentence u is A When the distance between s and u is smaller than the distance between s and u, B |e uB-uA , u B ) is the fourth training data. In other words, for this fourth training data, A Tou B The translation that is closer to the reference translation r in terms of edit distance is considered to be the translation that is more advanced in the translation process, and the training data is created based on this. r-uA =e r-uA (i.e., reference sentence r and translation sentence u B The distance between the reference sentence r and the translation sentence u is A (s|u A |e uB-uA , u B ) or (s|u B |e uA-uB , u A ) (or both of these two) may be used as the fourth training data.
[0037] The four types of data above, from 1 to 4, are all ( x0|x t |e t ,x t+1 In other words, each of the first to fourth types of data can be used as learning data for the neural machine translator 11.
[0038] In the above, it has been described that the data generating unit 133 generates four types of learning data, from the first to the fourth, but the data generating unit 133 may generate only a part of these learning data. In other words, the data generating unit 133 generates learning data based on the acquired source sentence (s) and reference translation sentence (r) and the first translation sentence (U) generated by the machine translator 132A. A ) and the second translation (U B ) based on which training data is generated.
[0039] Specifically, the data generating unit 133 generates the first translated sentence (U A ) and the reference translation (r), which is the first edit distance (e r-uA ) and the second translation (U B ) and the reference translation (r), r-uB ) and a third edit distance (e uA-uB Or e uB-uA In addition, the data generating unit 133 calculates the first edit distance (e r-uA ) is the second edit distance (e r-uB ), the original sentence (s) and the second translated sentence (U B ) and the third edit distance (e uA-uB ) as input data to the sentence generator, A ) is the correct data, and the training data (s|u B |e uA-uB , u A The data generating unit 133 also generates at least the second edit distance (e r-uB ) is the first edit distance (e r-uA ), the original sentence (s) and the first translated sentence (U A ) and the third edit distance (e uB-uA ) as input data to the sentence generator, B ) is the correct data, and the training data (s|u A |e uB-uA , u B ) is generated. Note that the first edit distance (e r-uA ) and the second edit distance (e r-uB ), the data generator 133 generates the learning data (s|u B |e uA-uB , u A ) and the training data (s|u A |e uB-uA , u B ) or both.
[0040] Furthermore, the data generating unit 133 generates a data set of the original sentence (s) and the first translated sentence (U A ) and the first edit distance (e r-uA ) as input data to the sentence generator, and the reference translation (r) as correct answer data. A |e r-uA Further, the data generating unit 133 may generate a second translation (U B ) and the second edit distance (e r-uB ) as input data to the sentence generator, and the reference translation (r) as correct answer data. B |e r-uB Furthermore, the data generator 133 may generate the training data (s|r|0, r) using a set of the source sentence (s), the reference translation (r), and an edit distance of 0 (zero) as input data to the sentence generator, and using the reference translation (r) as correct answer data.
[0041] Next, a process procedure for generating learning data by the learning data generating device 13 will be described. Figures 4 and 5 are flowcharts showing the process procedure for generating learning data. Below, the process procedure of the learning data generating device 13 will be described with reference to these flowcharts.
[0042] First, in step S1 of FIG. 4, the input unit 131 of the training data generation device 13 acquires a pair of a source language sentence (translation source sentence) s and a reference translation sentence (correct translation sentence) r. The source language sentence s and the reference translation sentence r are represented, for example, as a string of tokens. Alternatively, the input unit 131 may convert each of the source language sentence s and the reference translation sentence r input as character strings into a token string. The input unit 131 passes the source language sentence s to the machine translators 132A and 132B, respectively. The input unit 131 also passes the pair of the source language sentence s and the reference translation sentence r to the data generation unit 133.
[0043] In step S2, the data generation unit 133 generates and outputs (s|r|0, r) as training data based on the data passed from the input unit 131. In other words, this training data is a pair of input data "s|r|0" and correct answer data "r" (the same applies below). The training data generated in this step corresponds to the generation of reference translation r based on reference translation r for source language sentence s (in other words, conversion from reference translation r to reference translation r) being equivalent to generation of a sentence with an edit distance of 0. This training data is used for training the neural machine translator 11.
[0044] Next, in step S3, the learning data generating device 13 inputs the source language sentence (the original sentence to be translated) s to the machine translator 132A, and outputs a translation sentence U A The machine translator 132A obtains the generated translation U A is passed to the data generating unit 133.
[0045] On the other hand, in step S4, the learning data generating device 13 inputs the source language sentence (the original sentence to be translated) s to the machine translator 132B, and outputs a translation sentence U B The machine translator 132B obtains the generated translation U B is passed to the data generating unit 133.
[0046] In step S5, the data generation unit 133 receives the reference translation r from the input unit 131 and the translation U from the machine translator 132A. A The edit distance e between r-UA Calculate.
[0047] In step S6, the data generation unit 133 converts the reference translation r passed from the input unit 131 and the translation U passed from the machine translator 132B into B The edit distance e between r-UB The edit distance calculated by the data generating unit 133 in steps S5 and S6 may be, for example, the Levenshtein distance in units of tokens described above. In other words, the process of calculating the edit distance belongs to existing technology.
[0048] In step S7, the data generator 133 calculates (s|u A |e r-uA , r) is generated as training data and output. The edit distance e r-uA is calculated in step S5. The training data generated in this step is A Generation of a reference translation r based on A to the reference translation r) is the edit distance e r-uA This training data is used for training the neural machine translator 11.
[0049] In step S8, the data generator 133 calculates (s|u B |e r-uB , r) is generated as training data and output. The edit distance e r-uB is calculated in step S6. The training data generated in this step is B Generation of a reference translation r based on B to the reference translation r) is the edit distance e r-uB This training data is used for training the neural machine translator 11.
[0050] Next, in step S9 of FIG. 5, the data generation unit 133 calculates the edit distance e r-uA and e r-uB In other words, e r-uA <e r-uB Determine whether or not e r-uA <e r-uB If the answer is true (step S9: YES), the process proceeds to step S10. r-uA <e r-uB If it is false (step S9: NO), the process jumps to step S12.
[0051] In addition, when the condition in step S9 is satisfied, if the two edit distances are equal, that is, er-uA =e r-uB However, if e r-uA =e r-uB In this case, the process may proceed to step S10.
[0052] When the process proceeds to step S10, the data generating unit 133 generates a translation U B and translation U A The edit distance e between UA-UB Calculate.
[0053] Next, in step S11, the data generator 133 calculates (s|u B |e uA-uB , u A ), is generated as training data and output. The edit distance e uA-uB is calculated in step S10. The training data generated in this step is B Translation based on A (in other words, the translation u B Translation from u A ) is the edit distance e uA-uB In addition, the translation sentence u is generated based on the judgment condition in step S9. A The translation is B This is a sentence that is closer to the reference translation (correct translation) r than the above. This learning data is used for learning the neural machine translator 11. When the process of step S11 is completed, the entire process of this flowchart ends.
[0054] When the process proceeds to step S12, the data generating unit 133 generates a translation U A and translation U B The edit distance e between UB-UA Calculate.
[0055] Next, in step S13, the data generator 133 calculates (s|u A |e uB-uA , u B ), is generated as training data and output. The edit distance e uB-uAis calculated in step S12. The training data generated in this step is A Translation based on B (in other words, the translation u A Translation from u B ) is the edit distance e uB-uA In addition, the translation sentence u is generated based on the judgment condition in step S9. B The translation is A This is a sentence that is closer to the reference translation (correct translation) r than the above. This learning data is used for learning the neural machine translator 11. When the process of step S13 is completed, the entire process of this flowchart ends.
[0056] The above flowchart processes a pair of a source language sentence (original sentence) s and a reference translation (correct translation) r acquired by the input unit 131. When there are multiple pairs of source language sentences s and reference translations r as input data, the training data generation device 13 can perform the process shown in the above flowchart for each pair. In this way, the training data generation device 13 calculates (x0|x t |e t ,x t+1 ) can be automatically generated. The learning control unit 12 can use the learning data generated by the learning data generating device 13 to train the neural machine translator 11. In other words, by using the learning data generating device 13, the neural machine translator 11 can be trained efficiently.
[0057] FIG. 6 is a schematic diagram showing the process of stepwise translation processing using a neural machine translator 11. As shown in the figure, first, "x0|x0|e0" is input to the trained neural machine translator 11. x0 is the source language sentence, and e0 is the control parameter for the 0th stage. Through the 0th stage processing, the neural machine translator 11 outputs a translated sentence x1. Next, the 1st stage processing is performed using this translated sentence x1. That is, "x0|x1|e1" is input to the neural machine translator 11. e1 is the control parameter for the 1st stage. Through this 1st stage processing, the neural machine translator 11 outputs a translated sentence x2. The translated sentence x2 is used as an input for the next stage processing. In the same manner, it is possible to perform a desired number of stages of translation processing. Note that the translated sentence x output as a result of the (t-1)th stage processing is t For example, by manually revising the translation (x t )´, and this (x t )' may be used as input to the next stage of processing.
[0058] [First Modification of the First Embodiment] In the case of the neural machine translator 11 of the first embodiment, information as an initial value of the translation process is not held. On the other hand, the first modified example may be implemented. That is, in the first modified example, the initial value is corrected using a provisional translation. That is, in this modified example, a provisional translation is input as the initial value x0 to be input to the neural machine translator 11. The provisional translation may be, for example, a translation generated by a neural machine translator using a conventional method (a translator that does not use a control parameter).
[0059] [Second Modification of the First Embodiment] FIG. 3 illustrates a functional configuration of the training data generating device 13 using two machine translators, 132A and 132B. As a second modification of the first embodiment, the training data generating device 13 may have three or more machine translators. When the training data generating device 13 has N (where N≧3) machine translators, the data generating unit 133 generates training data using the translations (U1 (first translated sentence) and U2 (second translated sentence)) output from two of the N machine translators, using the method already described (the procedure shown in the flowcharts of FIG. 4 and FIG. 5). The method of selecting two of the N machine translators is as follows: N C2) exist, so they ( N C2) The data generating unit 133 can generate learning data for each of the above.
[0060] [Second embodiment] Next, a second embodiment of the present invention will be described. Note that the matters already described in the previous embodiment may not be described below. Here, the matters unique to this embodiment will be mainly described.
[0061] 7 is a block diagram showing a schematic functional configuration of a sentence generation system according to this embodiment. As shown in the figure, a sentence generation system 701 includes a sentence generator 711, a learning control unit 712, and a learning data generation device 713. As in the first embodiment, each of the sentence generator 711, the learning control unit 712, and the learning data generation device 713 can be realized by, for example, a computer and a program. Furthermore, at least a part of the functions of each component may be realized as a dedicated electronic circuit rather than a program.
[0062] The sentence generator 711 is configured using a neural network, and takes an input sentence x0 and a t-th stage sentence x t and the control parameter e at the tth stage t and x are input, and the (t+1)th stage sentence x t+1 Calculate and output. Note that x0 is the input sentence. Also, xt (where t≧1) is a sentence generated by the sentence generator 711. In other words, the sentence generator 711 is capable of performing the task of generating a sentence in stages. The neural network may be in the form of, for example, a Transformer or a CNN (Convolutional Neural Network). However, the type of neural network is not limited to those exemplified here.
[0063] While the neural machine translator 11 in the first embodiment performs language translation processing of a sentence, the sentence generator 711 in this embodiment performs a more generalized task of sentence generation. In other words, the sentence generator 711 performs not only language translation but also tasks such as generating answers to questions, generating summaries based on input sentences, generating sentences with a changed style of input sentences, and other sentence generation tasks.
[0064] The sentence generator 711 can perform machine learning using training data. The training data may be data generated by the training data generation device 713, or may be data created by other methods (including manual creation).
[0065] The learning data is a set of pairs of input data to the sentence generator 711 and output data (correct answer data) from the sentence generator 711. A pair of data included in the learning data is (x0|x t |e t ,x t+1 ) can be expressed as
[0066] Control parameter e t For example, consider the sentence x t and sentence x t+1 In addition, the control parameter e tmay be something other than the edit distance. For example, different document styles may be used as control parameters depending on the genre of the document. In addition to the edit distance, position information in the sentence before editing may be used as a control parameter. Furthermore, a wide variety of other control parameters may be used. A collection of multiple control parameters (for example, a collection of multiple control parameters as a multidimensional vector) may be used as a control parameter. These control parameters other than the edit distance are as described in the first embodiment.
[0067] In other words, the sentence generator 711 is equipped with a model capable of machine learning, and inputs an original sentence, a sentence of a t-th stage (where t≧0), and a t-th stage control parameter for performing a generation process based on the sentence of the t-th stage, and generates a (t+1)-th stage sentence based on the original sentence, the sentence of the t-th stage, and the control parameter.
[0068] It should be noted that the device including the sentence generator 711 may be referred to as a sentence generation device 720 .
[0069] The learning control unit 712 controls the learning of the sentence generator 711. Specifically, the learning control unit 712 supplies learning data when the sentence generator 711 performs learning, and controls the adjustment (optimization) process of the internal parameters of the sentence generator 711 by a method such as backpropagation.
[0070] The training data generation device 713 performs processing to generate training data to be used for training the sentence generator 711. Although the training data may be created manually, in order to efficiently train the sentence generator 711, it is preferable to use training data automatically generated by the training data generation device 713.
[0071] FIG. 8 is a block diagram showing an example of the internal configuration of each device or each function in the first embodiment, the second embodiment, etc. Each device or each function can be realized by using a computer. As shown in the figure, the computer is configured to include a central processing unit 901, a RAM 902, an input / output port 903, input / output devices 904 and 905, etc., and a bus 906. The computer itself can be realized by using existing technology. The central processing unit 901 executes instructions included in a program read from the RAM 902, etc. According to each instruction, the central processing unit 901 writes data to the RAM 902, reads data from the RAM 902, and performs arithmetic operations and logical operations. The RAM 902 stores data and programs. Each element included in the RAM 902 has an address and can be accessed using the address. Note that RAM is an abbreviation for "random access memory." The input / output port 903 is a port through which the central processing unit 901 exchanges data with an external input / output device, etc. The input / output devices 904 and 905 are input / output devices. The input / output devices 904 and 905 exchange data with the central processing unit 901 via the input / output port 903. The bus 906 is a common communication path used inside the computer. For example, the central processing unit 901 reads and writes data from and to the RAM 902 via the bus 906. Also, for example, the central processing unit 901 accesses the input / output port 903 via the bus 906.
[0072] At least some of the functions of the translation system 1 or the text generation system 701 in the above-mentioned embodiment can be realized by a computer and a program. In that case, a program for realizing the functions may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read into the computer system and executed to realize the functions. Note that the term "computer system" here includes hardware such as an OS and peripheral devices. Furthermore, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, CD-ROMs, DVD-ROMs, and USB memories, and storage devices such as hard disks built into the computer system. In other words, the term "computer-readable recording medium" may be a non-transitory computer-readable recording medium. Furthermore, the term "computer-readable recording medium" may include a medium that temporarily and dynamically holds a program, such as a communication line when a program is transmitted via a network such as the Internet or a communication line such as a telephone line, and a medium that holds a program for a certain period of time, such as a volatile memory inside a computer system that is a server or client in that case. Furthermore, the above-mentioned program may be a program for realizing some of the above-mentioned functions, and may further be a program that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0073] [Evaluation experiment] In order to verify the effectiveness of the above embodiment, an evaluation experiment was conducted, and the results are described below. In this experiment, when the neural machine translator 11 of the first embodiment was used, We evaluate English-Japanese and Japanese-English translations of the ASPEC corpus of scientific and technical papers.
[0074] The overview of the datasets is shown in Table 1 below. The table shows the number of sentences, tokens, and types for each dataset. The numbers of tokens and types are shown for Japanese and English.
[0075] [Table 1]
[0076] Table 2 below shows the experimental results. Table 2 shows the translation accuracy for four cases: (A) the case of the conventional method, (B) the case of adding noise, (C) the case of the neural machine translator 11 of the first embodiment, and (D) the case of correcting the initial value while using the neural machine translator 11 of the first embodiment (a modified example of the first embodiment). The correction of the initial value in (D) refers to the case where the result of the conventional method is input as the initial value of the translation result instead of null. The BLEU score is used to measure the translation accuracy. It has been confirmed that the numerical value in the case of (D) makes it possible to prevent the translation accuracy from decreasing by inputting the result of the conventional method.
[0077] [Table 2]
[0078] Further analysis reveals the following: Table 3 below shows the translation accuracy when appropriate control parameters are given for each data set. In other words, the values shown in (B) of Table 3 are the translation accuracy when using the appropriate control parameter values, assuming that the appropriate control parameter values for each data set are known.
[0079] [Table 3]
[0080] Table 4 below shows examples of translation results (Example 1 to Example 3) when the control parameter (amount of editing) is set to a large value. These translation results show that the neural machine translator 11 of the first embodiment has the potential to output a variety of translated sentences while maintaining translation accuracy.
[0081] [Table 4]
[0082] As described above, the evaluation experiment was able to verify the effectiveness of a new model of sentence generation (for example, neural machine translation) using a gradual approach. This model achieved the same accuracy as conventional methods in translation processing. It was also confirmed that translation accuracy can be improved by setting appropriate control parameter values. The model used in the embodiment is capable of accepting control parameters (edit distance, etc.) as part of the input. In other words, it was confirmed that the sentence generation results can be controlled by the control parameters. It is to be noted that it is possible to use other control parameters suitable for editing work in sentence generation, not limited to edit distance.
[0083] In other words, according to the embodiment, not only can intermediate results in the process of generating a sentence be confirmed, but the intermediate translation results can also be controlled by providing control parameters according to the amount of editing before and after editing. As a result of the demonstration experiment, the translation accuracy of the neural machine translator of the embodiment was not significantly different from that of existing methods, but it was confirmed that the translation accuracy was significantly improved by providing appropriate control parameters for each data.
[0084] Although an embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to this embodiment, and designs that do not deviate from the gist of the present invention are also included.
[0085] It should be noted that any reference signs used in the claims are not intended to limit the scope of the claims. [Industrial Applicability]
[0086] The present invention can be used, for example, for the general task of generating a sentence based on an input sentence, although the scope of use of the present invention is not limited to the examples given here. [Explanation of symbols]
[0087] 1. Translation System 11 Neural machine translator (sentence generator) 12 Learning control section 13. Learning data generation device 20 Translation device (sentence generation device) 131 Input section 132A Machine Translator (First Machine Translator) 132B Machine translator (secondary machine translator) 133 Data Generation Division 701 Text Generation System 711 Sentence Generator 712 Learning control unit 713 Learning Data Generator 720 Sentence generator 901 Central Processing Unit 902 RAM 903 Input / Output Ports 904,905 Input / Output Devices 906 Bus
Claims
1. a sentence generator that is equipped with a machine learning capable model, and that inputs an original sentence, a sentence at a t-th stage (where t≧0), and a control parameter at a t-th stage for performing a generation process based on the sentence at the t-th stage, and generates a sentence at a (t+1)-th stage based on the original sentence, the sentence at the t-th stage, and the control parameter; A sentence generation device comprising:
2. the source sentence is a source language sentence, a sentence generated by the sentence generator based on the source sentence is a target sentence; the sentence generator is a machine translator that generates the target language sentence based on the source language sentence; The sentence generating device according to claim 1.
3. The control parameter is for controlling an edit distance between the sentences of the t stage and the sentences of the (t+1) stage. The sentence generating device according to claim 1.
4. A learning data generation device for generating learning data for performing machine learning of a sentence generator included in the sentence generation device according to claim 1, an input unit for acquiring a pair of an input source sentence (s) and a reference translation sentence (r) corresponding to the source sentence; The original sentence (s) is input, and a first translation sentence (U) corresponding to the original sentence (s) is generated. A ) and a first machine translator that outputs The original sentence (s) is input, and a second translation sentence (U B ), wherein the first translation (U A ) different from the second translation (U B ) and a second machine translator that outputs The source sentence (s), the reference translation sentence (r), and the first translation sentence (U A ), and the second translation (U B A data generating unit that generates the learning data based on the Equipped with The data generation unit The first translation (U A ) and the reference translation (r), r-uA ), and the second translation (U B ) and the reference translation (r), r-uB ) and a third edit distance (e uA-uB Or e uB-uA ) and The first edit distance (e r-uA ) is the second edit distance (e r-uB ), the original sentence (s) and the second translated sentence (U B ) and the third edit distance (e uA-uB ) as input data to the sentence generator, A ) is the correct answer data, B |e uA-uB , u A ) The second edit distance (e r-uB ) is the first edit distance (e r-uA ), the original sentence (s) and the first translated sentence (U A ) and the third edit distance (e uB-uA ) as input data to the sentence generator, B ) is the correct answer data, A |e uB-uA , u B ) It is something like, Training data generation device.
5. The data generation unit The original sentence (s) and the first translation sentence (U A ) and the first edit distance (e r-uA ) is input to the sentence generator, and the reference translation (r) is used as correct answer data. A |e r-uA , r), and The original sentence (s) and the second translation sentence (U B ) and the second edit distance (e r-uB ) is input to the sentence generator, and the reference translation (r) is used as correct answer data. B |e r-uB , r), and The learning data (s|r|0, r) is a set of the source sentence (s), the reference translation (r), and an edit distance of 0 (zero) as input data to the sentence generator, and the reference translation (r) is correct answer data; and further generating at least one of The training data generating device according to claim 4 .
6. A sentence generating device according to any one of claims 1 to 3, A program that makes a computer function as a
7. The training data generating device according to claim 4 or 5, A program that makes a computer function as a
