Sentence generation device, sentence generation method, and program

By integrating mini-batch embedding into the NMT model, the method addresses the limitation of considering only immediate context, enhancing translation accuracy and context-awareness in document-level sentence generation.

JP7570630B2Active Publication Date: 2024-10-22NIPPON TELEGRAPH & TELEPHONE CORP +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2021049517
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-03-24
Publication Date
2024-10-22
Estimated Expiration
2041-03-24

AI Technical Summary

Technical Problem

Conventional neural machine translation models only consider the context immediately before the target text data, failing to utilize a wider range of contexts.

Method used

The proposed method integrates mini-batch embedding (MBE) into the neural machine translation (NMT) model to incorporate context between sentences within a document by using average pooling and modifying the input to include mini-batch embedding, allowing the transformer encoder and decoder to account for a broader contextual range.

Benefits of technology

This approach enables the generation of sentences that better match the context within a document, improving translation accuracy and writing style suitability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007570630000012
    Figure 0007570630000012
  • Figure 0007570630000013
    Figure 0007570630000013
  • Figure 0007570630000014
    Figure 0007570630000014
Patent Text Reader

Abstract

To create text data in consideration of broader context.SOLUTION: A sentence generation device is a device for converting first text data into second text data based on a prediction model, and includes: an input unit for receiving an input of set data including the first text data; a set feature quantity calculation unit for calculating a set feature quantity representing a feature of the set data; and a conversion unit for converting the first text data into the second text data based on the set feature quantity.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a sentence generation device, a sentence generation method, and a program. [Background technology]

[0002] Attempts have been made to improve the accuracy of machine translation. For example, a Neural Machine Translation (NMT) model has been disclosed that uses a neural network to predict the likelihood of a word sequence. Also, attempts have been made to add information indicating the context between sentences to the NMT model.

[0003] For example, Non-Patent Document 1 discloses a method of concatenating a previous sentence with a sentence to be processed using a special token that indicates the boundary of the sentence. Also, Non-Patent Document 2 discloses a method of using a hierarchical attention network to use previous context embedding. [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] Jorg Tiedemann and Yves Scherrer. 2017. Neural machine translation with extended context. In Proceedings of the 3rd Workshop on Discourse in Machine Translation, pages 82-92. [Non-Patent Document 2] Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. 2018. Document-level neural machine translation with hierarchical attention networks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2947-2954. Summary of the Invention [Problem to be solved by the invention]

[0005] However, the conventional techniques disclosed in Non-Patent Document 1, Non-Patent Document 2, etc. have a problem in that only the context immediately before the target text data can be taken into account.

[0006] The disclosed technology aims to create text data taking into account a wider range of context. [Means for solving the problem]

[0007] The disclosed technology is a sentence generation device for converting first text data into second text data based on a predictive model, the sentence generation device including an input unit that receives input of set data including the first text data, a set feature calculation unit that calculates a set feature that represents a characteristic of the set data, and a conversion unit that converts the first text data into the second text data based on the set feature. Effect of the Invention

[0008] According to the disclosed technology, text data can be created taking into account a wider range of context. [Brief description of the drawings]

[0009] [Figure 1]FIG. 1 is a diagram for explaining an overview of an NMT model using mini-batch embedding. [Diagram 2] FIG. 2 is a diagram illustrating a functional configuration of the sentence generation device according to the first embodiment. [Diagram 3] 1 is a flowchart showing an example of the flow of a sentence generation process according to the first embodiment. [Figure 4] FIG. 11 is a diagram illustrating a functional configuration of a sentence generation device according to a second embodiment. [Diagram 5] 13 is a flowchart showing an example of a flow of a learning process according to the second embodiment. [Figure 6] FIG. 11 is a diagram illustrating a functional configuration of a sentence generation device according to a third embodiment. [Figure 7] 13 is a flowchart showing an example of the flow of a sentence generation process according to the third embodiment. [Figure 8] FIG. 11 is a diagram illustrating a functional configuration of a sentence generation device according to a fourth embodiment. [Figure 9] 13 is a flowchart showing an example of the flow of a learning process according to the fourth embodiment. [Figure 10] FIG. 2 is a hardware configuration diagram of the sentence generation device. [Figure 11] FIG. 11 is a first diagram showing an example of an experimental result. [Figure 12] FIG. 11 is a second diagram showing an example of an experimental result. [Figure 13] FIG. 11 is a third diagram showing an example of an experimental result. [Figure 14] FIG. 4 is a fourth diagram showing an example of an experimental result. [Figure 15] FIG. 5 is a fifth diagram showing an example of an experimental result. [Figure 16] FIG. 6 is a sixth diagram showing an example of an experimental result. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, an embodiment of the present invention (the present embodiment) will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment.

