Natural language processing device, translation device, and program
The natural language processing and translation devices use machine learning to estimate and control sentence numbers in translations, addressing the inefficiencies of existing technologies and enhancing translation accuracy and consistency.
Patent Information
- Application Number
- JP2021035594
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-03-05
- Publication Date
- 2025-01-31
- Estimated Expiration
- 2041-03-05
AI Technical Summary
Existing machine translation technologies struggle to control the number of sentences in the output language based on the input language, leading to inefficiencies such as Japanese sentences being translated into multiple English sentences, which is not optimal for maintaining sentence length consistency.
A natural language processing device and translation device that utilize machine learning models to estimate and control the number of sentences in the output language by incorporating sentence number information during the translation process, using techniques like neural networks and syntax analysis to adjust the translation model accordingly.
The solution effectively estimates and controls the number of sentences in the translation result, ensuring consistency and improving translation accuracy and performance by maintaining desired sentence lengths.
Smart Images

Figure 0007624851000001 
Figure 0007624851000002 
Figure 0007624851000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a natural language processing device, a translation device, and a program. [Background technology]
[0002] In recent years, the level of machine translation technology has improved to a level that is practical for some purposes. In addition, in order to make effective use of machine translation technology, research is being conducted into ways to improve it depending on the purpose.
[0003] Non-Patent Documents 1 and 2 describe devices that perform machine translation of sentences written in natural language. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] Rico Sennrich, Barry Haddow, Alexandra Birch, Neural Machine Translation of Rare Words with Subword Units, Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, p.1715-1725, August 2016, Association for Computational Linguistics, URL: https: / / www.aclweb.org / anthology / P16-1162.pdf [Non-Patent Document 2] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin, Attention Is All You Need, 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA., 2017, URL: https: / / papers.nips.cc / paper / 7181-attention-is-all-you-need.pdf Summary of the Invention [Problem to be solved by the invention]
[0005] The amount of content packed into an average sentence may vary depending on the type of language, and in certain applications of machine translation technology, it may be desirable to control the amount of content packed into a sentence.
[0006] For example, the amount of content typically contained in one English sentence is often less than that contained in one Japanese sentence. Furthermore, in news on television, radio, video streaming, Internet news sites, and the like, sentences in Japanese news scripts tend to be relatively long. On the other hand, sentences in English news scripts for the above-mentioned news tend to be relatively short. English news scripts are basically expressed as one sentence with a single meaning. Therefore, for example, when a Japanese news script is translated to produce an English news script, a Japanese sentence is often translated by dividing it into multiple short English sentences.
[0007] In this way, there are cases where it is desirable to control the number of sentences on the output side (target language side) of the translation process depending on the language or the purpose. Also, by controlling the number of sentences on the output side, it is possible to control the length of each sentence on the output side.
[0008] However, in conventional technologies, when a sentence is given on the input side (source language side) of a translation process, it is not possible to control the number of sentences on the output side (target language side). Neither Non-Patent Document 1 nor Non-Patent Document 2 describes controlling the number of sentences on the output side (target language side). When considering machine translation for a specific language pair or machine translation processing for a specific purpose, it is desirable to be able to translate one sentence on the source language side into a desired (appropriate) number of sentences on the target language side.
[0009] To achieve this, it is desirable to be able to automatically perform the following two tasks: The first task is to estimate the appropriate number of output sentences, and the second task is to control the translator so that it outputs a specific number of sentences.
[0010] The present invention has been made based on the recognition of the above problem, and aims to provide a natural language processing device, a translation device, and a program that can at least estimate the number of sentences in a target language sentence, which is the translation result, depending on a source language sentence to be translated. [Means for solving the problem]
[0011] [1] In order to solve the above problem, a natural language processing device according to one aspect of the present invention includes a training data supply unit that supplies training data including a training source sentence, a training target language sentence corresponding to the training source sentence, and training sentence number information indicating the number of sentences in the training target language sentence; an estimation unit that has a model capable of machine learning, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences in the target language sentence corresponding to the source language sentence; and a source language sentence supply unit that supplies the source language sentence to the estimation unit, wherein when operating in a training mode, the estimation unit performs machine learning of the model based on the training data supplied by the training data supply unit, and when operating in an estimation execution mode, the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit.
[0012] [2] Furthermore, a natural language processing device according to one embodiment of the present invention includes a model capable of machine learning, an estimation unit that inputs a source language sentence and outputs at least sentence count information indicating the number of sentences of a target language sentence corresponding to the source language sentence, and a source language sentence supply unit that supplies the source language sentence to the estimation unit, wherein the model has been machine-learned based on training data including a training source language sentence, a training target language sentence corresponding to the training source language sentence, and training sentence count information indicating the number of sentences of the training target language sentence, and the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit.
[0013] [3] Furthermore, a natural language processing device according to one embodiment of the present invention includes a training data supply unit that supplies training data including a training source language sentence, a training target language sentence corresponding to the training source language sentence, and training sentence number information indicating the number of sentences in the training target language sentence, and an estimation unit that has a model capable of machine learning, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences in the target language sentence corresponding to the source language sentence, and the estimation unit performs machine learning of the model based on the training data supplied by the training data supply unit.
[0014] [4] Furthermore, a translation device according to one aspect of the present invention includes a sentence pair supplying unit which supplies data of pairs of training source language sentences and training target language sentences, a sentence number estimating unit which determines the number of sentences included in the supplied training target language sentences, a sentence number information adding unit which adds information on the number of sentences determined by the sentence number estimating unit to the training source language sentences and outputs data of the training source language sentences to which the information on the number of sentences of the training target language sentences has been added, a training data supplying unit which supplies pairs of the data of the training source language sentences to which the information on the number of sentences of the training target language sentences has been added and the data of the training target language sentences as training data, and a translation processing unit that includes a model, the translation processing unit learning the model using the learning data and inputting the input source language sentence with the information of the number of sentences of the output target language sentence added to the model, thereby outputting an output target language sentence determined by the model; and a natural language processing device as described in [1] or [2] above, wherein a source language sentence supply unit of the natural language processing device supplies the input source language sentence to the estimation unit of the natural language processing device, and the number of sentences designation unit adds information on the number of sentences of the output target language sentence for output based on the number of sentences information output by the estimation unit of the natural language processing device.
[0015] [5] Furthermore, a translation device according to one aspect of the present invention comprises: a number-of-sentences designation unit that adds, to an input source sentence, information on the number of sentences of an output target language sentence for output corresponding to the input source sentence; a model, and a translation processing unit that outputs an output target language sentence determined by the model by inputting the input source sentence with the information on the number of sentences of the output target language sentence added to the model; and the natural language processing device described in [1] or [2] above, wherein the model has been trained using training data that is a pair of data of a training source language sentence to which information on the number of sentences of the training target language sentence has been added and data of a training target language sentence, and a source language sentence supply unit of the natural language processing device supplies the input source sentence to the estimation unit of the natural language processing device, and the number-of-sentences designation unit adds information on the number of sentences of the output target language sentence for output based on the number of sentences information output by the estimation unit of the natural language processing device.
[0016] [6] Another aspect of the present invention is a program for causing a computer to function as a natural language processing device according to any one of [1] to [3] above.
[0017] [7] Another aspect of the present invention is a program for causing a computer to function as the translation device described above in [4] or [5].
[0018] [Reference embodiment] In the above [4], the sentence number estimation unit may determine the number of sentences contained in the target language sentence for training by counting the number of sentence-final symbols contained in the supplied target language sentence for training.
[0019] [Reference embodiment] In the above [4], the sentence number information adding unit may add information on the number of sentences of the training target language sentence to the beginning of the training source language sentence, which is text data, and the sentence number designation unit may add information on the number of sentences of the output target language sentence to the beginning of the input source language sentence, which is text data.
[0020] [Reference embodiment] In a learning device comprising a sentence pair supplying unit that supplies paired data of a training source language sentence and a training target language sentence, a sentence number estimation unit that determines the number of sentences included in the supplied training target language sentence, a sentence number information adding unit that adds the number of sentences information determined by the sentence number estimation unit to the training source language sentence and outputs data of the training source language sentence with the number of sentences information of the training target language sentence added, a learning data supplying unit that supplies pairs of the training source language sentence data with the number of sentences information of the training target language sentence added and the training target language sentence data as training data, and a learning processing unit that trains a model using the training data, the sentence number information adding unit may add the number of sentences information based on number of sentences information estimated by the estimation unit of the natural language processing device of [1] or [2]. Effect of the Invention
[0021] According to the present invention, when a source language sentence is given, the sentence number estimation device can estimate an appropriate number of sentences in a target language sentence (translation result) that corresponds to the source language sentence.
[0022] Moreover, by specifying the number of sentences estimated by the sentence number estimation device, it is possible to control the number of sentences in the target language sentences (translation results) output by the translation device. [Brief description of the drawings]
[0023] [Figure 1] 1 is a block diagram showing a schematic functional configuration of a number-of-sentences estimation device according to a first embodiment of the present invention. [Diagram 2] 11 is a schematic diagram showing an example of the configuration of data supplied by a sentence pair supplying unit when the sentence number estimation device according to the embodiment operates in a learning mode. FIG. [Diagram 3] 11 is a schematic diagram showing an example of the configuration of data that a number-of-sentences information providing unit passes to a learning data supplying unit when the number-of-sentences estimation device according to the embodiment operates in a learning mode. FIG. [Figure 4] 13 is a schematic diagram showing an example of the structure of data that a source language sentence supply unit passes to an estimation unit when the sentence number estimation device according to the embodiment operates in an estimation execution mode. FIG. [Diagram 5] 13 is a schematic diagram showing an example of data (including information on the estimated number of sentences) output by an estimation unit when the sentence number estimation device according to the embodiment operates in an estimation execution mode. FIG. [Figure 6] FIG. 11 is a block diagram showing a schematic functional configuration of a translation device according to a second embodiment of the present invention. [Figure 7] 11 is a schematic diagram showing an example of text pair data supplied by a text pair supplying unit in the embodiment. FIG. [Figure 8] 4 is a schematic diagram showing an example of learning data (pair of sentences) that a learning data supply unit in the embodiment passes to a translation processing unit. FIG. [Figure 9] 11 is a flowchart showing the procedure of a process for generating learning data for machine learning by a translation processing unit in the embodiment. [Figure 10] 2 is a block diagram showing an example of an internal configuration of the translation device according to the embodiment. FIG. [Figure 11] 11 is a schematic diagram showing an example of a result of a translation process performed by the translation device according to the embodiment. FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0024] Next, a number of embodiments of the present invention will be described with reference to the drawings.
[0025] [First embodiment] The number-of-sentences estimation device of the first embodiment estimates number-of-sentences information that is useful when translating a sentence in a source language into a sentence in a target language. Specifically, when a source language sentence to be translated is given, this number-of-sentences estimation device estimates an appropriate number of sentences in a target language sentence (translation result) corresponding to the source language sentence. Note that this number-of-sentences estimation device includes a model capable of machine learning, as described below.
[0026] In the following description, an example is used in which the source language sentence is a Japanese sentence and the target language sentence is an English sentence. However, the source language and the target language may each be another language. The source language and the target language may each be, for example, English, German, Japanese, French, Russian, Spanish, Italian, Chinese, Korean, or another language.
[0027] FIG. 1 is a block diagram showing a schematic functional configuration of a number-of-sentences estimation device according to this embodiment. As shown in the figure, the number-of-sentences estimation device 320 includes an estimation unit 321, a source language sentence supply unit 322, a number-of-sentences information extraction unit 323, a sentence pair supply unit 326, a number-of-sentences information assignment unit 327, and a learning data supply unit 328. Each of these functional units can be realized, for example, by a computer and a program. Each functional unit also has a storage unit as needed. The storage unit is, for example, a variable in a program or a memory allocated by the execution of a program. Also, non-volatile storage units such as a magnetic hard disk drive or a solid state drive (SSD) may be used as needed. Also, at least a part of the functions of each functional unit may be realized as a dedicated electronic circuit or the like instead of a program. The functions of each unit constituting the number-of-sentences estimation device 320 will be described below.
[0028] The number of sentences estimation device 320 can operate in either a learning mode or an estimation execution mode. When operating in the learning mode, the number of sentences estimation device 320 performs machine learning of an internal model. When operating in the estimation execution mode, the translation device 1 performs a process of estimating the number of sentences of output sentences matching the input sentence, based on the model in the current state.
[0029] Note that number-of-sentences estimation device 320 has a function of learning a model as described above. Therefore, number-of-sentences estimation device 320 may be called a learning device. Furthermore, number-of-sentences estimation device 320 has a function of processing data in a natural language. Therefore, number-of-sentences estimation device 320 may be called a natural language processing device.
[0030] The estimation unit 321 outputs data of a target language sentence (translation result) based on data of an input source language sentence. However, the estimation unit 321 outputs information on an estimated value regarding an appropriate number of sentences in the translation result together with the target language sentence. The estimation unit 321 has a model capable of machine learning inside. This model is realized using, for example, a neural network. For example, a Transformer or the like can be used as this model. The estimation unit 321 has a storage means for storing internal parameters of the neural network. The values of the internal parameters are updatable.
[0031] In other words, the estimation unit 321 is equipped with a model capable of machine learning, receives a source language sentence as input, and outputs at least sentence number information indicating the number of target language sentences corresponding to the source language sentence.
[0032] When the sentence number estimation device 320 operates in the learning mode, the estimation unit 321 uses a large amount of learning data passed from the learning data supply unit 328 to learn an internal model. That is, the estimation unit 321 adjusts the values of the internal parameters of the model based on the learning data. The learning data is a pair of a source language sentence and a target language sentence (translation result). However, information on the number of output sentences is added to the data of the target language sentence in this pair. The information on the number of output sentences is, for example, tag information added to the beginning of the target language sentence. That is, the estimation unit 321 is trained by machine learning to output information on the appropriate number of output sentences corresponding to the input source language sentence. In other words, the estimation unit 321 adjusts the values of the internal parameters in this way by machine learning. The learning data used by the estimation unit 321 for learning will be described later with reference to FIG. 3.
[0033] That is, in the learning mode, the estimation unit 321 performs machine learning of the model based on the learning data supplied by the learning data supply unit 328.
[0034] When the sentence number estimation device 320 operates in the estimation execution mode, the estimation unit 321 performs a process of estimating an appropriate number of sentences of a target language sentence corresponding to a source language sentence, based on the internal parameters of the trained model. Specifically, the estimation unit 321 outputs information on the number of sentences of the corresponding target language sentence (translation result) based on the data of the source language sentence passed from the source language sentence supply unit 322. The estimation unit 321 passes the output data to the sentence number information extraction unit 323. The estimation unit 321 may pass information on the output number of sentences corresponding to the input source language sentence and information on the target language sentence, which is the translation result, together to the sentence number information extraction unit 323. The configuration of the data that the estimation unit 321 receives from the source language sentence supply unit 322 will be described later with reference to FIG. 4. The configuration of the data that the estimation unit 321 passes to the sentence number information extraction unit 323 will be described later with reference to FIG. 5.
[0035] That is, in the estimation execution mode, the estimation unit 321 outputs, based on a source language sentence supplied by the source language sentence supply unit 322, sentence count information corresponding to the source language sentence.
[0036] When the sentence number estimation device 320 operates in the estimation execution mode, the source language sentence supplying unit 322 supplies data of the source language sentence to be translated to the estimation unit 321. This source language sentence data is data of one sentence expressed as a string of words. The configuration of the data supplied by the source language sentence supplying unit 322 will be described later with reference to FIG. 4.
[0037] When the number of sentences estimation device 320 operates in the estimation execution mode, the number of sentences information extraction unit 323 extracts only the number of sentences information of the target language sentence (translation result) from the data output by the estimation unit 321. The number of sentences information extraction unit 323 outputs the obtained number of sentences information (numerical value) to the outside. The data on the number of sentences extracted by the number of sentences information extraction unit 323 can be used, for example, to control the number of output sentences during translation processing (see the second embodiment).
[0038] The sentence pair supplying unit 326 supplies pairs of source language sentences and target language sentences when the sentence number estimation device 320 operates in the learning mode. Here, the target language sentence corresponds to the translation result of the source language sentence. In other words, this sentence pair is a bilingual sentence pair. The sentence pair supplying unit 326 can supply a large number of sentence pairs for learning by the estimation unit 321. An example of the configuration of data supplied by the sentence pair supplying unit 326 will be described later with reference to FIG. 2.
[0039] The sentence number information adding unit 327 adds information on the number of sentences of the object language sentence to the data supplied by the sentence pair supplying unit 326. The sentence number information adding unit 327 counts the number of sentences included in the object sentence data in the sentence pair passed from the sentence pair supplying unit 326. The sentence number information adding unit 327 adds numerical information, which is the result of the count, to the sentence pair data as a tag. Specifically, the sentence number information adding unit 327 adds a tag indicating the sentence number to, for example, the beginning of the object sentence. The sentence number information adding unit 327 passes the sentence pair data after the sentence number information has been added to the learning data supplying unit 328 so that it may be used for learning by the estimation unit 321.
[0040] The sentence count information adding unit 327 counts the number of sentences, for example, by counting sentence separators in the target language sentence data. In the case of English sentences, sentence separators are characters such as periods, question marks, and exclamation marks. The sentence count information adding unit 327 may obtain the number of sentences included in the target language sentence data by other methods. As an example, the sentence count information adding unit 327 may identify each sentence included in the target language sentence data and determine the number of sentences by performing a syntax analysis process on the target language sentence.
[0041] The sentence number information adding unit 327 may add a tag indicating the number of sentences to the data based on a manually counted number of sentences.
[0042] An example of the structure of the data that the sentence number information adding unit 327 passes to the learning data supplying unit 328 will be described later with reference to FIG.
[0043] The learning data supplying unit 328 supplies the data received from the sentence number information adding unit 327 to the estimation unit 321 as learning data. The learning data supplying unit 328 passes both the source language sentence data and the target language sentence data to which the sentence number information has been added to the estimation unit 321. The source language sentence data is used as input data to a model (such as a neural network) held by the estimation unit 321. The target language sentence data to which the sentence number information has been added is passed to the estimation unit 321 to calculate an error (loss) for executing, for example, an error backpropagation method. Note that the technique itself of performing machine learning of a model using an error backpropagation method or the like belongs to existing technology.
[0044] In other words, the training data supplying unit 328 supplies training data including training source language sentences, training target language sentences corresponding to the training source language sentences, and training sentence number information indicating the number of sentences in the training target language sentences.
[0045] The processing by the sentence number estimation device 320 having the above-described units will be further described below.
[0046] First, source language sentence data (Japanese text) and target language sentence data (English text) are prepared. Here, the target language sentence data (English text) is obtained by manually translating each sentence of the source language sentence data (Japanese text). All source language sentence data (Japanese text) and target language sentence data (English text) are associated with each other. Note that one sentence in the source language sentence data (Japanese text) may correspond to multiple sentences in the target language sentence data (English text).
[0047] The above data is provided by the sentence pair providing unit 326 .
[0048] The sentence number information adding unit 327 estimates how many sentences the target language sentence data (English text) contains. In other words, the sentence number information adding unit 327 estimates (counts) the number of sentences in the English text that corresponds to one sentence in the source language sentence data (Japanese text). The sentence number information adding unit 327 counts, for example, the number of periods (sentence separators) contained in the target language sentence data (English text). However, periods are also used in English to express abbreviations such as "Mr." In order to avoid erroneous estimation of the number of sentences due to such examples, the sentence number information adding unit 327 may divide the English sentence using a method such as byte-pair-encoding and count the number of sentences divided by a single period.
[0049] The sentence number information adding unit 327 adds a tag indicating the sentence number, which is the estimation result, to the beginning of the target language sentence data (English text) of each sentence pair. The sentence number information adding unit 327 outputs the data with this tag as learning data for the estimation unit 321.
[0050] The estimation unit 321 performs machine learning of the model using the above-mentioned learning data by operating in the learning mode. Information on the trained model is stored in the internal storage means of the estimation unit 321.
[0051] In this manner, the sentence number estimation device 320 becomes able to estimate the number of appropriate target language sentences corresponding to the input source language sentences.
[0052] Next, data processed by the number-of-sentences estimation device 320 will be described with reference to FIGS.
[0053] FIG. 2 is a schematic diagram showing an example of the configuration of data supplied by the sentence pair supplying unit 326 when the sentence number estimation device 320 operates in a learning mode. As shown in the figure, the data supplied by the sentence pair supplying unit 326 is data of a pair of a source language sentence (Japanese sentence) and a target language sentence (English sentence). This pair of a source language sentence and a target language sentence is a bilingual sentence pair. In this example, the source language sentence (Japanese sentence) is "Hiroshima prefecture has developed new oysters for eating raw so that tourists can enjoy oysters, a specialty of Hiroshima, which boasts the highest production volume in the country, even in the summer. Officials held a tasting event on July 16, inviting people concerned." Also, the target language sentence (English sentence) is "Hiroshima is the number one producer of oysters in the country. The prefecture has newly developed oysters for eating raw so that tourists can enjoy oysters, a specialty of Hiroshima, also in summer. Officials held a tasting event on July 16, inviting people concerned."
[0054] When the data of FIG. 2 is received from the sentence pair supplying unit 326, the sentence number information adding unit 327 adds information on the number of object sentences in the sentence pair data.
[0055] 3 is a schematic diagram showing an example of the structure of data that the sentence number information adding unit 327 passes to the learning data supplying unit 328 when the sentence number estimation device 320 operates in the learning mode. As shown in the figure, the data output by the sentence number information adding unit 327 has information on the number of sentences of the target language sentence in the sentence pair added thereto. Specifically, this data includes the following at the beginning of the target language sentence: <3> This "3" represents the number of sentences contained in the target sentence "Hiroshima is the number one... (omitted)".
[0056] The data shown in Fig. 3 is supplied to the estimation unit 321 by the learning data supply unit 328 when the model held by the estimation unit 321 is trained. In other words, the model held by the estimation unit 321 performs machine learning using a bilingual sentence pair with information on the number of sentences added to the beginning of the target language sentence. In other words, information on the number of sentences in the target language sentence, together with information on the target language sentence itself, affects the adjustment of the internal parameters of the model. In other words, when the model held by the estimation unit 321 is configured using a neural network, the number of sentences in the target language sentence ("3" in the case of the data in Fig. 3) affects the update of the values of the internal parameters of the neural network when the backpropagation method is used.
[0057] FIG. 4 is a schematic diagram showing an example of the configuration of data that the source language sentence supply unit 322 passes to the estimation unit 321 when the sentence number estimation device 320 operates in the estimation execution mode. As shown in the figure, this data is data on the source language sentence to be translated. The data shown in FIG. 4 itself does not have information on the number of sentences in the target language sentence that is the translation result. In this example, the source language sentence is the same as the source language sentence in FIG. 2, "Oysters, a specialty of Hiroshima, boasting the highest production volume in the country... (omitted below)." However, the sentence that the source language sentence supply unit 322 passes to the estimation unit 321 may be any sentence written in the source language (here, Japanese).
[0058] 5 is a schematic diagram showing an example of data output by the estimation unit 321 when the sentence number estimation device 320 operates in the estimation execution mode. The data in FIG. 5 is an example of data output by the estimation unit 321 when the data in FIG. 4 is input. As shown in the figure, the data in FIG. 5 includes sentences in the target language (English in this case) that are the translation results, and has a tag of numerical information added to the beginning of the sentence. In this example, the tag is <3> This tag represents a number that indicates the estimated number of sentences in the target language sentence. The number of sentences information is generated by a trained model based on a large amount of training data.
[0059] When the estimation unit 321 outputs the data of Fig. 5, the sentence number information extraction unit 323 extracts sentence number information from this data. <3> Based on this tag, the sentence number "3" is extracted. The sentence number information extraction unit 323 externally extracts the extracted sentence number information (for example, 3).
[0060] As described above, the sentence number estimation device 320 of this embodiment can estimate an appropriate number of sentences in a target language sentence (a translation result of the source language sentence) according to an input source language sentence. Furthermore, by using information on the estimated number of sentences, the translation device 1 of the second embodiment described next can output a translation result of that number of sentences (or a number of sentences close to that number).
[0061] As a modified example of the first embodiment, the number of sentences estimation device 320 may estimate the number of output sentences of a target language sentence corresponding to a source language sentence using a trained model. In this case, the number of sentences estimation device 320 does not need a function for training the model. In another modified example, the number of sentences estimation device 320 may only train the model. The model trained in this way can be transferred to another device. In this case, it is sufficient for the number of sentences estimation device 320 to have only a function for training the model, and a function for actually estimating the number of output sentences is not required.
[0062] It is possible to realize the number-of-sentences estimation device 320 using a computer and a program. A specific method for realizing the number-of-sentences estimation device 320 using a computer and a program will be described in the following second embodiment. The number-of-sentences estimation device 320 of this embodiment is a device equivalent to the number-of-sentences estimation unit 32 in the second embodiment.
[0063] [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.
[0064] This embodiment relates to a translation device that performs translation processing of a sentence written in a natural language. The sentence on the input side of the translation processing is written in a source language. The sentence on the output side of the translation processing is written in a target language. The source language and the target language are, for example, English, German, Japanese, French, Russian, Spanish, Italian, Chinese, Korean, or other languages. Basically, the type of source language and the type of target language in the translation processing are different. However, the type of source language and the type of target language may be the same.
[0065] FIG. 6 is a block diagram showing a schematic functional configuration of the translation device according to the present embodiment. As shown in the figure, the translation device 1 includes a source language sentence input unit 21, a sentence number designation unit 22, a translation processing unit 23, a translation result output unit 24, a sentence pair supply unit 31, a sentence number estimation unit 32, a sentence number information assignment unit 33, and a learning data supply unit 34. Each of these functional units can be realized, for example, by a computer and a program. Each functional unit also has a storage unit as necessary. The storage unit is, for example, a variable in the program or a memory allocated by the execution of the program. Also, non-volatile storage units such as a magnetic hard disk device or a solid state drive (SSD) may be used as necessary. Also, at least a part of the functions of each functional unit may be realized as a dedicated electronic circuit or the like instead of a program.
[0066] Translation device 1 can operate in either a learning mode or a translation execution mode. When operating in the learning mode, translation device 1 performs machine learning of an internal model. When operating in the translation execution mode, translation device 1 performs a translation process of a natural language based on the model in the current state.
[0067] As described above, translation apparatus 1 has a function of learning a model. Therefore, translation apparatus 1 may be called a learning apparatus. Translation apparatus 1 also has a function of processing data in a natural language. Therefore, translation apparatus 1 may be called a natural language processing apparatus.
[0068] The serial connection of source language sentence input unit 21, number of sentences designation unit 22, translation processing unit 23, and translation result output unit 24 corresponds to the process flow when translation device 1 operates in the translation execution mode. Below, the functions of each of source language sentence input unit 21, number of sentences designation unit 22, translation processing unit 23, and translation result output unit 24 will be described in relation to the operation in the translation execution mode.
[0069] The source language sentence input unit 21 acquires a source language sentence to be translated, and passes it to the sentence number designation unit 22. The source language sentence input unit 21 acquires the source language sentence, for example, from an external source, or reads it from a storage unit accessible to the translation device 1. The source language sentence exists, for example, as text data within the translation device 1. The source language sentence input here is called an input source language sentence. Also, the target language sentence for output (translation result) corresponding to this input source language sentence is called an output target language sentence.
[0070] The sentence number designation unit 22 designates the number of sentences of the target language sentence in the result of translating the source language sentence received from the source language sentence input unit 21. The sentence number designation unit 22 designates the number of sentences of the target language sentence based on, for example, a numerical value acquired from an external source or a numerical value read from a predetermined storage unit in the translation device 1. The sentence number designation unit 22 adds information on the number of sentences of the target language sentence to the source language sentence. The sentence number designation unit 22 passes the source language sentence with the information on the number of sentences of the target language sentence added to the translation processing unit 23. An example of a specific method by which the sentence number designation unit 22 adds the information on the number of sentences of the target language sentence to the source language sentence will be described later. In other words, the sentence number designation unit 22 adds information on the number of sentences of the output target language sentence for output corresponding to the input source language sentence to the input source language sentence and passes the result to the translation processing unit 23.
[0071] As exemplified later, the sentence number designation unit 22 may add information on the number of sentences of the output target language sentence to the beginning of the input source language sentence, which is text data. In this case, information on the number of sentences of the target language sentence is also added to the beginning of the source language sentence in the learning data. By adding information on the number of sentences to the beginning of the source language sentence, the information on the number of sentences is always added to a fixed position even if the text of the source language sentence is of variable length. This is advantageous when performing machine learning based on information on the number of sentences.
[0072] The translation processing unit 23 performs a translation process based on the input source language sentence, and outputs a target language sentence. The translation processing unit 23 has an internal model for translation. This model can be trained using training data. The model is realized, for example, by using a neural network. More specifically, the model may be realized by using an RNN (Recurrent Neural Network), a Transformer, or the like. However, the specific configuration for realizing the model is not limited to the example shown here. Note that the technologies themselves, such as the neural network, RNN, and Transformer, listed here, are existing technologies that can be used. If the internal model of the translation processing unit 23 has been properly trained, the translation processing unit 23 is expected to generate and output a target language sentence (which may be a plurality of sentences) that is a translation of the input source language sentence. Also, if the internal model of the translation processing unit 23 has been properly trained, the translation processing unit 23 is expected to generate and output the number of target language sentences specified by the sentence number designation unit 22 (or at least a number close to the specified number). That is, the translation processing unit 23 is provided with a model, learns the model using learning data, and outputs the output target language sentence determined by the model by inputting an input source language sentence to which information on the number of sentences in the output target language sentence has been added. The translation processing unit 23 learns the model as described above, and may be called a "learning processing unit".
[0073] The operation of the translation processing unit 23 in the learning mode and in the translation execution mode is as follows.
[0074] In the learning mode, the translation processing unit 23 performs a learning process of the model based on the learning data provided by the learning data supply unit 34. The learning data is a set of pairs of input data and output data to the model. In this embodiment, the input data to the model is text data of the source language sentence to which the number of sentences (estimated value) of the target language sentence, which is the output data, is added. The output data included in the learning data is text data of the correct answer of the target language sentence. The model realized by the neural network performs calculations at each node of the network based on this input data to obtain output data. The output data obtained by the model corresponds to the target language sentence. The translation processing unit 23 calculates the difference (loss) between the output data (estimated data) calculated by the model based on the input data and the output data in the learning data. Then, the translation processing unit 23 updates the internal parameters of the model by the backpropagation method based on the calculated difference. The update of the internal parameters of the neural network by the backpropagation method can be performed by existing technology. The translation processing unit 23 writes the updated internal parameter values of the model in a storage unit (not shown) as appropriate. The translation processing unit 23 repeats such processing for each of the many sentence pairs included in the learning data, thereby learning the model.
[0075] When the translation processing unit 23 operates in the translation execution mode, it is assumed that at least a predetermined amount of learning processing has been completed. In the translation execution mode, the translation processing unit 23 receives input data passed from the sentence number designation unit 22. This input data includes text data of the source language sentence and data designating the number of sentences (for example, a numerical value expressed as a tag). The translation processing unit 23 performs calculations within the model based on the input data, and obtains output data from the model. Note that the translation processing unit 23 may read parameters (values of a learned parameter set) within the model from a storage unit (not shown) or the like as necessary. The output data obtained by the translation processing unit 23 is expected to be the text of the target language sentence as the translation result. The translation processing unit 23 passes the output data (target language sentence) to the translation result output unit 24.
[0076] The translation result output unit 24 outputs the target language sentence output from the translation processing unit 23 to the outside. The translation result output unit 24 outputs the target language sentence as the translation result, for example, by transmitting it to an external device, displaying it on a display device, recording it on a recording medium (such as a hard disk or semiconductor memory), etc. The translation result output unit 24 may also output the target language sentence in other forms.
[0077] The functional group consisting of the sentence pair supplying unit 31, the number of sentences estimating unit 32, the number of sentences information adding unit 33, and the learning data supplying unit 34 is a functional group for generating learning data to be used in the learning mode of the translation device 1 and supplying it to the model in the translation processing unit 23. Below, the functions of each of the sentence pair supplying unit 31, the number of sentences estimating unit 32, the number of sentences information adding unit 33, and the learning data supplying unit 34 will be described in relation to the operation of generating learning data.
[0078] The sentence pair supplying unit 31 supplies pairs (sentence pairs) of source language sentences and target language sentences. The source language sentences here are called training language sentences. Also, the target language sentences here are called training target language sentences. In other words, the sentence pair supplying unit 31 supplies data of pairs of training source language sentences and training target language sentences. The sentence pair supplying unit 31 processes sentence pairs acquired from the outside or read from a storage unit (not shown) in the translation device 1, for example, pair by pair, and passes them to the sentence number estimation unit 32, the sentence number information attachment unit 33, and the training data supplying unit 34. Specifically, the sentence pair supplying unit 31 passes the source language sentences in the sentence pair to the sentence number information attachment unit 33. Also, the sentence pair supplying unit 31 passes the target language sentences in the sentence pair to the sentence number estimation unit 32 and the training data supplying unit 34.
[0079] The sentence pairs provided by the sentence pair providing unit 31 are pairs of source and target language sentences having the same meaning. In other words, the result of translating the source language sentence in a sentence pair is the target language sentence. Basically, in most cases, the result of translating the target language sentence in a sentence pair can be the source language sentence. The source language sentence in a sentence pair may be one or more sentences. The target language sentence in a sentence pair may be one or more sentences. Such sentence pairs can be obtained based on an existing language corpus. Alternatively, the source language sentence may be manually translated to obtain a target language sentence, and the two may be used as a sentence pair.
[0080] When constructing a sentence pair, the pair of source language and target language is assumed to match the model to be learned. The type of source language and the type of target language are arbitrary as long as they match the model for translation (the internal model of the translation processing unit 23). As an example, to have the translation device 1 perform Japanese-English translation processing, the source language is Japanese and the target language is English.
[0081] The sentence number estimation unit 32 estimates and outputs the number of sentences included in the target language sentences supplied from the sentence pair supply unit 31. That is, the sentence number estimation unit 32 obtains the number of sentences included in the learning target language sentence in a certain sentence pair. The sentence number estimation unit 32 estimates the number of sentences using a method according to the type of target language. For example, for Western languages (English, French, German, etc.), the sentence number estimation unit 32 estimates the number of sentences by counting the number of periods and question marks based on the characteristic that a sentence ends with a period or a question mark. However, periods and question marks may appear other than at the end of a sentence. For example, an expression such as "Mr." in English (an abbreviation of "mister") includes a period, but the period in this example does not indicate that it is the end of a sentence. For this reason, the sentence number estimation unit 32 may use other methods to improve the estimation accuracy.
[0082] For example, the sentence number estimation unit 32 divides a target language sentence (e.g., an English sentence) using a byte pair encoding (BPE) technique. The byte pair encoding technique itself is an existing technology. For example, the sentence number estimation unit 32 estimates the number of sentences by counting the number of periods when a single period is divided by byte pair encoding.
[0083] Also, for example, the sentence number estimation unit 32 may estimate the number of sentences by performing a syntactic analysis process on the target language sentence. For example, when the target language is English, one sentence in the target language sentence has a basic structure such as SV, SVO, SVC, SVOC, etc. Here, S is a subject, V is a predicate, O is an object, and C is a complement. The sentence number estimation unit 32 counts up the number of sentences based on such a syntactic analysis result, and the result is the estimated number of sentences. In each language other than English, the estimation of the number of sentences by the syntactic analysis process is basically effective. Note that, in order to further improve the estimation accuracy, the sentence number estimation unit 32 may estimate the number of sentences based on both the result of the syntactic analysis and the number of periods and question marks.
[0084] Also, for example, the number of sentences estimation unit 32 may take a numerical value given from outside in association with the target language sentence as the estimated result of the number of sentences. For example, the number of sentences may be input for each target language sentence by a person's judgment, and the number of sentences estimation unit 32 may take that numerical value as the estimated result of the number of sentences. Alternatively, the number of sentences estimation unit 32 may read out a numerical value stored in a storage unit (not shown) or the like in association with the target language sentence, and take it as the estimated result of the number of sentences.
[0085] For example, the aforementioned periods and question marks in English are symbols that indicate the end of a sentence. Symbols that indicate the end of a sentence like this are called sentence-final symbols. For example, in Japanese, full stops and periods are sentence-final symbols. Also, in other languages, the sentence number estimation unit 32 may find the number of sentences based on sentence-final symbols. In other words, the sentence number estimation unit 32 may find the number of sentences included in the training target language sentences by counting the number of sentence-final symbols included in the training target language sentences supplied.
[0086] The number of sentences information adding unit 33 receives the source language sentence from the sentence pair supplying unit 31, and also receives the number of sentences of the target language sentence (the above estimated value) from the number of sentences estimating unit 32. The number of sentences information adding unit 33 adds the number of sentences information received from the number of sentences estimating unit 32 to the data of the source language sentence received from the sentence pair supplying unit 31, and outputs the data. In other words, the number of sentences information adding unit 33 adds the number of sentences information determined by the number of sentences estimating unit 32 to the training source language sentence, and outputs the data of the training source language sentence to which the information on the number of sentences of the training target language sentence has been added. The number of sentences information adding unit 33 passes the data of the source language sentence to which the information on the number of sentences of the target language sentence (estimated value) has been added, to the training data supplying unit 34. One example of a method in which the number of sentences information adding unit 33 adds the information on the number of sentences is to add a tag indicating the number of sentences of the target language sentence to the text of the source language sentence. The sentence number information adding unit 33 may add information about the number of sentences of the target language sentence for training to the beginning of the source language sentence for training, which is text data. The position where the sentence number information adding unit 33 adds the sentence number information should match that of the sentence number designation unit 22. The advantages of adding sentence number information to the beginning of a source language sentence have already been explained.
[0087] An example of data of source language sentences to which information on the number of target language sentences (estimated value) has been added will be described later with reference to another figure.
[0088] The learning data supplying unit 34 passes the target language sentence data passed from the sentence pair supplying unit 31 and the source language sentence data passed from the sentence number information adding unit 33 (with an estimated value for the number of sentences of the target language sentence) as a pair to the translation processing unit 23. This pair can be used as learning data for the model held by the translation processing unit 23. In other words, the learning data supplying unit 34 supplies, as learning data, a pair of training source language sentence data to which information on the number of sentences of the training target language sentence has been added, and training target language sentence data.
[0089] The sentence pair supplying unit 31 may supply a large number of sentence pairs. In response to each of the sentence pairs supplied by the sentence pair supplying unit 31, the learning data supplying unit 34 passes a pair of a source language sentence (with an estimated value of the number of sentences) and a target language sentence to the translation processing unit 23. Using each of these pairs, machine learning processing of a model inside the translation processing unit 23 can be performed. The number of sentence pairs supplied by the learning data supplying unit 34 as learning data is arbitrary. The learning data supplying unit 34 may supply a large number of sentence pairs. The number of sentence pairs supplied as learning data may reach, for example, hundreds of thousands of pairs or millions of pairs.
[0090] Next, the method of constructing the learning data will be described.
[0091] FIG. 7 is a schematic diagram showing an example of data of a sentence pair supplied by the sentence pair supply unit 31. In the illustrated sentence pair, the source language sentence is a Japanese sentence, and the target language sentence is an English sentence. The source language sentence is text data of "Hiroshima prefecture has developed new oysters for eating raw so that tourists can enjoy oysters, a specialty of Hiroshima, also in summer, which boasts the highest production volume in the country, and held a tasting event on July 16th, inviting people concerned." The target language sentence corresponding to this source language sentence is text data including three sentences, "Hiroshima is the number one producer of oysters in the country.", "The prefecture has newly developed oysters for eating raw so that tourists can enjoy oysters, a specialty of Hiroshima, also in summer.", and "Officials held a tasting event on July 16th, inviting people concerned."
[0092] FIG. 8 is a schematic diagram showing an example of learning data (sentence pair) that the learning data supply unit 34 passes to the translation processing unit 23. The data shown in FIG. 8 is created based on the data shown in FIG. 7. The data shown in FIG. 8 differs from the data shown in FIG. 7 in that the data shown in FIG. 8 includes the following at the beginning of the text on the source language sentence side: <3> This tag corresponds to the number of sentences on the target language side being 3. In other words, this tag is a tag that indicates the number of sentences on the target language side. As described above, the fact that the number of sentences on the target language side is 3 is based on the estimation result by the sentence number estimation unit 32. In addition, according to the estimation result, <3> The tag was added to the source language sentence data by the sentence number information adding unit 33. In other words, in the data shown in FIG. 8, the source language sentence data is <3> Hiroshima prefecture has developed a new type of oyster to be eaten raw, so that tourists can enjoy oysters, a specialty of Hiroshima, which boasts the highest production volume in the country, in the summer as well, and held a tasting event for related parties on the 16th. The target language sentence data shown in Figure 8 is the same text data as that in Figure 7.
[0093] By performing machine learning using learning data such as that shown in FIG. 8, the translation model in the translation processing unit 23 not only learns the correspondence between the source language sentences themselves and the target language sentences, but also learns the correspondence between the number "3" (the estimated number of sentences) and the target language sentences.
[0094] 9 is a flowchart showing the procedure of a process for generating learning data for machine learning by translation processing unit 23 of translation device 1. This flowchart shows the procedure for generating a pair of input and output data. The process of this flowchart can be repeatedly executed for each pair of input and output data. The operation procedure will be described below with reference to this flowchart.
[0095] First, in step S11, the sentence pair supplying unit 31 obtains a language pair consisting of a source language sentence and a target language sentence, and supplies it to the translation device 1. As described above, the sentence pair supplying unit 31 supplies the source language sentence included in the sentence pair to the sentence number information adding unit 33. In addition, the sentence pair supplying unit 31 supplies the target language sentence included in the sentence pair to the sentence number estimation unit 32 and the learning data supplying unit 34.
[0096] Next, in step S12, the sentence number estimation unit 32 estimates the number of sentences included in the target language sentence passed from the sentence pair supply unit 31 in step S11. An example of the estimation method specifically used by the sentence number estimation unit 32 has already been described. The sentence number estimation unit 32 notifies the sentence number information attachment unit 33 of the estimated number of sentences.
[0097] Next, in step S13, the sentence number information adding unit 33 adds information on the number of sentences of the target language sentence estimated in step S12 to the source language sentence passed from the sentence pair supplying unit 31 in step S11. As a specific example, the sentence number information adding unit 33 adds a tag indicating the number of sentences of the target language sentence to the data of the source language sentence. An example of the data of the source language sentence to which the estimated value of the number of sentences of the witness language sentence has been added has already been explained (see FIG. 8).
[0098] Next, in step S14, the sentence number information adding unit 33 passes the data of the source language sentence to which the estimated value of the number of sentences of the witnessed language sentence has been added, to the learning data supplying unit 34. The learning data supplying unit 34 sets the data of the source language sentence to which the estimated value of the number of sentences of the witnessed language sentence has been added, as input data of the learning data.
[0099] Next, in step S15, the learning data supplying unit 34 sets the data of the target language sentence passed from the sentence pair supplying unit 31 in step S11 as data on the output side of the learning data.
[0100] Next, in step S16, the learning data supplying unit 34 outputs a pair of the input data (data of the source language sentence to which the estimated value of the number of target language sentences has been added) and the output data (data of the target language sentence). This pair of data is used for learning processing in the translation processing unit 23.
[0101] FIG. 10 is a block diagram showing an example of the internal configuration of the translation device 1. The translation device 1 can be realized using a computer. As shown in the figure, the computer includes a central processing unit 901, a RAM 902, an input / output port 903, input / output devices 904 and 905, and a bus 906. The computer itself can be realized using existing technology. The central processing unit 901 executes instructions included in a program read from the RAM 902 or the like. The central processing unit 901 writes data to the RAM 902, reads data from the RAM 902, and performs arithmetic and logical operations according to each instruction. The RAM 902 stores data and programs. Each element included in the RAM 902 has an address and can be accessed using the address. The 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 or the like. The input / output devices 904 and 905 are input / output devices. Input / output devices 904 and 905 exchange data with the central processing unit 901 via an input / output port 903. A 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 a RAM 902 via the bus 906. Also, for example, the central processing unit 901 accesses the input / output port via the bus 906.
[0102] At least some of the functions of the translation device 1 (learning device) can be realized by a computer. 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 a computer system and executed to realize the functions. The term "computer system" as used herein includes hardware such as an OS and peripheral devices. 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 computer systems. The term "computer-readable recording medium" may also include those that temporarily and dynamically hold 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 those that hold a program for a certain period of time, such as a volatile memory inside a computer system that is a server or client in such a case. The above program may be for realizing some of the functions described above, or may be capable of realizing the functions described above in combination with a program already recorded in the computer system.
[0103] Although the embodiment has been described above, the following modified examples may be implemented. Note that multiple modified examples may be implemented in combination to the extent that they can be combined.
[0104] [First Modification] In the second embodiment, the translation device 1 can operate in both the learning mode and the translation execution mode. In the first modified example, the translation device 1 does not operate in the learning mode, but operates only in the translation execution mode. In this case, the translation model in the translation processing unit 23 has already completed machine learning processing based on the learning data. Alternatively, the translation model may be configured to import the learned internal parameter values of the translation model from outside. The translation device 1 of the first modified example includes at least the source language sentence input unit 21, the sentence number designation unit 22, the translation processing unit 23, and the translation result output unit 24, among the functional configurations shown in FIG. 6. In addition, the translation device 1 may be configured not to include some or all of the sentence pair supply unit 31, the sentence number estimation unit 32, the sentence number information assignment unit 33, and the learning data supply unit 34. It is expected that the translation device 1 of the first modified example performs processing to output a target language sentence consisting of a specified number of sentences using a learned model.
[0105] The translation device 1 of the first variant as described above comprises a sentence number designation unit 22 which adds, to an input source language sentence, information on the number of sentences of an output target language sentence for output corresponding to the input source language sentence, and a translation processing unit 23 which has a model and outputs an output target language sentence determined by the model by inputting the input source language sentence with the information on the number of sentences of the output target language sentence added to the model, and the model has been trained using training data which is a pair of data of a training source language sentence to which information on the number of sentences of the training target language sentence has been added, and data of a training target language sentence.
[0106] [Second modified example] In the second embodiment, the translation device 1 can operate in both the learning mode and the translation execution mode. In the second modified example, the translation device 1 does not operate in the translation execution mode, but operates only in the learning mode. That is, the translation device 1 of the second modified example performs only the learning process, and may be called a "learning device". In this case, the translation model in the translation processing unit 23 updates internal parameters by the learning process. The learned model can be exported to, for example, an external device. In this case, if the translation device 1 and the external device have the same network structure in advance, only a set of values of internal parameters of the learned model may be exported. This allows the external device to perform translation processing based on the results of learning by the translation device 1 (learning device) of the second modified example. It is expected that the external device performs translation processing to output a target language sentence consisting of a specified number of sentences. The translation device 1 (learning device) of the second modified example includes at least all of the sentence pair supply unit 31, the sentence number estimation unit 32, the sentence number information assignment unit 33, the learning data supply unit 34, and the translation processing unit 23 among the functional configurations shown in FIG. 6. Moreover, the translation device 1 (learning device) may be configured without some or all of the source language sentence input unit 21, the sentence number designation unit 22, and the translation result output unit .
[0107] The translation device 1 of the second modified example as described above comprises a sentence pair supplying unit 31 which supplies paired data of training source language sentences and training target language sentences, a sentence number estimation unit 32 which determines the number of sentences included in the supplied training target language sentences, a sentence number information adding unit 33 which adds the information on the number of sentences determined by the sentence number estimation unit to the training source language sentences and outputs data of the training source language sentences with the information on the number of sentences of the training target language sentences added, a training data supplying unit 34 which supplies pairs of the data of the training source language sentences with the information on the number of sentences of the training target language sentences added and the data of the training target language sentences as training data, and a translation processing unit 23 (learning processing unit) which uses the training data to train a model.
[0108] [Third Modification] In the above-described second embodiment, the learning data is generated using information on the number of sentences estimated by the number-of-sentences estimation unit 32. In the third modified example, definite information on the number of sentences may be provided to the number-of-sentences estimation unit 32 instead of an estimated value. In that case, the number-of-sentences estimation unit 32 uses the provided number of sentences as an estimated value. The learning data supply unit 34 of the third modified example provides the learning data created in this way to the translation processing unit 23. The translation processing unit 23 performs model learning processing using the learning data created in this way.
[0109] [Fourth Modification] In the above-mentioned second embodiment, the sentence number information adding unit 33 added the estimated sentence number information to the beginning of the source language sentence as data in the form of a tag enclosed in square brackets <>. In the fourth embodiment, the form of the added sentence number information is not limited to this. The sentence number information adding unit 33 in the fourth modified example adds the sentence number information to the source language sentence in a form other than the above-mentioned tag. In addition, the position where the sentence number information adding unit 33 in the fourth modified example adds the sentence number information is not limited to the beginning of the source language sentence, and may be another position. In either case, the sentence number information adding unit 33 passes data including the text information of the source language sentence and information corresponding to the numerical value of the sentence number to the learning data supplying unit 34 as input data to the learning model. The translation processing unit 23 performs a learning process for the model using the learning data created in this way.
[0110] The above describes in detail an embodiment of the present invention (including modified examples) with reference to the drawings. However, the specific configuration is not limited to this embodiment, and also includes designs that do not deviate from the gist of the present invention.
[0111] [Example and evaluation of a translation device that controls the number of sentences (second embodiment)] In the following, an example of implementing the translation device 1 of the above embodiment and the evaluation results thereof will be described.
[0112] FIG. 11 is a schematic diagram showing an example of a result of a translation process performed using the translation device 1. In this example, the source language is Japanese and the target language is English. The figure shows an input sentence in Japanese and five types of output sentences in English. The number of sentences in the input sentence is 1. The target language sentence A is a comparison target and is a result of manual translation. The number of sentences in the translation result of A is 3. The output sentence B is a translation result when 1 is specified as the number of sentences in the target language sentence in the translation device 1. The number of sentences in the translation result of B is 1, as specified. The output sentence C is a translation result when 2 is specified as the number of sentences in the target language sentence. The number of sentences in the translation result of C is 2, as specified. The output sentence D is a translation result when 3 is specified as the number of sentences in the target language sentence. The number of sentences in the translation result of D is 3, as specified. The output sentence E is a comparison target and is a result of a machine translation process performed without specifying the number of sentences in the target language sentence. The number of sentences in the translation result of E is 2. On the other hand, when the number of output sentences was specified as 1, 2, or 3 in the translation device 1 of this embodiment, the results obtained were the exact number of sentences specified.
[0113] It was found from the experiment that if the number of output sentences is not specified, the number of output sentences will be less than desired (the length of each sentence tends to be long). In other words, it is useful to be able to specify the number of output sentences in the translation device 1 of this embodiment.
[0114] The effectiveness of the translation device 1 of this embodiment was quantitatively evaluated by the following method. Specifically, translation results were compared between the case where information specifying the number of output sentences (number of sentences in the target language sentence) was added (this embodiment) and the case where information was not added (comparison target). In both cases, about 100,000 sentence pairs of manual English translations (target language sentences) corresponding to each sentence in Japanese (source language sentence) were used as learning data. Furthermore, the development data and evaluation data were similar datasets, with 3,000 sentence pairs and 5,001 sentence pairs, respectively.
[0115] (1) When output sentence number information was added, a sentence number tag was added to the source language sentence data, and a translation model (network) trained by the translation processing unit 23 of this embodiment was used. During translation in this case, the sentence number estimation unit 32 of this embodiment estimated the sentence number based on the English text data corresponding to the Japanese text data for evaluation. Then, a tag indicating the sentence number of the estimated result was added to the beginning of the sentence of the Japanese text data for evaluation, and the translation process was executed.
[0116] (2) When output sentence number information was not added, a sentence number tag was not added to the source language sentence data, and the translation model (network) trained by the translation processing unit 23 of this embodiment was used. During translation, the translation process was also performed without adding a sentence number tag to the source language sentence data.
[0117] The experimental results for both cases are as follows. The evaluation values used were the match rate between the number of output sentences and the number of sentences in the original evaluation English sentences (target language sentences), and the translation performance based on the BLEU value. The evaluation results are as follows:
[0118] With output sentence count information: Sentence count match rate: 96.6% Without output sentence count information: Sentence count match rate: 60.4%
[0119] With output sentence count information: BLEU 19.14 Without output sentence count information: BLEU 18.38
[0120] As described above, when the number of output sentences was not specified, the matching rate of the number of sentences was 60.4%, whereas when the number of output sentences was specified, the matching rate of the number of sentences was 96.6%. In other words, it was confirmed that the translation device 1 of this embodiment can output the specified number of target language sentences as the translation result with a very high probability.
[0121] Also, as described above, the BLEU value was 18.38 when the number of output sentences was not specified, whereas the BLEU value was 19.14 when the number of output sentences was specified and translation was performed. In other words, it was confirmed that even when the number of output sentences was specified and translation processing was performed as in the translation device 1 of the present embodiment, the translation accuracy at least did not deteriorate compared to the case where the number of output sentences was not specified. Also, as described above, the BLEU value when the number of output sentences was specified and translation was performed was 0.76 higher than when the number of output sentences was not specified. Whether this difference is significant or not requires further verification in the future, but one possibility is that the designation of the number of output sentences acted to make the pattern of the output sentences closer to the pattern of the target language sentences in the original dataset.
[0122] As described above, according to this embodiment, translation processing is possible that outputs a specified number of sentences without degrading translation performance. In other words, this embodiment makes it possible to control the number of output sentences without degrading translation performance. Since a neural network was used to verify this embodiment, the reason why such an advantage is obtained was not necessarily explicitly stated. However, it is possible that the model controlled the translation result so that the number of periods matched, or that the model controlled the syntactic structure at a deeper level so that the specified number of sentences was obtained.
[0123] [Implementation and evaluation of a sentence number estimation device] An example was evaluated when the source language was Japanese and the target language was English. Specifically, the following two methods were compared, and the matching rate of the number of output sentences with the evaluation English sentences and the translation performance were compared. As training data for learning the model, bilingual data of about 96,000 sentence pairs of Japanese sentences and their corresponding English translations by hand were used. In addition, from the same bilingual data, 5,001 sentence pairs of development data were used. As evaluation data, multi-reference data of 773 sentences in which one Japanese sentence was translated by two translators each were used.
[0124] The first method is a method using output sentence number estimation. The number of output sentences corresponding to the Japanese sentence for evaluation was estimated using a sentence number estimation device 320 (first embodiment) trained with the above-mentioned training data. A tag with the estimated number of sentences was added, and translation was performed by a translation device 1 (second embodiment). The translation model of the translation device 1 has also been trained with similar training data.
[0125] The second method does not use output sentence number estimation. Translation is performed using the same translation model as in the first method, without using output sentence number estimation.
[0126] The experimental results are as follows. The number of output sentences in each of the first and second methods was evaluated based on the degree of agreement with the English text used for evaluation. The degree of agreement was calculated by considering the number of English sentences in the translation results of either of the two translators as a match. First method (with estimation of the number of output sentences, this embodiment): 87.0% Second method (no estimation of output sentences, for comparison): 81.8%
[0127] As described above, it has been found that an appropriate number of output sentences can be estimated by using the number-of-sentences estimation device 320 of the first embodiment. It has also been found that an appropriate number of sentences can be output as a translation result by using the translation device 1 of the second embodiment.
[0128] Although several embodiments and modified examples of the present invention have been described in detail above with reference to the drawings, the specific configurations are not limited to these embodiments, and designs that do not deviate from the gist of the present invention are also included. [Industrial Applicability]
[0129] The present invention can be used, for example, in industries that use natural language translation processing. As an example, the present invention can be used in the business of automatically translating news and other written content in the news or content provision industry. However, the scope of use of the present invention is not limited to the examples given here. [Explanation of symbols]
[0130] 1 Translation device (learning device, natural language processing device) 21 Source language input section 22 Number of sentences specification section 23 Translation processing section (learning processing section) 24 Translation result output section 31 Text Supply Department 32 Sentence count estimation part 33 Sentence number information assignment section 34 Learning Data Supply Unit 320 Sentence number estimation device (learning device, natural language processing device) 321 Estimation Department 322 Source language sentence supply section 323 Sentence count information extraction part 326 Text Supply Department 327 Sentence Number Information Addition Unit 328 Learning Data Supply Department 901 Central Processing Unit 902 RAM 903 Input / Output Ports 904,905 Input / Output Devices 906 Bus
Claims
1. a sentence pair providing unit for providing data pairs of source language sentences for training and target language sentences for training; a sentence number estimation unit for determining the number of sentences contained in the supplied target language sentence for training; a sentence number information adding unit that adds the information on the number of sentences determined by the sentence number estimation unit to the training source language sentence, and outputs data of the training source language sentence to which the information on the number of sentences of the training target language sentence has been added; a training data supplying unit that supplies, as training data, pairs of data on the training source language sentences to which information on the number of sentences in the training target language sentences has been added and data on the training target language sentences; a sentence number specification unit for adding information on the number of sentences of an output target language sentence for output corresponding to an input source language sentence inputted; a translation processing unit including a model, learning the model using the learning data, and inputting the input source sentence to which information on the number of sentences in the output target language sentence has been added into the model, thereby outputting an output target language sentence determined by the model; A natural language processing device; Equipped with The natural language processing device comprises: a training data supplying unit that supplies training data including training source sentences, training target language sentences corresponding to the training source sentences, and training sentence number information indicating the number of sentences in the training target language sentences; an estimation unit that is equipped with a machine learning model, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences of a target language sentence corresponding to the source language sentence; a source language sentence supply unit that supplies the source language sentence to the estimation unit; Equipped with When operating in a learning mode, the estimation unit performs machine learning of the model based on the learning data supplied by the learning data supply unit; When operating in an estimation execution mode, the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit. It is something like a source language sentence supply unit of the natural language processing apparatus supplies the input source language sentence to the estimation unit of the natural language processing apparatus; the sentence number designation unit adds information on the number of sentences of the output target language sentence for output based on the sentence number information output by the estimation unit of the natural language processing device. Translation device.
2. a sentence pair providing unit for providing data pairs of source language sentences for training and target language sentences for training; a sentence number estimation unit for determining the number of sentences contained in the supplied target language sentence for training; a sentence number information adding unit that adds the information on the number of sentences determined by the sentence number estimation unit to the training source language sentence, and outputs data of the training source language sentence to which the information on the number of sentences of the training target language sentence has been added; a training data supplying unit that supplies, as training data, pairs of data on the training source language sentences to which information on the number of sentences in the training target language sentences has been added and data on the training target language sentences; a sentence number specification unit for adding information on the number of sentences of an output target language sentence for output corresponding to an input source language sentence inputted; a translation processing unit including a model, learning the model using the learning data, and inputting the input source sentence to which information on the number of sentences in the output target language sentence has been added into the model, thereby outputting an output target language sentence determined by the model; A natural language processing device; Equipped with The natural language processing device comprises: an estimation unit that is equipped with a machine learning model, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences of a target language sentence corresponding to the source language sentence; a source language sentence supply unit that supplies the source language sentence to the estimation unit; Equipped with the model has been machine-trained based on training data including training source language sentences, training target language sentences corresponding to the training source language sentences, and training sentence number information indicating the number of sentences in the training target language sentences; the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit. It is something like a source language sentence supply unit of the natural language processing apparatus supplies the input source language sentence to the estimation unit of the natural language processing apparatus; the sentence number designation unit adds information on the number of sentences of the output target language sentence for output based on the sentence number information output by the estimation unit of the natural language processing device. Translation device.
3. a sentence number specification unit for adding information on the number of sentences of an output target language sentence for output corresponding to an input source language sentence inputted; a translation processing unit including a model, the input source sentence having information on the number of sentences of the output target language sentence added thereto being input to the model, and outputting an output target language sentence determined by the model; A natural language processing device; Equipped with The natural language processing device comprises: a training data supplying unit that supplies training data including training source sentences, training target language sentences corresponding to the training source sentences, and training sentence number information indicating the number of sentences in the training target language sentences; an estimation unit that is equipped with a machine learning model, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences of a target language sentence corresponding to the source language sentence; a source language sentence supply unit that supplies the source language sentence to the estimation unit; Equipped with When operating in a learning mode, the estimation unit performs machine learning of the model based on the learning data supplied by the learning data supply unit; When operating in an estimation execution mode, the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit. It is something that the model has been trained using training data that is a pair of data of training source language sentences to which information on the number of sentences in the training target language sentences has been added, and data of the training target language sentences; a source language sentence supply unit of the natural language processing apparatus supplies the input source language sentence to the estimation unit of the natural language processing apparatus; the sentence number designation unit adds information on the number of sentences of the output target language sentence for output based on the sentence number information output by the estimation unit of the natural language processing device. Translation device.
4. a sentence number specification unit for adding information on the number of sentences of an output target language sentence for output corresponding to an input source language sentence inputted; a translation processing unit including a model, the input source sentence having information on the number of sentences of the output target language sentence added thereto being input to the model, and outputting an output target language sentence determined by the model; A natural language processing device; Equipped with The natural language processing device comprises: an estimation unit that is equipped with a machine learning model, inputs a source language sentence, and outputs at least sentence number information indicating the number of sentences of a target language sentence corresponding to the source language sentence; a source language sentence supply unit that supplies the source language sentence to the estimation unit; Equipped with the model has been machine-trained based on training data including training source language sentences, training target language sentences corresponding to the training source language sentences, and training sentence number information indicating the number of sentences in the training target language sentences; the estimation unit outputs the sentence number information corresponding to the source language sentence based on the source language sentence supplied by the source language sentence supply unit. It is something like the model has been trained using training data that is a pair of data of training source language sentences to which information on the number of sentences in the training target language sentences has been added, and data of the training target language sentences; a source language sentence supply unit of the natural language processing apparatus supplies the input source language sentence to the estimation unit of the natural language processing apparatus; the sentence number designation unit adds information on the number of sentences of the output target language sentence for output based on the sentence number information output by the estimation unit of the natural language processing device. Translation device.
5. A program for causing a computer to function as the translation device according to any one of claims 1 to 4.
Citation Information
Patent Citations
Translation processing method and device
CN109344413A
Example database creation device, example database creation program, translation device and translation program
JP2008233955A
Model learning device, conversion device, method, and program
JP2019036093A
Segmentation model generation system, text segmentation device and segmentation model generation method
JP2020166501A