[0011] In the following description, references are identified as [1], [2] etc. The names of each reference are listed at the end of the specification.

[0012] (Regarding the Prior Art) First, we will explain the conventional technology. A conventional NMT (Neural Machine Translation) model f() is a model that computes a sequence of input sentence tokens x=(x1,...,x s ): Given y=f(x;θ), the output sequence of sentence tokens y=(y1,...,y t ), where θ is a set of model parameters, and s and t are the number of input and output sentence tokens, respectively. The model parameters are trained by minimizing the loss function in equation (1). Note that for each sentence token x i and y i may be a word or a partial word.

[0013]

number

[0014] Where:

[0015]

number

[0016] Such NMT models only use a single sentence as input and therefore do not take into account inter-sentence context.

[0017] (About mini-batch embedding) Next, mini-batch embedding according to the present embodiment will be described.

[0018] In order to utilize the context between sentences in the NMT model by simply changing it, we propose a method that uses mini-batch embedding (hereinafter referred to as MBE). MBE is data that represents the features of a mini-batch, specifically, data that integrates the features of each sentence contained in the mini-batch. The integration method includes a method that uses average pooling, which will be described later.

[0019] Figure 1 is a diagram for explaining the outline of an NMT model using mini-batch embedding. i is a sequence of input tokens, B is a mini-batch with n sentences, and E i is the contextualized embedding for each sentence computed by the Transformer encoder, v i is a vector of sentences, and z is a mini-batch embedding (MBE). Note that a special <pad>Tokens are padded and length-adjusted to match the longest sentence in the mini-batch.

[0020] B = {(x1,...,x n } is a mini-batch. Specifically, a set of sentences (e.g., one sentence, paragraph, etc.) contained in the same document in the input data is selected to create a mini-batch B. i represents the i-th sentence in the mini-batch. (The i-th sentence is chosen randomly from the document, but other selection methods are also allowed.)

[0021] The input data includes one or more documents. A document is a representation of a set of content made up of one or more sentences, such as the entire text contained in a single document (file), or a set of sentences in a given unit, such as a chapter or paragraph in a single document. Multiple mini-batches may be created from one document.

[0022] The method for extracting a set of given sentences may be, for example, a method using data in which IDs are assigned to the same document, or, if the text contains metadata (such as Chapters and Sections), a method using that information. Table 1 shows an example in which a document ID is assigned to identify the document (quoted from [5]).

[0023] [Table 1]

[0024] g enc Let () be a single transformer encoder layer. First, we create a per-sentence contextualized embedding E i =(e i,1 ,...,e i,si ) is E i =g enc (x i ;φ), where s i x i is the number of tokens in the model. φ is a model parameter.

[0025]

number

[0026]

number

[0027] In addition, the method according to the present embodiment uses mean pooling to extract the embeddings of the sentences v i and MBE(z). Average pooling is a method described in [1], which also discloses a method that successfully generates embeddings of sentences from BERT (Bidirectional Encoder Representations from Transformers) embeddings ([2]). This procedure is expected to result in MBE(z) containing inter-sentence context features that are desirable for context-aware NMT. ​​Examples of inter-sentence context features that are desirable for context-aware NMT include document domains, writing styles, and other features.

[0028] Note that the order of sentences within a document may be ignored, a useful property since the method can be applied to corpora that have document boundaries but no order of sentences within documents, such as [3].

[0029] To use inter-sentence information, the NMT model is modified to add MBE(z) to the input when determining the output sentence y, as shown in equation (3).

[0030] y = f(x,z;θ) (3)

[0031] As shown in Figure 1, the NMT model is a predictive model that concatenates MBE with the embedding of the input word and uses MBE as the first input token, so that the Transform Encoder and Transform Decoder obtain the embeddings of s+1 and t+1, respectively.

[0032] In the following, examples 1, 2, 3 and 4 will be described as the present embodiment.

[0033] Example 1 First, a description will be given of Example 1. Example 1 shows an example in which the sentence generation device according to the present embodiment uses mini-batch embedding (MBE) in a translation process using an NMT model.

[0034] FIG. 2 is a first diagram illustrating a functional configuration of the sentence generation device according to the first embodiment.

[0035] The sentence generation device 1 is a device for converting first text data into second text data based on a prediction model. Specifically, the sentence generation device 1 includes an input unit 11, a pre-processing unit 12, an analysis unit 13, an output unit 14, and a storage unit 15. The analysis unit 13 includes a collection feature calculation unit 131 and a conversion unit 132. The conversion unit 132 further includes a sentence encoding unit 132a and a sentence decoding unit 132b.

[0036] The input unit 11 receives a sentence set (a set of one or more sentences) as input data. The sentence set is composed of one or more documents. Note that the sentences included in the input sentence set are an example of pre-conversion text data (first text data).

[0037] The pre-processing unit 12 creates a mini-batch B from the input document. The mini-batch B is an example of collection data including first text data. The pre-processing unit 12 also outputs information indicating the created mini-batch B (hereinafter, referred to as mini-batch information) to the collection feature calculation unit 131, and outputs information indicating the mini-batch B or information indicating the sentences constituting the mini-batch B to the sentence encoding unit 132a.

[0038] The analysis unit 13 executes a process defined in the prediction model 151 stored in the storage unit 15 to analyze the input sentence. The collection feature calculation unit 131 calculates the MBE based on the mini-batch information. The MBE is calculated as shown in the above-mentioned formula (2). The MBE is an example of a collection feature that represents the characteristics of the collection data (mini-batch B). The conversion unit 132 converts the first text data into the second text data based on the MBE.

[0039] The sentence encoding unit 132a corresponds to the Transformer encoder shown in Fig. 1 and encodes sentences constituting a mini-batch based on MBE. The sentence decoding unit 132b corresponds to the Transformer decoder shown in Fig. 1 and decodes sentences based on MBE. The decoded sentences are an example of second text data.

[0040] The output unit 14 outputs the decoded sentences together as a set of translated sentences.

[0041] The storage unit 15 stores various information. Specifically, the storage unit 15 stores a prediction model 151 that corresponds to the above-mentioned NMT model.

[0042] Next, a description will be given of an operation of the sentence generation device 1 according to the embodiment 1. Fig. 3 is a flowchart showing an example of the flow of a sentence generation process according to the embodiment 1.

[0043] The input unit 11 receives a set of sentences (step S11).

[0044] The pre-processing unit 12 generates mini-batch information based on the sentence set (step S12). The pre-processing unit 12 passes the generated mini-batch information to the set feature calculation unit 131 and the sentence coding unit 132a. The pre-processing unit 12 also passes the sentence information constituting the mini-batch to the sentence coding unit 132a.

[0045] Next, the collection feature calculation unit 131 outputs the MBE based on the mini-batch information (step S13).

[0046] The conversion unit 132 generates a sentence based on the sentence information constituting the mini-batch and MBE (step S14). The generated sentence is a sentence obtained by translating the input sentence. The sentence encoding unit 132a has a function of an encoder in an encoder-decoder model, and has, for example, an embedding layer and a recurrent layer. The sentence decoding unit 132b has a function of a decoder in an encoder-decoder model, and has, for example, an embedding layer, a recurrent layer, an attention mechanism, and an output layer.

[0047] Specifically, the sentence encoding unit 132a encodes sentences constituting a mini-batch based on MBE. The sentence decoding unit 132b decodes the encoded sentences based on MBE. The sentence encoding unit 132a and the sentence decoding unit 132b execute processing one sentence at a time, and when all sentences to be processed are processed, the processing of this step S14 is terminated. Note that the sentences to be processed are sentences designated in advance, and all sentences included in the mini-batch may be processed, or only some sentences may be processed.

[0048] The output unit 14 outputs the generated set of sentences (step S15).

[0049] According to the sentence generation device 1 of Example 1, the collection feature calculation unit 131 calculates the MBE and the conversion unit 132 executes conversion of text data based on the MBE, so that sentences can be generated taking into account the context between sentences over a wide range within a document without making any major changes to the conventional NMT model.

[0050] Example 2 Next, a description will be given of a second embodiment. In the second embodiment, an example will be shown in which the sentence generation device according to the first embodiment uses MBE in machine learning of an NMT model. Fig. 4 is a diagram illustrating a functional configuration of the sentence generation device according to the second embodiment.

[0051] The sentence generation device 1 according to the second embodiment includes a parameter update unit 16 instead of the output unit 14 in the sentence generation device 1 according to the first embodiment.

[0052] An input unit 11 according to the second embodiment inputs a pair of an input sentence x and an output sentence y as learning data. The output sentence y is used as training data indicating an appropriate conversion result of the input sentence x.

[0053] The pre-processing unit 12 according to the second embodiment creates a mini-batch based on a pair of an input sentence x and an output sentence y.

[0054] The parameter update unit 16 according to the second embodiment receives the output y of the sentence decoding unit 132b and the input sentence x and the corresponding output sentence y, calculates the loss shown in the formula (4), and updates the parameters to minimize the loss. The storage unit 15 stores the prediction model 151 including the updated parameters.

[0055] In this specification, a character with "~" above y is written as "~y". "~y" indicates an output sentence of the sentence decoding unit 132b to be distinguished from the output sentence y of the training data, and adding "~" distinguishes it from the output sentence y of the training data.

[0056] Next, a description will be given of an operation of the sentence generation device 1 according to the second embodiment. Fig. 5 is a flowchart showing an example of the flow of a learning process according to the second embodiment.

[0057] The input unit 11 receives learning data (step S21). The learning data is made up of a set of sentences including an input sentence x and an output sentence y corresponding to x.

[0058] The pre-processing unit 12 generates mini-batch information based on the sentence set of the input sentence x (step S22). The generated mini-batch information is the same as the sentence generation process according to the first embodiment.

[0059] The set feature calculation unit 131 outputs the MBE based on the mini-batch information (step S23). Then, the conversion unit 132 generates sentences based on the sentence information constituting the mini-batch and the MBE (step S24). Steps S23 and S24 are similar to steps S13 and S14 of the sentence generation process according to the first embodiment.

[0060] Next, the parameter update unit 16 calculates a loss using the sentence .about.y generated in step S24 and the output sentence y as input, and updates the parameters (step S25).

[0061] Specifically, the NMT transformer encoder layer that prescribes the processing of the parameter update unit 16 learns together with the NMT model by changing the loss function of equation (1) as shown in equation (4).

[0062]

number

[0063]

number

[0064]

number

[0065] According to the sentence generation device 1 according to the second embodiment, the collection feature calculation unit 131 calculates the MBE, and the output sentences converted by the conversion unit 132 based on the MBE are used for machine learning. Therefore, it is possible to improve the accuracy of generating sentences taking into account the context between sentences in a wide range within a document.

[0066] Example 3 Next, a description will be given of a third embodiment. In the third embodiment, a configuration example in which a collection feature updating unit is added to the sentence generation device according to the first embodiment is shown. Fig. 6 is a diagram illustrating a functional configuration of the sentence generation device according to the third embodiment.

[0067] The analysis unit 13 included in the sentence generation device 1 according to the third embodiment has a configuration in which a set feature update unit 133 is added to the analysis unit 13 according to the first embodiment.

[0068] The collection feature update unit 133 estimates the importance of MBE(z) and updates MBE(z) based on the importance (the updated MBE is denoted as ~z). The collection feature update unit 133 passes MBE(~z) to the sentence encoding unit 132a and the sentence decoding unit 132b.

[0069] Specifically, the set feature update unit 133 has a binary classifier represented by equation (5). This binary classifier predicts whether sentences in a mini-batch are selected from the same document.

[0070] P(d|z)=softmax(Wz) (5) Where:

[0071]

number

[0072] The set feature updating unit 133 uses the predicted value of this binary classifier as a gate (hereinafter, referred to as a mini-batch embedding gate). That is, the set feature updating unit 133 obtains a new MBE(~z) by Equation (8).

[0073] ~z=αz (8) Here, α=P(d=1|z), and the collection feature update unit 133 changes z in formula (3) to ∼z. Note that α corresponds to the importance level described above.

[0074] FIG. 7 is a flowchart illustrating an example of the flow of a sentence generation process according to the third embodiment.

[0075] In the sentence generation process according to the third embodiment, following step S13 of the sentence generation process according to the first embodiment, the set feature update unit 133 updates the MBE by a mini-batch embedding gate (step S31).

[0076] The conversion unit 132 generates sentences based on the sentence information constituting the mini-batch and the updated MBE(~z) (step S14).

[0077] According to the sentence generation device 1 according to the third embodiment, the collection feature update unit 133 estimates the importance of the MBE calculated by the collection feature calculation unit 131, and updates the MBE based on the importance. This enables conversion processing according to the importance of the MBE, and makes it possible to avoid a decrease in conversion accuracy due to being based on the MBE.

[0078] Example 4 Next, a fourth embodiment will be described. In the fourth embodiment, an example is shown in which the sentence generation device according to the third embodiment uses MBE in machine learning of an NMT model. Fig. 8 is a diagram illustrating a functional configuration of the sentence generation device according to the fourth embodiment.

[0079] The sentence generation device 1 according to the fourth embodiment includes a parameter update unit 16 instead of the output unit 14 in the sentence generation device 1 according to the third embodiment.

[0080] The pre-processing unit 12 according to the third embodiment delivers to the collection feature update unit 133 (i) a mini-batch consisting of a collection of sentences selected from the same document and (ii) a mini-batch consisting of a collection of sentences selected from different documents.

[0081] The parameter update unit 16 according to the fourth embodiment receives the output ∼y of the sentence decoding unit 132b, the output sentence y included in the learning data, and the estimation result d by the collection feature update unit 133 as input, and updates the parameters so as to minimize the loss expressed by equation (6).

[0082]

number

[0083] Here, ψ is the set of parameters for the binary classifier. In addition, in training, two types of mini-batches are mixed in the same ratio.

[0084] In practice, the parameter update unit 16 updates the parameters so as to minimize the loss function of the equation (7) in order to jointly minimize the loss functions of the NMT model and the binary classifier.

[0085]

number

[0086] Next, a description will be given of an operation of the sentence generation device 1 according to the embodiment 4. Fig. 9 is a flowchart showing an example of the flow of a learning process according to the embodiment 2.

[0087] The input unit 11 receives learning data (step S21). The learning data is made up of a set of sentences including an input sentence x and an output sentence y corresponding to x.

[0088] The pre-processing unit 12 generates mini-batch information based on the sentence set of the input sentence x (step S22). The generated mini-batch information is the same as the sentence generation process according to the third embodiment.

[0089] The collection feature calculation unit 131 outputs the MBE based on the mini-batch information (step S23). Then, the collection feature update unit 133 outputs the estimation result d by the mini-batch embedding gate, and updates the MBE (step S41).

[0090] The conversion unit 132 generates sentences based on the sentence information constituting the mini-batch and the MBE (step S24). Steps S23 and S24 are similar to steps S13 and S14 of the sentence generation process according to the third embodiment.

[0091] Next, the parameter update unit 16 calculates a loss using the sentence ∼y generated in step S24, the output sentence y, and the estimation result d as input, and updates the parameters (step S42).

[0092] Specifically, the NMT transformer encoder layer that defines the processing of the parameter update unit 16 learns based on the importance of mini-batch information using the loss function of equation (6).

[0093] According to the sentence generation device 1 of the fourth embodiment, the collection feature update unit 133 estimates the importance of MBE calculated by the collection feature calculation unit 131, and the parameter update unit 16 updates the parameters of the prediction model 151 based on the estimation result. This enables learning according to the importance of MBE, and makes it possible to avoid a decrease in learning accuracy due to being based on MBE.

[0094] (Hardware configuration example) The sentence generation device can be realized, for example, by making a computer execute a program describing the processing contents described in this embodiment. Note that this "computer" may be a physical machine or a virtual machine on the cloud. When a virtual machine is used, the "hardware" described here is virtual hardware.

[0095] The above program can be recorded on a computer-readable recording medium (such as a portable memory) and can be stored or distributed. The above program can also be provided via a network such as the Internet or e-mail.

[0096] Fig. 7 is a diagram showing an example of the hardware configuration of the computer. The computer in Fig. 7 has a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, etc., which are all connected to each other via a bus B.

[0097] The program for realizing the processing on the computer is provided by a recording medium 1001 such as a CD-ROM or a memory card. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed from the recording medium 1001 to the auxiliary storage device 1002 via the drive device 1000. However, the program does not necessarily have to be installed from the recording medium 1001, but may be downloaded from another computer via a network. The auxiliary storage device 1002 stores the installed program as well as necessary files, data, etc.

[0098] When a program start instruction is received, the memory device 1003 reads out and stores the program from the auxiliary storage device 1002. The CPU 1004 realizes the functions related to the device according to the program stored in the memory device 1003. The interface device 1005 is used as an interface for connecting to a network. The display device 1006 displays a GUI (Graphical User Interface) or the like according to a program. The input device 1007 is composed of a keyboard, a mouse, a button, a touch panel, or the like, and is used to input various operation instructions. The output device 1008 outputs the calculation results. Note that the above computer may be equipped with a GPU (Graphics Processing Unit) instead of the CPU 1004, or may be equipped with a GPU in addition to the CPU 1004. In that case, the processes may be shared and executed, such that the GPU executes processes that require special calculations such as neural networks, and the CPU 1004 executes other processes.

[0099] (Experimental Results) Next, the results of an experiment using the sentence generation device 1 according to each of the above-mentioned embodiments will be described.

[0100] (Comparative model) Three settings were used as baselines for comparison.

[0101] The baseline, 6Enc-Lyr, is the original Transformer NMT model with six encoder and decoder layers.

[0102] The baseline "7Enc-Lyr" is similar to the previous one, but the number of encoder layers is changed to 7. Because the MBE model requires an extra transformer encoder layer, this model has a comparable number of parameters to the next MBE model.

[0103] The baseline "2-to-1" is a context-aware translation model described in Non-Patent Document 1, which translates a pair of previous and current input sentences into an output sentence. The two input sentences are concatenated with a special sentence boundary token. This method is known as a strong baseline for context-aware NMT. ​​Other settings are the same as the baseline "6Enc-Lyr".

[0104] The proposed methods were then compared under the following settings.

[0105] "MBE Enc" is similar to the baseline "6Enc-Lyr", but uses MBE in the encoder.

[0106] "MBE Enc w / o Gate" is similar to "MBE Enc", but does not use the mini-batch embedded gate according to the third embodiment.

[0107] "MBE Dec" uses MBE in the decoder.

[0108] "MBE Enc / Dec" uses MBE in both the encoder and decoder.

[0109] (Experimental Setup) We trained an NMT model that translates from Japanese to English. We used the JParaCrawl corpus [4] as training data. JParaCrawl was created by crawling the web and aligning parallel sentences. Each sentence pair has a URL from which the sentences were retrieved. Therefore, in this experiment, sentences retrieved from the same URL were treated as being included in a single document.

[0110] We used several test sets with document boundaries: (i) scientific paper excerpts (ASPEC[5]), (ii) news (newsdev2020 from the WMT20 news translation shared task), and (iii) TED talks (tst2012 from the IWSLT translation shared task[6]). We used the ASPEC development split as a development set to train the NMT model. Corpus statistics and detailed pre-processing steps are described below.

[0111] To evaluate the translation performance, we used “sacreBLEU” ([7]) and reported the BLEU score ([8]).

[0112] (Model configuration) We used the Transformer model as the NMT model ([9]). The hyperparameters are based on the "big" setting defined by [9]. In this MBE experiment, λ in equation (7) was set to 1.0. Detailed hyperparameter and learning settings are described later.

[0113] (Experimental Results and Analysis) Figure 8 shows an example of experimental results. The values ​​in parentheses indicate the difference in score from the baseline "6Enc-Lyr". The highest scores for each test set are highlighted in bold.

[0114] Figure 8 summarizes the model's performance on several test sets. The performance on the development set will be described later. The experimental results show that the sentence generation device 1 according to the present embodiment scores better than all three baselines, "6Enc-Lyr", "7Enc-Lyr" and "2-to-1".

[0115] When the translated sentences were examined, it was found that the sentence generation device 1 according to the present embodiment improves the writing style to match the context and selects words appropriate for the context. Actual translation examples will be described later.

[0116] These results indicate that MBE aided the NMT model by providing contextual information across mini-batches.

[0117] (Effect of Decoding on Batch Size) Figure 9 is the second figure showing an example of experimental results. We have described the translation performance when using documents with reference to Figure 8. However, in real use, there are cases where a single sentence needs to be translated without context. Figure 9 shows the results of decoding the test set by limiting the number of sentences in a mini-batch to one to check the robustness of the model in such situations.

[0118] That is, Figure 9 shows the BLEU scores for analyzing the translation performance without context information. Note that we limited the decoding mini-batch size to the sentence size of the MBE usage method. Also, in the "2-to-1" case, we removed the previous context sentence.

[0119] The scores of the first two baselines are the same as in Figure 8 because these settings are not affected by the mini-batch size. Our model achieves a score comparable to the baselines, which means that our model can be used for both context consideration and single sentence translation.

[0120] (Effect of mini-batch embedding gate) To check whether the gate works correctly as expected, we examined the gate weight α in equation (8). When the development set was translated using document mini-batches, the average weight was 0.71. On the other hand, for one-sentence mini-batches, the average weight was 0.50, which is much smaller. This is likely the reason why "MBE Enc w / o Gate" significantly reduces the BLEU score when translating a single sentence, as shown in Figure 9. From this observation, we empirically confirmed that the mini-batch embedding gate reduces the weight given to the less informative MBE, preventing it from compromising translation quality.

[0121] (Details of the experimental setup) Figure 10 is the third figure showing an example of the experimental results. Figure 10 shows the number of sentences and documents in each of the train / dev / test sets used in the experiment. Sentences were tokenized into partial words by sentence pieces (

[10] ), and the vocabulary size was set to 32k for each language. In the training set, sentences with a length of more than 250 partial word tokens were deleted.

[0122] (Model configuration details) We used the Transformer model as the NMT model ([9]). The hyperparameters were based on the "big" setting defined by [9], including six encoder-decoder layers with each hidden layer set to 1,024 dimensions, 16 attention heads, and a feedforward network hidden layer of 4,096 dimensions. We used dropout with a probability of 0.3 (

[11] ).

[0123] The optimizer used was Adam (

[12] ) with α = 0.001, β1 = 0.9 and β2 = 0.98. A square-root decaying learning rate schedule with a linear warm-up of 4,000 steps was used ([9]). Gradients were clamped to never exceed a threshold of 1.0.

[0124] In this MBE experiment, we set λ in equation (7) to 1.0 and the batch size per GPU to 3,000 tokens. Because large batch training can reduce training time (

[13] ), we accumulated approximately 280,000 tokens for updating. Based on the complexity of the development set, we trained the model for 24,000 iterations. We saved the model every 200 iterations and averaged the last 8 model parameters for decoding.

[0125] We normalize the candidate translation scores by dividing them by their length and perform a beam search of size 6. Our implementation is based on fairseq (

[14] ). We use mixed precision training (

[15] ) to reduce memory consumption and training time. All experiments were performed on a single NVIDIA Tesla V100 GPU with 32 GB memory.

[0126] Since we did not perform hyperparameter search, almost all settings were borrowed from [4].

[0127] An NMT model having these model configurations is an example of the prediction model 151 according to the present embodiment.

[0128] (Additional experimental results) Figure 11 is the fourth figure showing an example of experimental results. Figure 11 shows the number of parameters for each model, the training speed, and the BLEU score for the development set. The scores show the same trend as the test set (Figures 8 and 9).

[0129] In Fig. 11, we show the number of parameters, the training speed (words per second, wps), the time required for training, and the BLEU score on the development set: the "With context" column is for the main results corresponding to Fig. 8, and the "Without context" column is for the translation analysis without context information corresponding to Fig. 9.

[0130] (Example of translation) FIG. 12 is the fifth diagram showing an example of an experimental result. FIG. 12 shows an example of a translation of a sentence from a scientific paper excerpt (ASPEC test set). In this example, the word "mentions" is translated in two directions. The baseline system translated the word into "mentions", which is a colloquial expression. In contrast, the method according to the present embodiment converted the word into "mentions", which is suitable for scientific papers. This shows that MBE can change the writing style to be more suitable for scientific papers compared to the baseline.

[0131] Figure 13 is the sixth figure showing an example of experimental results. Figure 13 shows another example from the TED talk (tst2012). This example shows how the model according to this embodiment can change the translation of the word "you". The method according to this embodiment translated this word to "kimi", which is more familiar, as compared with the baseline output "anata". In this document, since "he" is a friendly old man, the output of MBE is more suitable for this context.

[0132] As described above, according to the sentence generation device 1 according to this embodiment, by using MBE, a sentence considering the context in the document can be generated. As a result, as shown in the above-described experimental results, for example, a sentence along the context in the document can be generated in translation.

[0133] In this embodiment, the unit of translation is a sentence, and the unit of mini-batch is a document. It may be otherwise as long as the unit of translation is included in the mini-batch. That is, a sentence is an example of text data, and a document is an example of set data that is a set of text data.

[0134] The NMT model according to this embodiment is an example of a so-called encoder-decoder model. Also, translation is an example of sentence generation. The sentence generation according to the present invention is not limited to this, and may be generation of a summary sentence, generation of a spoken sentence, etc. by an encoder-decoder model.

[0135] Furthermore, in this embodiment, an example in which the prediction model constituting the conversion unit 132 is an encoder-decoder model has been shown, but it may be otherwise. For example, a prediction model using only one of an encoder or a decoder, such as a BERT model [2], a GPT model

[16] , etc. may be used.

[0136] [References] [1] Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing(EMNLP), pages 3982-3992. [2] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL HLT). [3] Miquel Espla, Mikel Forcada, Gema Ramirez-Sanchez, and Hieu Hoang. 2019. ParaCrawl: Web-scale parallel corpora for the languages of the EU. In Proceedings of Machine Translation Summit XVII Volume 2: Translator, Project and User Tracks, pages 118-119. [4] Makoto Morishita, Jun Suzuki, and Masaaki Nagata. 2020. JParaCrawl: A large scale web-based Japanese-English parallel corpus. In Proceedings of the 12th International Conference on Language Resources and Evaluation (LREC), pages 3603-3609. [5] Toshiaki Nakazawa, Manabu Yaguchi, Kiyotaka Uchimoto, Masao Utiyama, Eiichiro Sumita, Sadao Kurohashi, and Hitoshi Isahara. 2016. ASPEC: Asian scientific paper excerpt corpus. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC). [6] Mauro Cettolo, Christian Girardi, and Marcello Federico. 2012. WIT3: web inventory of transcribed and translated talks. In Proceedings of the 16th Annual Conference of the European Association for Machine Translation (EAMT), pages 261-268. [7] Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the 3rd Conference on Machine Translation (WMT), pages 186-191. [8] Kishore Papineni, Salim Roukos, Todd Ward, and WeiJing Zhu. 2002. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics (ACL), pages 311-318. [9] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Proceedings of the 31st Annual Conference on Neural Information Processing Systems (NeurIPS), pages 6000-6010.

[10] Taku Kudo. 2018. Subword regularization: Improving neural network translation models with multiple subword candidates. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL), pages 66-75.

[11] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929-1958.

[12] Diederik Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR).

[13] Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. 2018. Scaling neural machine translation. In Proceedings of the 3rd Conference on Machine Translation (WMT), pages 1-9.

[14] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL HLT), pages 48-53.

[15] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory F. Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and HaoWu. 2018. Mixed precision training. In Proceedings of the 6th International Conference on Learning Representations (ICLR).

[0137] (Additional Note) This specification discloses at least the sentence generation device, sentence generation method, program, and storage medium described in the appended claims below. (Additional note 1) 1. An apparatus for converting first text data into second text data based on a predictive model, comprising: Memory, at least one processor coupled to the memory; Including, The processor, receiving an input of collection data including the first text data; Calculating a collection feature that represents a feature of the collection data; converting the first text data into the second text data based on the collection features; Sentence generator. (Additional note 2) The processor, estimating the importance of the collection feature calculated in the process of calculating the collection feature, and updating the collection feature based on the importance; In the converting process, the first text data is converted into the second text data based on the collection feature updated in the collection feature updating process. 3. A sentence generation device according to claim 2. (Additional note 3) the prediction model includes definitions of a process for calculating the set feature amount and a process for converting the set feature amount, The processor, updating parameters included in the predictive model; In the input receiving process, learning data including set data including the first text data and teacher data indicating an appropriate conversion result of the first text data is input, In the parameter updating process, parameters included in the prediction model are updated based on the teacher data and the second text data converted in the converting process. 3. The sentence generation device according to claim 1 or 2. (Additional note 4) The processor, estimating the importance of the collection feature calculated in the process of calculating the collection feature, and updating the collection feature based on the importance; The prediction model further includes a definition of a process for updating the set features; The processor, In the process of updating the parameters, a parameter included in the prediction model is updated based on the importance and information indicating whether the multiple first text data included in the group data are selected from the same document. A sentence generation device according to claim 3. (Additional note 5) 1. A computer-implemented method comprising: receiving input of collection data including first text data; calculating a set feature value representing a feature of the set data; and converting the first text data into second text data based on the collection features. Sentence generation method. (Additional note 6) A program for causing a computer to function as each unit in the sentence generation device according to any one of claims 1 to 4. (Additional note 7) A non-transitory storage medium storing a program executable by a computer to execute a sentence generation process, In the sentence generation process, the computer receiving an input of information indicating collection data including the first text data; Calculating a collection feature that represents a feature of the collection data; converting the first text data into the second text data based on the collection features; Non-transitory storage medium.

[0138] Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and variations are possible within the scope of the gist of the present invention described in the claims. [Explanation of symbols]

[0139] 1 Sentence generator 11 Input section 12 Pre-processing section 13 Analysis Department 14 Output section 15 Storage section 16 Parameter Update Section 131 Set feature calculation unit 132 Conversion unit 132a Sentence encoder 132b Sentence Decoding Unit 133 Set feature update unit 151 Predictive Models 1000 Drive Device 1001 Recording media 1002 Auxiliary storage 1003 Memory device 1004 CPU 1005 Interface device 1006 Display device 1007 Input Device 1008 Output device< / pad>

Claims

1. 1. An apparatus for converting text data into other text data based on a predictive model, comprising: an input unit for receiving input of collection data composed of text data included in one or more documents; a collection feature calculation unit for calculating a collection feature representing a feature of the collection data; a collection feature update unit that estimates an importance of the collection feature so that the importance is high enough that it is predicted that the text data included in the collection data are selected from the same document and low enough that it is not predicted that the text data included in the collection data are selected from the same document, and calculates a product of the collection feature and the importance as an updated collection feature; a conversion unit that converts first text data included in the set data into second text data by the prediction model by including the updated set feature in an input sequence to the prediction model. Sentence generator.

2. A parameter update unit that updates parameters of the prediction model, The input unit receives input of learning data including the set data and teacher data indicating an appropriate conversion result of the first text data, The parameter update unit updates parameters of the prediction model based on the teacher data and the second text data converted by the conversion unit. The sentence generating device according to claim 1.

3. 1. A computer-implemented method comprising: receiving an input of collection data comprising text data contained in one or more documents; calculating a set feature value representing a feature of the set data; estimating an importance of the collection feature such that the importance is high enough to predict that the text data included in the collection data are selected from the same document and low enough to predict that the text data included in the collection data are not selected from the same document, and calculating a product of the collection feature and the importance as an updated collection feature; and converting first text data included in the set data into second text data by the prediction model by including the updated set feature in an input sequence to the prediction model. Sentence generation method.

4. A program for causing a computer to function as each unit in the sentence generation device according to claim 1 or 2.

Citation Information

Patent Citations

  • Context analysis apparatus and computer program for the same

    JP2018041160A