JP7624851B2 - Natural language processing device, translation device, and program - Google Patents
Natural language processing device, translation device, and program Download PDFInfo
- Publication number
- JP7624851B2 JP7624851B2 JP2021035594A JP2021035594A JP7624851B2 JP 7624851 B2 JP7624851 B2 JP 7624851B2 JP 2021035594 A JP2021035594 A JP 2021035594A JP 2021035594 A JP2021035594 A JP 2021035594A JP 7624851 B2 JP7624851 B2 JP 7624851B2
- Authority
- JP
- Japan
- Prior art keywords
- sentence
- sentences
- training
- unit
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Machine Translation (AREA)
Description
特許法第30条第2項適用 (1) 発行日(公開日) 令和2年(西暦2020年)5月22日 刊行物 2020年度 人工知能学会全国大会(第34回)予稿集PDF 一般社団法人 人工知能学会 発行(Web公開(ダウンロード)URL:https://confit.atlas.jp/guide/event/jsai2020/proceedings/list) <資 料> 2020年度 人工知能学会全国大会(第34回)予稿集PDF 掲載論文 抜粋 <資料> 予稿集PDFダウンロードサイト ウェブページ Article 30, paragraph 2 of the Patent Act applies (1) Date of issue (publication date) May 22, 2020 (Reiwa 2) Publication Proceedings of the 34th Annual Conference of the Japanese Society for Artificial Intelligence (PDF) Published by the Japanese Society for Artificial Intelligence (Website publication (download) URL: https://confit.atlas.jp/guide/event/jsai2020/proceedings/list) <Materials> Proceedings of the 34th Annual Conference of the Japanese Society for Artificial Intelligence (PDF) Published papers Excerpts <Materials> Proceedings PDF download site Webpage
特許法第30条第2項適用 (2) 開催日(公開日) 令和2年(西暦2020年)6月12日(会期:6月9日~6月12日) 集会名、開催場所 2020年度 人工知能学会全国大会(第34回) 一般社団法人 人工知能学会 主催 インターネットによる通信(Zoom)を用いたオンライン開催(Web公開(抄録)URL:https://confit.atlas.jp/guide/event/jsai2020/subject/4Rin1-44/category?cryptoId= <資 料> 2020年度 人工知能学会全国大会(第34回)開催案内 ウェブページ <資 料> 2020年度 人工知能学会全国大会(第34回)重要日程 ウェブページ <資 料> 2020年度 人工知能学会全国大会(第34回)タイムテーブル ウェブページ <資 料> 2020年度 人工知能学会全国大会(第34回)セッション情報 ウェブページ <資 料> 2020年度 人工知能学会全国大会(第34回)講演情報(抄録) ウェブページArticle 30, paragraph 2 of the Patent Act applies (2) Date of event (publication date) June 12, 2020 (Dates: June 9 to June 12) Name of event, location of event 2020 National Conference of the Japanese Society for Artificial Intelligence (34th) Sponsored by the Japanese Society for Artificial Intelligence (General Incorporated Association) Held online using internet communication (Zoom) (Web publication (abstract) URL: https://confit.atlas.jp/guide/event/jsai2020/subject/4Rin1-44/categories?cryptoId= <Materials> 2020 National Conference of the Japanese Society for Artificial Intelligence (34th) Event Guide Webpage <Materials> 2020 National Conference of the Japanese Society for Artificial Intelligence (34th) Important Dates Webpage <Materials> <Materials> 2020 Japanese Society for Artificial Intelligence National Conference (34th) Timetable Webpage <Materials> 2020 Japanese Society for Artificial Intelligence National Conference (34th) Session Information Webpage <Materials> 2020 Japanese Society for Artificial Intelligence National Conference (34th) Lecture Information (Abstracts) Webpage
本発明は、自然言語処理装置、翻訳装置、およびプログラムに関する。 The present invention relates to a natural language processing device, a translation device, and a program.
近年の機械翻訳の技術のレベルは、用途によっては実用に耐え得る程度にまで向上してきている。また、機械翻訳の技術を有効に活用するため、用途に応じた工夫なども研究されている。 In recent years, the level of machine translation technology has improved to a level that is practical for some applications. In addition, in order to make effective use of machine translation technology, research is being conducted into ways to improve it depending on the application.
非特許文献1および非特許文献2には、自然言語によって記述された文の機械翻訳を行う装置が記載されている。 Non-Patent Documents 1 and 2 describe devices that perform machine translation of sentences written in natural language.
平均的な一文の中に込められる内容の量は、言語の種類に応じて異なる場合がある。また、機械翻訳の技術の特定の応用分野では、一文の中に込める内容の量を適切に制御したい場合もある。 The amount of content packed into an average sentence may vary depending on the type of language. Also, in certain applications of machine translation technology, it may be desirable to have appropriate control over the amount of content packed into a sentence.
例えば、英語の一文に通常含まれる内容の量は、日本語の一文のそれよりも少ない場合が多い。また、テレビや、ラジオや、動画配信や、インターネットのニュースサイト等におけるニュースにおいて、日本語のニュース原稿の一文は相対的に長い傾向がある。一方、上記のようなニュースにおいて英語のニュース原稿の一文は相対的に短い傾向がある。英語のニュース原稿は、基本的に一文一義で表現される。したがって、例えば、日本語のニュース原稿を基に、翻訳して英語のニュース原稿を制作する場合には、日本語の一文が英語の複数文に短く区切って翻訳されることが多い。 For example, the amount of content typically contained in a single English sentence is often less than that contained in a single 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 types of news tend to be relatively short. English news scripts are basically written with one meaning per sentence. Therefore, for example, when translating a Japanese news script to produce an English news script, a single Japanese sentence is often translated into several short English sentences.
このように、言語によって、あるいは用途によって、翻訳処理の出力側(目的言語側)の文の数を制御したい場合がある。また、出力側の文の数を制御することにより、出力側の一文の長さを制御することも可能である。 In this way, it may be necessary to control the number of sentences on the output side (target language side) of the translation process depending on the language or application. 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.
しかしながら、従来の技術において、翻訳処理の入力側(原言語側)の文を与えた際に、出力側(目的言語側)の文の数を制御することはできない。非特許文献1や非特許文献2にも、出力側(目的言語側)の文の数の制御については記載されていない。特定の言語ペアにおける機械翻訳や、特定の利用目的のための機械翻訳の処理を考えたときに、原言語側の一文を目的言語側の所望の(適切な)文数の文に翻訳できるようになることが望ましい。 However, in conventional technology, when a sentence is given on the input side (source language side) of the 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 a sentence on the source language side into the desired (appropriate) number of sentences on the target language side.
そのためには、次の2つのタスクを自動的に実行できるようにすることが望まれる。第1のタスクは、適切な出力文数を推定することである。第2のタスクは、特定の出力文数になるように翻訳機を制御することである。 To achieve this, it is desirable to be able to automatically perform the following two tasks. The first task is to estimate an appropriate number of output sentences. The second task is to control the translator so that a specific number of output sentences is achieved.
本発明は、上記の課題認識に基づいて行なわれたものであり、翻訳対象とする原言語文に応じて、翻訳結果である目的言語文の文数を少なくとも推定することのできる自然言語処理装置、翻訳装置、およびプログラムを提供しようとするものである。 The present invention was 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 the source language sentence to be translated.
[1]上記の課題を解決するため、本発明の一態様による自然言語処理装置は、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データを供給する学習用データ供給部と、機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、前記推定部に対して前記原言語文を供給する原言語文供給部と、を備え、学習モードで動作する場合には、前記推定部は、前記学習用データ供給部が供給する前記学習用データに基づいて、前記モデルの機械学習を行い、推定実行モードで動作する場合には、前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、ものである。 [1] In order to solve the above problem, a natural language processing apparatus according to one aspect of the present invention includes a learning data supply unit that supplies learning data including a learning source sentence, a learning target sentence corresponding to the learning source sentence, and learning sentence number information indicating the number of sentences in the learning target sentence; an estimation unit that has a machine learning model and inputs a source sentence and outputs at least sentence number information indicating the number of sentences in the target sentence corresponding to the source sentence; and a source sentence supply unit that supplies the source sentence to the estimation unit. 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, and when operating in an estimation execution mode, the estimation unit outputs the sentence number information corresponding to the source sentence based on the source sentence supplied by the source sentence supply unit.
[2]また、本発明の一態様による自然言語処理装置は、機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、前記推定部に対して前記原言語文を供給する原言語文供給部と、を備え、前記モデルは、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データに基づいて機械学習済みであり、前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、ものである。 [2] In addition, a natural language processing device according to one aspect 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 number 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, the model has been machine-learned based on learning 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 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.
[3]また、本発明の一態様による自然言語処理装置は、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データを供給する学習用データ供給部と、機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、を備え、前記推定部は、前記学習用データ供給部が供給する前記学習用データに基づいて、前記モデルの機械学習を行う、ものである。 [3] 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 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 machine learning model, 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.
[4]また、本発明の一態様による翻訳装置は、学習用原言語文と学習用目的言語文との対のデータを供給する文対供給部と、供給された前記学習用目的言語文に含まれる文数を求める文数推定部と、前記学習用原言語文に、前記文数推定部が求めた前記文数の情報を付加して、前記学習用目的言語文の文数の情報が付加された前記学習用原言語文のデータを出力する文数情報付与部と、前記学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、前記学習用目的言語文のデータとの対を、学習用データとして供給する学習用データ供給部と、入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加する文数指定部と、モデルを備え、前記学習用データを用いて前記モデルの学習を行うとともに、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、上記[1]または[2]に記載の自然言語処理装置と、を備え、前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、ものである。 [4] A translation device according to one aspect of the present invention includes a sentence pair supplying unit that supplies data of a pair of a training source language sentence and a training target language sentence, a sentence number estimating unit that determines the number of sentences included in the supplied training target language sentence, a sentence number information adding unit that adds information on the number of sentences determined by the sentence number estimating 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 pairs of 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 and data of the training target language sentence as training data, and an output object for output corresponding to the input source language sentence, which is input to the input source language sentence. a translation processing unit that includes a model, the model being trained using the training data, and the input source language sentence to which the information on the number of sentences of the output target language sentence has been added is input to the model, thereby outputting the output target language sentence determined by the model; and a natural language processing device according to [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.
[5]また、本発明の一態様による翻訳装置は、入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加する文数指定部と、モデルを備え、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、上記[1]または[2]に記載の自然言語処理装置と、を備え、前記モデルは、学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、学習用目的言語文のデータと、の対である学習用データを用いて学習済みであり、前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、ものである。 [5] A translation device according to one aspect of the present invention includes a sentence number 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 to which the information on the number of sentences of the output target language sentence has been added, into 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 on a training source language sentence to which information on the number of sentences of the training target language sentence has been added and data on a training target language sentence, and 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 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.
[6]また、本発明の一態様は、上記[1]から[3]までのいずれかに記載の自然言語処理装置、としてコンピューターを機能させるためのプログラムである。 [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.
[7]また、本発明の一態様は、上記[4]または[5]の翻訳装置、としてコンピューターを機能させるためのプログラムである。 [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].
[参考態様]上記[4]において、前記文数推定部は、供給された前記学習用目的言語文に含まれる文末記号の数をカウントすることによって、前記学習用目的言語文に含まれる文数を求める、ものであってもよい。 [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.
[参考態様]上記[4]において、前記文数情報付与部は、テキストデータである前記学習用原言語文の先頭部分に、前記学習用目的言語文の文数の情報を付加し、前記文数指定部は、テキストデータである前記入力原言語文の先頭部分に、前記出力目的言語文の文数の情報を付加する、ものであってもよい。 [Reference aspect] In the above [4], the sentence number information adding unit may add information on 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, 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.
[参考態様]学習用原言語文と学習用目的言語文との対のデータを供給する文対供給部と、供給された前記学習用目的言語文に含まれる文数を求める文数推定部と、前記学習用原言語文に、前記文数推定部が求めた前記文数の情報を付加して、前記学習用目的言語文の文数の情報が付加された前記学習用原言語文のデータを出力する文数情報付与部と、前記学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、前記学習用目的言語文のデータとの対を、学習用データとして供給する学習用データ供給部と、前記学習用データを用いてモデルの学習を行う学習処理部と、を備える学習装置において、文数情報付与部は、[1]や[2]の自然言語処理装置の推定部が推定した文数情報に基づいて、前記文数の情報を付加してもよい。 [Reference embodiment] In a learning device including a sentence pair supplying unit that supplies data of pairs of a training source language sentence and a training target language sentence, a sentence number estimating unit that determines the number of sentences included in the supplied training target language sentence, a sentence number information adding unit that adds the information on the number of sentences determined by the sentence number estimating 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 pairs of 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 and data of the training target language sentence as training data, and a learning processing unit that uses the training data to train a model, the sentence number information adding unit may add the information on the number of sentences based on the sentence number information estimated by the estimation unit of the natural language processing device of [1] or [2].
本発明によれば、原言語文を与えたときに、文数推定装置が、その原言語文に対応する目的言語文(翻訳結果)の適切な文数を推定することができる。 According to the present invention, when a source language sentence is given, the sentence number estimation device can estimate the appropriate number of sentences in the target language sentence (translation result) that corresponds to the source language sentence.
また、文数推定装置が推定した文数を指定することによって、翻訳装置が出力する目的言語文(翻訳結果)の文数を制御することができる。 In addition, 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.
次に、本発明の複数の実施形態について、図面を参照しながら説明する。 Next, several embodiments of the present invention will be described with reference to the drawings.
[第1実施形態]
第1実施形態の文数推定装置は、原言語(source language)の文を目的言語(target language)の文に翻訳する際に有用な、文数情報を推定するものである。具体的には、この文数推定装置は、翻訳対象である原言語文が与えられたときに、その原言語文に対応する目的言語文(翻訳結果)の適正な文数を推定するものである。なお、この文数推定装置は、下で説明するように、機械学習可能なモデルを備える。
[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.
なお、以下の説明では、原言語文が日本語の文であり、目的言語文が英語の文である場合の例を用いる。ただし、原言語および目的言語のそれぞれが他の言語であってもよい。原言語および目的言語のそれぞれは、例えば、英語、ドイツ語、日本語、フランス語、ロシア語、スペイン語、イタリア語、中国語、韓国語、あるいはその他の言語であってよい。 In the following explanation, 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.
図1は、本実施形態による文数推定装置の概略機能構成を示すブロック図である。図示するように、文数推定装置320は、推定部321と、原言語文供給部322と、文数情報抽出部323と、文対供給部326と、文数情報付与部327と、学習用データ供給部328とを含んで構成される。これらの各機能部は、例えば、コンピューターと、プログラムとで実現することが可能である。また、各機能部は、必要に応じて、記憶手段を有する。記憶手段は、例えば、プログラム上の変数や、プログラムの実行によりアロケーションされるメモリーである。また、必要に応じて、磁気ハードディスク装置やソリッドステートドライブ(SSD)といった不揮発性の記憶手段を用いるようにしてもよい。また、各機能部の少なくとも一部の機能を、プログラムではなく専用の電子回路等として実現してもよい。文数推定装置320を構成する各部の機能については、下で説明する。
1 is a block diagram showing a schematic functional configuration of a sentence number estimation device according to this embodiment. As shown in the figure, the sentence
なお、文数推定装置320は、学習モードと、推定実行モードとの、いずれかのモードで動作することができる。学習モードで動作する場合には、文数推定装置320は、内部のモデルの機械学習を行う。推定実行モードで動作する場合には、翻訳装置1は、そのときの状態のモデルに基づいて、入力文に合った出力文の文数を推定する処理を行う。
The number of
なお、文数推定装置320は、上記の通りモデルの学習を行う機能を持つ。よって、文数推定装置320を学習装置と呼んでもよい。また、文数推定装置320は、自然言語のデータを処理する機能を持つ。よって、文数推定装置320を自然言語処理装置と呼んでもよい。
Note that the number of
推定部321は、入力される原言語文のデータに基づいて、目的言語文(翻訳結果)のデータを出力する。ただし、推定部321は、目的言語文とともに、翻訳結果の適正な文数についての推定値の情報を出力する。推定部321は、機械学習可能なモデルを内部に備える。このモデルは、例えば、ニューラルネットワークを用いて実現される。このモデルとしては、例えば、Transformerなどを使用することができる。推定部321は、ニューラルネットワークの内部パラメーターを記憶する記憶手段を持つ。内部パラメーターの値は更新可能である。
The
つまり、推定部321は、機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力するものである。
In other words, the
文数推定装置320が学習モードで稼働する場合には、推定部321は、学習用データ供給部328から渡される大量の学習用データを用いて、内部のモデルの学習を行う。つまり、推定部321は、学習用データに基づいて、モデルの内部パラメーターの値を調整する。学習用データは、原言語文と目的言語文(翻訳結果)との対である。ただし、この対における目的言語文のデータには、出力文数の情報が付加されている。出力文数の情報は、例えば、目的言語文の先頭に付加されたタグ情報である。つまり、推定部321は、機械学習により、入力される原言語文に対応する、適切な出力文数の情報を出力するように訓練される。言い換えれば、推定部321は、機械学習により、そのように内部パラメーターの値を調整する。推定部321が学習のために用いる学習用データについては、後で図3を参照しながら説明する。
When the sentence
つまり、学習モードにおいて、推定部321は、学習用データ供給部328が供給する学習用データに基づいて、モデルの機械学習を行う。
In other words, in the learning mode, the
文数推定装置320が推定実行モードで稼働する場合には、推定部321は、学習済みのモデルの内部パラメーターに基づいて、原言語文に対応する目的言語文の適切な文数を推定する処理を行う。具体的には、推定部321は、原言語文供給部322から渡される原言語文のデータに基づいて、対応する目的言語文(翻訳結果)の文数の情報を出力する。推定部321は、出力するデータを、文数情報抽出部323に渡す。なお、推定部321は、入力される原言語文に対応する、出力文数の情報と、翻訳結果である目的言語文との情報とを、あわせて文数情報抽出部323に渡すようにしてよい。推定部321が原言語文供給部322から受け取るデータの構成については、後で図4を参照しながら説明する。また、推定部321が文数情報抽出部323に渡すデータの構成については、後で図5を参照しながら説明する。
When the sentence
つまり、推定実行モードにおいて、推定部321は、原言語文供給部322が供給する原言語文に基づいて、当該原言語文に対応する文数情報を出力する。
In other words, in the estimation execution mode, the
原言語文供給部322は、文数推定装置320が推定実行モードで動作する場合において、翻訳処理の対象である原言語文のデータを、推定部321に供給する。この原言語文のデータは、語の列として表わされる、1個の文のデータである。原言語文供給部322が供給するデータの構成については、後で図4を参照しながら説明する。
When the sentence
文数情報抽出部323は、文数推定装置320が推定実行モードで動作する場合において、推定部321が出力するデータから、目的言語文(翻訳結果)の文数情報のみを抽出する。文数情報抽出部323は、得られた文数情報(数値)を、外部に出力する。文数情報抽出部323が抽出した文数のデータは、例えば、翻訳処理の際の出力文数を制御するために使用可能である(第2実施形態を参照)。
When the number of
文対供給部326は、文数推定装置320が学習モードで動作する場合において、原言語文と目的言語文との対を供給する。ここで、目的言語文は、原言語文の翻訳結果に相当する。つまり、この文対は、対訳文対である。文対供給部326は、推定部321の学習のために、大量の文対を供給することができる。文対供給部326が供給するデータの構成例については、後で図2を参照しながら説明する。
When the sentence
文数情報付与部327は、文対供給部326が供給するデータに、目的言語文の文数の情報を付加する。文数情報付与部327は、文対供給部326から渡される文対における、目的語文データに含まれる文の数をカウントする。文数情報付与部327は、カウントした結果である数値の情報を、タグとして、文対データに付加する。具体的には、文数情報付与部327は、例えば、目的語文の先頭部分に、この文数を表すタグを付加する。文数情報付与部327は、文数の情報を付加した後の文対データを、推定部321の学習に用いられるように、学習用データ供給部328に渡す。
The sentence number
文数情報付与部327は、例えば、目的言語文データにおける文の区切りをカウントすることによって、文数のカウントを行う。文の区切りは、英語文の場合には、例えば、ピリオドや、疑問符や、感嘆符などの文字である。文数情報付与部327は、他の方法によって目的言語文データに含まれる文の数を求めてもよい。一例として、文数情報付与部327は、目的言語文の構文解析処理を行うことによって、目的言語文データに含まれる各文を特定し、文数を決定してよい。
The sentence count
なお、文数情報付与部327は、人手でカウントした文数に基づいて、その文数を表すタグをデータに付加するものであってもよい。
The sentence count
文数情報付与部327が学習用データ供給部328に渡すデータの構成例については、後で図3を参照しながら説明する。
An example of the structure of the data that the sentence number
学習用データ供給部328は、文数情報付与部327から受け取ったデータを、学習用データとして、推定部321に供給する。学習用データ供給部328は、原言語文データと、文数情報が付加された目的言語文データとのそれぞれを、推定部321に渡す。原言語文データは、推定部321が持つモデル(ニューラルネットワーク等)への入力データとして使用される。文数情報が付加された目的言語文データは、例えば誤差逆伝播法を実行するための誤差(loss)を算出するために、推定部321に渡される。なお、誤差逆伝播法等を用いてモデルの機械学習を行う手法自体は、既存技術に属するものである。
The learning
つまり、学習用データ供給部328は、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データを供給するものである。
In other words, the learning
上で説明した各部を備える文数推定装置320による処理について、さらに以下で説明する。
The processing performed by the sentence
まず、原言語文データ(日本語テキスト)と目的言語文データ(英語テキスト)とを用意する。ここで、目的言語文データ(英語テキスト)は、原言語文データ(日本語テキスト)の各文を人手で翻訳したものである。すべての原言語文データ(日本語テキスト)と目的言語文データ(英語テキスト)とは、相互に対応付けられている。なお、原言語文データ(日本語テキスト)の1文が、目的言語文データ(英語テキスト)における複数文に対応付く場合もある。 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 a manual translation of each sentence in 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).
上記のデータを文対供給部326が供給する。
The above data is provided by the text
文数情報付与部327は、目的言語文データ(英語テキスト)が、いくつの文を含むかを推定する。言い換えれば、文数情報付与部327は、原言語文データ(日本語テキスト)の1文が対応する英語テキストの文数を推定(カウント)する。文数情報付与部327は、例えば、目的言語文データ(英語テキスト)が含むピリオド(文の区切り)の数を数える。ただし、英語では「Mr.」といった省略形を表現する場合等にもピリオドが使用される。こういった例による文数の誤推定を避けるため、文数情報付与部327は、byte-pair-encodingなどの方法で英文を分割し、ピリオド単体で分割されたものの数を数えるようにしてもよい。
The sentence count
文数情報付与部327は、各文対の目的言語文データ(英語テキスト)の先頭に、推定結果である文数を表すタグを付与する。文数情報付与部327は、このタグが付いたデータを、推定部321の学習用のデータとして出力する。
The sentence count
推定部321は、学習モードでの動作により、上記の学習用データを用いて、モデルの機械学習を行う。学習済みのモデルの情報は、推定部321の内部の記憶手段に保存される。
The
上記のようにして、文数推定装置320は、入力される原言語文に対応する適切な目的言語文の数を推定することができるようになる。
In this manner, the sentence
次に、図2、図3、図4、図5を参照しながら、文数推定装置320が処理するデータについて説明する。
Next, we will explain the data processed by the sentence
図2は、文数推定装置320が学習モードで動作する場合に、文対供給部326が供給するデータの構成例を示す概略図である。図示するように、文対供給部326が供給するデータは、原言語文(日本語文)と目的言語文(英語文)の対のデータである。この原言語文と目的言語文の対は、対訳文対である。本例では、原言語文(日本語文)は「全国一の生産量を誇る広島特産のカキを夏にも観光客らに楽しんでもらおうと、広島県は新たに生食用のカキを開発し、16日、関係者を集めて試食会を開きました。」である。また、目的言語文(英語文)は、「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.」である。
FIG. 2 is a schematic diagram showing an example of the configuration of data supplied by the sentence
文対供給部326から図2のデータを受け取った場合、文数情報付与部327は、その文対データにおける目的語文の文数の情報を付加する。
When the data in FIG. 2 is received from the sentence
図3は、文数推定装置320が学習モードで動作する場合に、文数情報付与部327が学習用データ供給部328に渡すデータの構成例を示す概略図である。図示するように、文数情報付与部327が出力するデータには、当該文対における目的言語文の文数の情報が付加されている。具体的には、このデータは、目的言語文の先頭の部分に<3>というタグ情報を持っている。この「3」は、目的言語文「Hiroshima is the number one・・・(以下省略)」に含まれる文の数を表す。
Figure 3 is a schematic diagram showing an example of the configuration of data that the sentence number
図3に示すデータは、推定部321が持つモデルの学習を行う際に、学習用データ供給部328が推定部321に対して供給するものである。つまり、推定部321が持つモデルは、目的言語文の先頭に文数の情報が付加された状態での対訳文対による機械学習を行う。つまり、目的言語文自体の情報とともに、目的言語文の文数の情報が、そのモデルが持つ内部パラメーターの調整に作用を及ぼす。言い換えれば、推定部321が持つモデルがニューラルネットワークを用いて構成される場合には、目的言語文の文数(図3のデータの場合には「3」)が、誤差逆伝播法を用いたときに、そのニューラルネットワークの内部パラメーターの値の更新に影響する。
The data shown in FIG. 3 is supplied to the
図4は、文数推定装置320が推定実行モードで動作する場合に、原言語文供給部322が推定部321に渡すデータの構成例を示す概略図である。図示するように、このデータは、翻訳対象である原言語文のデータである。図4に示すデータ自体は、翻訳結果である目的言語文の文数に関する情報を持たない。本例では、原言語文は、図2における原言語文の「全国一の生産量を誇る広島特産のカキを・・・(以下省略)」と同一である。ただし、原言語文供給部322が推定部321に渡す文は、原言語(ここでは、日本語)で記述された任意の文であってよい。
Figure 4 is a schematic diagram showing an example of the configuration of data that the source language
図5は、文数推定装置320が推定実行モードで動作する場合に、推定部321が出力するデータの例を示す概略図である。図5のデータは、図4のデータが入力された場合に推定部321が出力するデータの例である。図示するように、図5のデータは、翻訳結果である目的言語(ここでは、英語)の文を含むとともに、その先頭に数値情報のタグを付加したものである。本例では、そのタグは<3>である。このタグは、目的言語文の文数の推定結果を表す数値を表す。文数の情報は、多数の学習用データに基づいて学習済みのモデルが生成したものである。
Figure 5 is a schematic diagram showing an example of data output by the
推定部321が図5のデータを出力すると、文数情報抽出部323は、このデータから文数情報を抽出する。具体的には、文数情報抽出部323は、図5のデータの先頭の<3>というタグに基づき、文数「3」を抽出する。文数情報抽出部323は、抽出した文数情報(たとえば、3)を外部に抽出する。
When the
以上説明したように、本実施形態の文数推定装置320によれば、入力される原言語文に応じて、適切な目的言語文(前記原言語文の翻訳結果)の文数を推定することができるようになる。また、推定された文数の情報を用いて、次に説明する第2実施形態の翻訳装置1が、その文数(またはそれに近い文数)の翻訳結果を出力することができるようになる。
As described above, the sentence
第1実施形態の変形例として、文数推定装置320が、学習済みのモデルを用いて、原言語文に対応する目的言語文の出力文数を推定するようにしてもよい。この場合には、文数推定装置320は、モデルの学習を行うための機能を必要としない。また、別の変形例として、文数推定装置320が、モデルの学習のみを行うようにしてもよい。このように学習したモデルを、他の装置に移植することができる。この場合には、文数推定装置320は、モデルの学習を行うための機能のみを備えれば十分であり、実際に出力文数を推定するための機能を必要としない。
As a variation of the first embodiment, the number of
なお、コンピューターおよびプログラムを用いて文数推定装置320を実現することが可能である。コンピューターおよびプログラムを用いて文数推定装置320を実現する具体的な方法については、次の第2実施形態の中で説明する。本実施形態の文数推定装置320は、第2実施形態における文数推定部32に相当する装置である。
It is possible to realize the number-of-
[第2実施形態]
次に、本発明の第2実施形態について説明する。なお、前実施形態において既に説明した事項については以下において説明を省略する場合がある。ここでは、本実施形態に特有の事項を中心に説明する。
[Second embodiment]
Next, a second embodiment of the present invention will be described. Note that the description of the matters already described in the previous embodiment may be omitted. Here, the description will be centered on matters unique to this embodiment.
本実施形態は自然言語で記述された文の翻訳処理を行う翻訳装置に係るものである。翻訳処理の入力側の文は、原言語(source language)で記述されている。翻訳処理の出力側の文は、目的言語(target language)で記述されるものである。原言語および目的言語のそれぞれは、例えば、英語、ドイツ語、日本語、フランス語、ロシア語、スペイン語、イタリア語、中国語、韓国語、あるいはその他の言語である。基本的には、翻訳処理において原言語の種類と目的言語の種類とは異なるものである。但し、原言語の種類と目的言語の種類とが同一であってもよい。 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.
図6は、本実施形態による翻訳装置の概略機能構成を示すブロック図である。図示するように、翻訳装置1は、原言語文入力部21と、文数指定部22と、翻訳処理部23と、翻訳結果出力部24と、文対供給部31と、文数推定部32と、文数情報付与部33と、学習用データ供給部34とを含んで構成される。これらの各機能部は、例えば、コンピューターと、プログラムとで実現することが可能である。また、各機能部は、必要に応じて、記憶手段を有する。記憶手段は、例えば、プログラム上の変数や、プログラムの実行によりアロケーションされるメモリーである。また、必要に応じて、磁気ハードディスク装置やソリッドステートドライブ(SSD)といった不揮発性の記憶手段を用いるようにしてもよい。また、各機能部の少なくとも一部の機能を、プログラムではなく専用の電子回路等として実現してもよい。
FIG. 6 is a block diagram showing the schematic functional configuration of the translation device according to this embodiment. As shown in the figure, the translation device 1 includes a source language
なお、翻訳装置1は、学習モードと、翻訳実行モードとの、いずれかのモードで動作することができる。学習モードで動作する場合には、翻訳装置1は、内部のモデルの機械学習を行う。翻訳実行モードで動作する場合には、翻訳装置1は、そのときの状態のモデルに基づいて、自然言語の翻訳処理を行う。 The translation device 1 can operate in either a learning mode or a translation execution mode. When operating in the learning mode, the translation device 1 performs machine learning of an internal model. When operating in the translation execution mode, the translation device 1 performs natural language translation processing based on the model in the current state.
なお、翻訳装置1は、上記の通りモデルの学習を行う機能を持つ。よって、翻訳装置1を学習装置と呼んでもよい。また、翻訳装置1は、自然言語のデータを処理する機能を持つ。よって、翻訳装置1を自然言語処理装置と呼んでもよい。 Note that translation device 1 has a function for learning a model as described above. Therefore, translation device 1 may be called a learning device. Translation device 1 also has a function for processing natural language data. Therefore, translation device 1 may be called a natural language processing device.
原言語文入力部21、文数指定部22、翻訳処理部23、翻訳結果出力部24という直列のつながりは、翻訳装置1が翻訳実行モードで動作するときの処理の流れに対応する。以下では、原言語文入力部21、文数指定部22、翻訳処理部23、翻訳結果出力部24の各部の機能を、翻訳実行モードで動作と関連付けて説明する。
The serial connection of the source language
原言語文入力部21は、翻訳対象である原言語文を取得し、文数指定部22に渡す。原言語文入力部21は、原言語文を、例えば外部から取得したり、翻訳装置1からアクセス可能な記憶部から読み出したりする。原言語文は、例えば、テキストデータとして翻訳装置1内で存在する。ここで入力される原言語文を、入力原言語文と呼ぶ。また、この入力原言語文に対応する出力用の目的言語文(翻訳結果)を出力目的言語文と呼ぶ。
The source language
文数指定部22は、原言語文入力部21から受け取った原言語文を翻訳した結果における、目的言語文の文数を指定する。文数指定部22は、例えば、外部から取得した数値や、翻訳装置1内の所定の記憶部から読み出した数値等に基づいて、目的言語文の文数を指定する。文数指定部22は、目的言語文の文数の情報を、前記原言語文に付加する。文数指定部22は、目的言語文の文数の情報を付加した状態の原言語文を、翻訳処理部23に渡す。文数指定部22が目的言語文の文数の情報を原言語文に付加する具体的な方法の例については、後述する。つまり、文数指定部22は、入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加して、翻訳処理部23に渡す。
The number of
文数指定部22は、後で例示するように、テキストデータである入力原言語文の先頭部分に、出力目的言語文の文数の情報を付加してよい。この場合、学習用データにおいても、原言語文の先頭部分に目的言語文の文数の情報を付加するようにする。原言語文の先頭に文数の情報を付加することにより、原言語文のテキストが可変長であっても、文数の情報は常に固定の位置に付加される。これは、文数の情報に基づく機械学習を行う際に有利である。
As exemplified later, the sentence
翻訳処理部23は、入力される原言語文を基に、翻訳処理を行い、目的言語文を出力する。翻訳処理部23は、内部に翻訳用のモデルを持っている。このモデルは、学習用データを用いて学習可能なものである。モデルは、例えば、ニューラルネットワークを用いて実現される。より具体的には、モデルは、RNN(再帰型ニューラルネットワーク、Recurrent Neural Network)や、Transformer(トランスフォーマー)等を用いて実現されてよい。ただし、モデルを実現するための具体的な構成は、ここに例示したものには限定されない。なお、ここで挙げたニューラルネットワーク、RNN、Transformerといった技術自体は、利用可能な既存技術である。翻訳処理部23の内部のモデルが適切に学習されていた場合、翻訳処理部23は、入力される原言語文の翻訳文である目的言語文(複数の文である場合もある)を生成して出力することが期待される。また、翻訳処理部23の内部のモデルが適切に学習されていた場合、翻訳処理部23は、文数指定部22によって指定された数の(あるいは少なくとも、指定された数に近い数の)目的言語文を生成して出力することが期待される。つまり、翻訳処理部23は、モデルを備え、学習用データを用いてそのモデルの学習を行うとともに、出力目的言語文の文数の情報を付加した入力原言語文を、モデルに入力することによって、モデルが求めた出力目的言語文を出力するものである。また、翻訳処理部23は、上記の通りモデルの学習を行うものであり、「学習処理部」と呼んでもよい。
The
なお、翻訳処理部23の、学習モードにおける動作と、翻訳実行モードにおける動作とは、次の通りである。
The operation of the
学習モードにおいては、翻訳処理部23は、学習用データ供給部34から提供される学習用データに基づいて、モデルの学習処理を行う。学習用データは、モデルへの入力データと出力データとの対の集合である。本実施形態において、モデルへの入力データは、出力データである目的言語文の文数(推定値)が付加された、原言語文のテキストデータである。また、学習用データに含まれる出力データは、目的言語文の正解のテキストデータである。ニューラルネットワークで実現されているモデルは、この入力データを基に、ネットワークの各ノードでの演算を行い、出力データを求める。モデルが求めた出力データは、目的言語文に対応するものである。翻訳処理部23は、入力データに基づいてモデルが算出した出力データ(推定データ)と、学習用データ内の出力データとの、差(ロス)を算出する。そして、翻訳処理部23は、算出された差に基づいて、誤差逆伝播法(バックプロパゲーション)によりモデルの内部パラメーターを更新する。誤差逆伝播法によるニューラルネットワークの内部パラメーターの更新は、既存の技術により実行可能である。翻訳処理部23は、更新後のモデルの内部パラメーターの値を、適宜、記憶部(不図示)に書き込む。翻訳処理部23は、学習用データに含まれる多数の文対のそれぞれについてこのような処理を繰り返すことにより、モデルの学習を行う。
In the learning mode, the
翻訳処理部23が翻訳実行モードで動作する場合には、少なくとも所定量の学習処理が完了していることが前提である。翻訳実行モードにおいては、翻訳処理部23は、文数指定部22から渡される入力データを受け取る。この入力データは、原言語文のテキストデータと、文数を指定するデータ(例えば、タグとして表現された数値)とを含む。翻訳処理部23は、入力データを基に、モデル内部の演算を行い、モデルからの出力データを求める。なお、翻訳処理部23は、必要に応じてモデル内部のパラメーター(学習済みのパラメーター集合の値)を記憶部(不図示)等から読み出してよい。翻訳処理部23が求めた出力データは、翻訳結果としての目的言語文のテキストであることが期待される。翻訳処理部23は、その出力データ(目的言語文)を、翻訳結果出力部24に渡す。
When the
翻訳結果出力部24は、翻訳処理部23から出力される目的言語文を外部に出力する。
翻訳結果出力部24は、翻訳結果の目的言語文を、例えば、外部装置に向けて送信したり、ディスプレイ装置に表示したり、記録媒体(ハードディスクや、半導体メモリー等)に記録したり、などといった形で出力する。翻訳結果出力部24が、その他の形態で目的言語文を出力してもよい。
The translation
The translation
文対供給部31、文数推定部32、文数情報付与部33、学習用データ供給部34という機能群は、翻訳装置1の学習モードで使用するための学習用データを生成して、翻訳処理部23内のモデルに供給するための機能群である。以下では、文対供給部31、文数推定部32、文数情報付与部33、学習用データ供給部34の各部の機能を、学習用データの生成の動作と関連付けて説明する。
The functional group consisting of the sentence
文対供給部31は、原言語文と目的言語文との対(文対)を供給する。ここでの原言語文を学習用言語文と呼ぶ。また、ここでの目的言語文を学習用目的言語文と呼ぶ。つまり、文対供給部31は、学習用原言語文と学習用目的言語文との対のデータを供給するものである。文対供給部31は、例えば外部から取得した文対や、翻訳装置1内の記憶部(不図示)等から読み出した文対を、1対ずつ処理して、文数推定部32、文数情報付与部33、学習用データ供給部34に渡す。具体的には、文対供給部31は、文対内の原言語文を、文数情報付与部33に渡す。また、文対供給部31は、文対内の目的言語文を、文数推定部32と、学習用データ供給部34とに渡す。
The sentence
文対供給部31が供給する文対は、同じ意味を持つ原言語文と目的言語文との対である。言い換えれば、ある文対内において、原言語文を翻訳した結果が目的言語文である。また、基本的にたいていの場合において、ある文対内において、目的言語文を翻訳した結果は原言語文であり得る。ある文対内における原言語文は、1つまたは複数の文であってよい。また、ある文対内における目的言語文は、1つまたは複数の文であってよい。このような文対は、既存の言語コーパスを基に得ることができる。あるいは、原言語文を人手で翻訳することによって目的言語文を得て、これら両者を文対としてもよい。
The sentence pairs supplied by the sentence
なお、文対を構成する際に、原言語と目的言語の対は、学習しようとするモデルに整合するものとする。翻訳用のモデル(翻訳処理部23の内部のモデル)に整合する限りにおいて、原言語の種類や目的言語の種類は任意である。一例として、翻訳装置1に日英翻訳の処理を行わせるためには、原言語を日本語とし、目的言語を英語とする。 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 model inside 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.
文数推定部32は、文対供給部31から供給された目的言語文に含まれる文の数を推定し、出力する。つまり、文数推定部32は、ある文対における学習用目的言語文に含まれる文数を求める。文数推定部32は、目的言語の種類に応じた方法を用いて文の数を推定する。例えば、文数推定部32は、欧米系の言語(英語、フランス語、ドイツ語等)に関しては、一文の終わりはピリオドやクエスションマークで終わるという特徴に基づいて、ピリオドやクエスションマークの数を数えることにより、文数を推定する。ただし、ピリオドやクエスションマークは、文末以外において現れる場合もある。例えば英語における「Mr.」(「mister」の省略表記)といった表現にピリオドが含まれるが、この例におけるピリオドは文末であることを表さない。このため、文数推定部32は、推定精度を上げるため、他の方法を用いてもよい。
The sentence
例えば、文数推定部32は、バイト対符号化(Byte pair encoding、BPE)の手法を用いて、目的言語文(例えば、英語文)を分割する。バイト対符号化の手法自体は、既存技術である。文数推定部32は、例えば、バイト対符号化によってピリオドが単体で分割された場合のピリオドの数を数えることにより、文数を推定する。
For example, the sentence
また、例えば、文数推定部32は、目的言語文の構文解析処理を行うことにより、文数を推定してもよい。例えば、目的言語が英語である場合、目的言語文の一文は、SV、SVO、SVC、SVOCなどといった基本構造を持つ。ここで、Sは主語、Vは述語、Oは目的語、Cは補語である。文数推定部32は、このような構文解析結果に基づいて、文数を数え上げ、その結果を推定された文数とする。英語以外の各言語においても、基本的に、構文解析処理による文数の推定は有効である。なお、さらに推定精度を上げるため、文数推定部32は、構文解析の結果と、ピリオドやクエスションマークの数との、両方に基づいて文数を推定するようにしてもよい。
For example, the sentence
また、例えば、文数推定部32は、目的言語文に対応して外部から与えられる数値を、文数の推定結果としてもよい。例えば、人が判断することによって、目的言語文ごとにその文数を入力し、文数推定部32がその数値を文数の推定結果としてもよい。あるいは、目的言語文に対応付けて記憶部(不図示)等に記憶されている数値を、文数推定部32が読み出して、文数の推定結果としてもよい。
For example, the number of
例えば英語における前述のピリオドやクエスションマーク等は、文末であることを示す記号である。このように文末であることを示す記号を、文末記号と呼ぶ。例えば日本語においては、句点(まる)やピリオドは、文末記号である。また、他の言語においても、文末記号に基づいて、文数推定部32は、文数を求めてもよいつまり、文数推定部32は、供給された前記学習用目的言語文に含まれる文末記号の数をカウントすることによって、学習用目的言語文に含まれる文数を求めてよい。
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-ending symbols. For example, in Japanese, full stops and periods are sentence-ending symbols. Also, in other languages, the sentence
文数情報付与部33は、文対供給部31から原言語文を受け取るとともに、文数推定部32から目的言語文の文数(上記の推定値)を受け取る。文数情報付与部33は、文対供給部31から受け取った原言語文のデータに、文数推定部32から受け取った文数の情報を付加して、出力する。つまり、文数情報付与部33は、学習用原言語文に、文数推定部32が求めた文数の情報を付加して、学習用目的言語文の文数の情報が付加された学習用原言語文のデータを出力する。文数情報付与部33は、目的言語文の文数(推定値)の情報が付加された原言語文のデータを、学習用データ供給部34に渡す。文数情報付与部33が文数の情報を付加する方法の一例は、目的言語文の文数を表すタグを、原言語文のテキストに付加することである。なお、文数情報付与部33は、テキストデータである学習用原言語文の先頭部分に、学習用目的言語文の文数の情報を付加してよい。文数情報付与部33が文数の情報を付加する位置は、文数指定部22のそれに合わせる。原言語文の先頭部分に文数の情報を付加することの利点は、既に説明した通りである。
The number of sentences
なお、目的言語文の文数(推定値)の情報が付加された原言語文のデータの実例については、後で、別の図を参照しながら説明する。 An example of source language sentence data with information on the number of target language sentences (estimated value) will be explained later with reference to another figure.
学習用データ供給部34は、文対供給部31から渡された目的言語文のデータと、文数情報付与部33から渡された原言語文のデータ(ただし、目的言語文の文数の推定値付き)とを、対として、翻訳処理部23に渡す。この対は、翻訳処理部23が持つ前記モデルの、学習用データとして使用することができる。つまり、学習用データ供給部34は、学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、学習用目的言語文のデータとの対を、学習用データとして供給する。
The learning
文対供給部31は、多数の文対を供給してよい。文対供給部31が供給する文対のそれぞれに対応して、学習用データ供給部34は、原言語文(文数の推定値付き)と目的言語文との対を、翻訳処理部23に渡す。これらそれぞれの対を用いて、翻訳処理部23の内部のモデルの機械学習処理を行うことが可能である。学習用データとして学習用データ供給部34が供給する文対の数は、任意である。学習用データ供給部34は、大量の文対を供給してよい。学習用データとして供給される文対の数は、例えば、数十万対あるいは数百万対に達するものであってもよい。
The sentence
次に、学習用データの構成のしかた等について説明する。 Next, we will explain how to configure the learning data.
図7は、文対供給部31が供給する文対のデータの例を示す概略図である。図示する文対において、原言語文は日本語文であり、目的言語文は英語文である。原言語文は、「全国一の生産量を誇る広島特産のカキを夏にも観光客らに楽しんでもらおうと、広島県は新たに生食用のカキを開発し、16日、関係者を集めて試食会を開きました。」というテキストのデータである。この原言語文に対応する目的言語文は、「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.」という文の3つの文を含むテキストのデータである。
Fig. 7 is a schematic diagram showing an example of data of a sentence pair supplied by the sentence
図8は、学習用データ供給部34が翻訳処理部23に渡す学習用データ(文対)の例を示す概略図である。図8に示すデータは、図7のデータに基づいて作成されたものである。図8に示すデータが、図7に示したデータと異なる点は、原言語文側のテキストの先頭に、<3>というタグが付加されていることである。このタグは、目的言語側の文数が3であることに対応する。言い換えれば、このタグは、目的言語側の文数を表すタグである。目的言語側の文数が3であることは、前述の通り、文数推定部32による推定結果に基づく。また、その推定結果にしたがって<3>というタグを原言語文データに付加したのは、文数情報付与部33である。つまり、図8に示すデータにおいて、原言語文データは「<3>全国一の生産量を誇る広島特産のカキを夏にも観光客らに楽しんでもらおうと、広島県は新たに生食用のカキを開発し、16日、関係者を集めて試食会を開きました。」というテキストのデータである。図8に示す目的言語文データは、図7におけるそれと同一のテキストデータである。
8 is a schematic diagram showing an example of learning data (sentence pair) that the learning
図8に示すような学習用データを用いて機械学習を行うことにより、翻訳処理部23内の翻訳モデルは、原言語文そのものと目的言語文との対応関係を学習するだけではなく、「3」という数値(推定された文数)と目的言語文との対応関係をも学習する。
By performing machine learning using learning data such as that shown in Figure 8, the translation model in the
図9は、翻訳装置1の翻訳処理部23が機械学習を行うための学習用データを生成する処理の手順を示すフローチャートである。このフローチャートは、1対の入出力データを生成するための手順である。このフローチャートの処理は、入出力データ対ごとに繰り返して実行され得る。以下、このフローチャートに沿って動作手順を説明する。
Figure 9 is a flowchart showing the steps of a process for generating learning data for machine learning by the
まず、ステップS11において、文対供給部31は、原言語文と目的言語文とから成る1対の言語対を取得し、翻訳装置1内に供給する。前述の通り、文対供給部31は、文対に含まれる原言語文を、文数情報付与部33に供給する。また、文対供給部31は、文対に含まれる目的言語文を、文数推定部32および学習用データ供給部34に供給する。
First, in step S11, the sentence
次に、ステップS12において、文数推定部32は、ステップS11で文対供給部31から渡された目的言語文に含まれる文の数を推定する。文数推定部32が具体的に用いる推定手法の例については、既に説明した通りである。文数推定部32は、推定結果である文数を、文数情報付与部33に通知する。
Next, in step S12, the sentence
次に、ステップS13において、文数情報付与部33は、ステップS11で文対供給部31から渡された原言語文に、ステップS12において推定された目的言語文の文数の情報を付加する。具体的な例としては、文数情報付与部33は、目的言語文の文数を表すタグを、原言語文のデータに付加する。目撃言語文の文数の推定値が付加された原言語文のデータの例については、既に説明した通りである(図8を参照)。
Next, in step S13, the sentence number
次に、ステップS14において、文数情報付与部33は、目撃言語文の文数の推定値が付加された原言語文のデータを、学習用データ供給部34に渡す。学習用データ供給部34は、目撃言語文の文数の推定値が付加された原言語文のデータを、学習用データの入力側のデータとする。
Next, in step S14, the sentence number
次に、ステップS15において、学習用データ供給部34は、ステップS11で文対供給部31から渡された目的言語文のデータを、学習用データの出力側のデータとする。
Next, in step S15, the learning
次に、ステップS16において、学習用データ供給部34は、上記の入力側データ(目的言語文の文数の推定値が付加された原言語文のデータ)と、出力側データ(目的言語文のデータ)との対を、出力する。この1対のデータは、翻訳処理部23における学習処理に用いられるものである。
Next, in step S16, the learning
図10は、翻訳装置1の内部構成の例を示すブロック図である。翻訳装置1は、コンピューターを用いて実現され得る。図示するように、そのコンピューターは、中央処理装置901と、RAM902と、入出力ポート903と、入出力デバイス904や905等と、バス906と、を含んで構成される。コンピューター自体は、既存技術を用いて実現可能である。中央処理装置901は、RAM902等から読み込んだプログラムに含まれる命令を実行する。中央処理装置901は、各命令にしたがって、RAM902にデータを書き込んだり、RAM902からデータを読み出したり、算術演算や論理演算を行ったりする。RAM902は、データやプログラムを記憶する。RAM902に含まれる各要素は、アドレスを持ち、アドレスを用いてアクセスされ得るものである。なお、RAMは、「ランダムアクセスメモリー」の略である。入出力ポート903は、中央処理装置901が外部の入出力デバイス等とデータのやり取りを行うためのポートである。入出力デバイス904や905は、入出力デバイスである。入出力デバイス904や905は、入出力ポート903を介して中央処理装置901との間でデータをやりとりする。バス906は、コンピューター内部で使用される共通の通信路である。例えば、中央処理装置901は、バス906を介してRAM902のデータを読んだり書いたりする。また、例えば、中央処理装置901は、バス906を介して入出力ポートにアクセスする。
Figure 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 is configured to include a
翻訳装置1(学習装置)の少なくとも一部の機能をコンピューターで実現することができる。その場合、この機能を実現するためのプログラムをコンピューター読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピューターシステムに読み込ませ、実行することによって実現しても良い。なお、ここでいう「コンピューターシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピューター読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM、DVD-ROM、USBメモリー等の可搬媒体、コンピューターシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピューター読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、一時的に、動的にプログラムを保持するもの、その場合のサーバーやクライアントとなるコンピューターシステム内部の揮発性メモリーのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピューターシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。 At least some of the functions of the translation device 1 (learning device) can be realized by a computer. In this case, a program for realizing this function may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read into a computer system and executed to realize the function. Note that the term "computer system" here includes hardware such as an OS and peripheral devices. Furthermore, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, CD-ROMs, DVD-ROMs, and USB memories, and storage devices such as hard disks built into computer systems. Furthermore, the term "computer-readable recording medium" may also include devices 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 devices 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. Furthermore, the above program may be for realizing some of the functions described above, and may further be capable of realizing the functions described above in combination with a program already recorded in the computer system.
以上、実施形態を説明したが、さらに次のような変形例で実施してもよい。なお複数の変形例を、組み合わせることが可能な限りにおいて、組み合わせて実施してもよい。 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.
[第1変形例]
上記の第2実施形態では、翻訳装置1は、学習モードと翻訳実行モードの両方で動作し得るものであった。第1変形例では、翻訳装置1は、学習モードで動作せず、翻訳実行モードでのみ動作する。この場合、翻訳処理部23の中の翻訳モデルは、学習用データに基づく機械学習処理を完了済みである。あるいは、翻訳モデルの学習済みの内部パラメーターの値を、翻訳モデルが外部からインポートできるようにしてもよい。第1変形例の翻訳装置1は、図6に示した機能構成のうちの、少なくとも、原言語文入力部21、文数指定部22、翻訳処理部23、翻訳結果出力部24のすべてを備える。また、その翻訳装置1は、文対供給部31、文数推定部32、文数情報付与部33、学習用データ供給部34の一部または全部を備えない構成としてもよい。第1変形例の翻訳装置1は、学習済みのモデルを用いて、指定された数の文からなる目的言語文を出力する処理を行うことが期待される。
[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
上記のような第1変形例の翻訳装置1は、つまり、入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加する文数指定部22と、モデルを備え、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部23と、を備え、前記モデルは、学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、学習用目的言語文のデータと、の対である学習用データを用いて学習済みである、というものである。
The translation device 1 of the first modified example as described above comprises a sentence
[第2変形例]
上記の第2実施形態では、翻訳装置1は、学習モードと翻訳実行モードの両方で動作し得るものであった。第2変形例では、翻訳装置1は、翻訳実行モードで動作せず、学習モードでのみ動作する。つまり、第2変形例の翻訳装置1は、学習処理のみを行うものであり、「学習装置」と呼んでもよい。この場合、翻訳処理部23の中の翻訳モデルは、学習処理によって内部パラメーターを更新する。学習後のモデルを、例えば、外部の装置にエクスポートすることができる。この際、翻訳装置1とその外部の装置が同一のネットワーク構造を予め持っている場合には、学習後のモデルの内部パラメーターの値の集合のみをエクスポートするようにしてもよい。これにより、第2変形例の翻訳装置1(学習装置)で学習した結果に基づいて、その外部の装置が、翻訳処理を行うことができる。その外部の装置は、指定された数の文からなる目的言語文を出力する翻訳処理を行うことが期待される。第2変形例の翻訳装置1(学習装置)は、図6に示した機能構成のうちの、少なくとも、文対供給部31、文数推定部32、文数情報付与部33、学習用データ供給部34、翻訳処理部23のすべてを備える。また、その翻訳装置1(学習装置)は、原言語文入力部21、文数指定部22、翻訳結果出力部24の一部または全部を備えない構成としてもよい。
[Second Modification]
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
上記のような第2変形例の翻訳装置1は、つまり、学習用原言語文と学習用目的言語文との対のデータを供給する文対供給部31と、供給された前記学習用目的言語文に含まれる文数を求める文数推定部32と、前記学習用原言語文に、前記文数推定部が求めた前記文数の情報を付加して、前記学習用目的言語文の文数の情報が付加された前記学習用原言語文のデータを出力する文数情報付与部33と、前記学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、前記学習用目的言語文のデータとの対を、学習用データとして供給する学習用データ供給部34と、前記学習用データを用いてモデルの学習を行う翻訳処理部23(学習処理部)と、を備えるものである。
The translation device 1 of the second modified example as described above includes a sentence
[第3変形例]
上記の第2実施形態では、文数推定部32が推定した文数の情報を用いて、学習用データを生成した。第3変形例においては、推定値ではなく、文数推定部32に確定的な文数の情報を与えてもよい。その場合には、文数推定部32は、与えられたその文数を推定値として用いる。第3変形例の学習用データ供給部34は、そのように作成された学習用データを、翻訳処理部23に提供する。翻訳処理部23は、そのように作成された学習用データを用いて、モデルの学習処理を行う。
[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-
[第4変形例]
上記の第2実施形態では、文数情報付与部33は、推定された文数の情報を、角括弧<>で囲われたタグの形式のデータとして、原言語文の先頭に付加した。第4実施形態では、付加する文数の情報の形態はこれには限られない。第4変形例における文数情報付与部33は、上記のタグ以外の形態で、文数の情報を原言語文に付加する。また、第4変形例における文数情報付与部33が文数の情報を付加する位置は、原言語文の先頭には限らず、他の場所であってもよい。いずれの場合も、文数情報付与部33は、原言語文のテキストの情報と、文数の数値に対応する情報とを含んだデータを、学習用のモデルへの入力データとして、学習用データ供給部34に渡す。翻訳処理部23は、そのように作成された学習用データを用いて、モデルの学習処理を行う。
[Fourth Modification]
In the second embodiment, the sentence count
以上、この発明の実施形態(変形例を含む)について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 The above describes in detail an embodiment of the present invention (including modified examples) with reference to the drawings, but the specific configuration is not limited to this embodiment, and includes designs that do not deviate from the gist of the present invention.
[文数を制御した翻訳装置(第2実施形態)の実施例と評価]
以下では、上記実施形態の翻訳装置1を実施した例と、その評価結果について説明する。
[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.
図11は、翻訳装置1を用いて翻訳処理を行った結果の例を示す概略図である。本例において、原言語は日本語であり、目的言語は英語である。同図は、日本語の入力文と、英語の5種類の出力文とを示している。入力文の文数は、1である。目的言語文のAは、比較対象であり、人手による翻訳を行った結果である。Aの翻訳結果の文数は3である。出力文のBは、翻訳装置1における目的言語文の文数として1を指定した場合の翻訳結果である。Bの翻訳結果の文数は、指定した通り、1である。出力文のCは、目的言語文の文数として2を指定した場合の翻訳結果である。Cの翻訳結果の文数は、指定した通り、2である。出力文のDは、目的言語文の文数として3を指定した場合の翻訳結果である。Dの翻訳結果の文数は、指定した通り、3である。出力文のEは、比較対象として、目的言語文の文数を指定しない形の機械翻訳処理を行った場合の結果である。Eの翻訳結果の文数は、2となった。一方、本実施形態の翻訳装置1で出力文数を1、2、3とそれぞれ指定した場合には、指定した通りの文数の結果が得られた。 Figure 11 is a schematic diagram showing an example of the results 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. Target language sentence A is the subject of comparison and is the result of manual translation. The number of sentences in the translation result of A is 3. Output sentence B is the 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. Output sentence C is the 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. Output sentence D is the 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. Output sentence E is the result of a machine translation process performed without specifying the number of sentences in the target language sentence, as the subject of comparison. The number of sentences in the translation result for E was 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 result with the specified number of sentences was obtained.
なお、出力文数の指定を行わなかった場合には、出力文数は、望ましい数よりは少なくなる(一文の長さが長くなりがちである)ことが、本実験によりわかった。つまり、本実施形態の翻訳装置1において出力文数を指定できることは、有用である。 In addition, this experiment showed 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 will tend to be long). In other words, being able to specify the number of output sentences in the translation device 1 of this embodiment is useful.
また、以下の方法により、本実施形態の翻訳装置1が有効であることを定量的に評価した。具体的には、出力文数(目的言語文の文数)を指定する情報を付与する場合(本実施形態)と付与しない場合(比較対象)との翻訳結果を比較した。両方の場合とも、学習用データとしては、日本語(原言語文)の各文に対応する人手英訳文(目的言語文)の、約10万文対を用いた。また、開発データおよび評価データとも同様のデータセットで、それぞれ3000文対および5001文対を用いた。 The effectiveness of the translation device 1 of this embodiment was quantitatively evaluated by the following method. Specifically, the translation results were compared between the case where information specifying the number of output sentences (number of sentences in the target language sentence) was provided (this embodiment) and the case where it was not provided (comparison). In both cases, approximately 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.
(1)出力文数情報付与ありの場合には、原言語文データに文数タグを付与し、本実施形態の翻訳処理部23で学習した翻訳モデル(ネットワーク)を用いた。その場合の翻訳時には、評価用日本語テキストデータに対応する英語テキストデータに基づいて、本実施形態の文数推定部32で文数の推定を行った。そして、その推定結果の文数を表すタグを、評価用日本語テキストデータの文頭に付与して、翻訳処理を実行した。
(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
(2)出力文数情報付与なしの場合には、原言語文データへの文数タグの付与を行わずに、本実施形態の翻訳処理部23で学習した翻訳モデル(ネットワーク)を用いた。翻訳時にも、原言語文データへの文数タグの付与を行わずに、翻訳処理を行った。
(2) When output sentence count information was not added, a sentence count tag was not added to the source language sentence data, and the translation model (network) trained by the
両方の場合の実験結果は次の通りである。評価数値としては、出力した文数の元の評価用英文(目的言語文)の文数との一致率、およびBLEU値による翻訳性能を用いた。評価数値の結果は、次の通りである。 The experimental results for both cases are as follows. The evaluation values used were the rate of agreement 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 score. The evaluation values are as follows:
出力文数情報の付与あり: 文数の一致率96.6%
出力文数情報の付与なし: 文数の一致率60.4%
With output sentence count information: Sentence count match rate 96.6%
Without output sentence count information: Sentence count match rate 60.4%
出力文数情報の付与あり: BLEU 19.14
出力文数情報の付与なし: BLEU 18.38
With output sentence count information: BLEU 19.14
No output sentence count information: BLEU 18.38
上記の通り、出力文数の指定を行わなかった場合には文数の一致率が60.4%であったのに対して、出力文数の指定を行った場合の文数の一致率は96.6%であった。つまり、本実施形態の翻訳装置1は、非常に高い確率で、翻訳結果として指定した文数の目的言語文を出力できることが確認できた。 As described above, when the number of output sentences was not specified, the match rate of the number of sentences was 60.4%, whereas when the number of output sentences was specified, the match 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.
また、上記の通り、出力文数の指定を行わなかった場合のBLEU値が18.38であったのに対して、出力文数の指定を行って翻訳した場合のBLEU値は19.14であった。つまり、本実施形態の翻訳装置1のように出力文数の指定を行って翻訳処理を行った場合にも、そうでない場合と比較して、翻訳精度は少なくとも悪くならないことが確認できた。また、上記の通り、出力文数の指定を行って翻訳した場合のBLEU値は、出力文数の指定を行わなかった場合のそれよりも0.76高くなっている。この差が優位なものであるか否かは今後のさらなる検証が必要であるが、一つの可能性としては、出力文数を指定したことにより、出力文のパターンが元のデータセットの目的言語文のパターンに近づくように作用したためであるとも推察される。 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 this embodiment, the translation accuracy at least did not deteriorate compared to when it was not specified. 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 specifying the number of output sentences acted to make the patterns of the output sentences closer to the patterns of the target language sentences in the original dataset.
以上、説明したように、本実施形態によれば、翻訳性能を劣化させることなく指定した文数を出力するような翻訳処理が可能である。言い換えれば、本実施形態により、翻訳性能を劣化させることなく出力文数を制御することが可能となった。本実施形態の検証にはニューラルネットワークを利用したため、そのようなメリットが得られる理由は必ずしも明示的に得られたわけではない。しかし、可能性として、ピリオドの数が合うようにモデルが翻訳結果を制御したことや、あるいは指定した文数になるようにモデルが深層において構文構造を制御したことが考えられる。 As described above, this embodiment makes it possible to perform translation processing that outputs a specified number of sentences without degrading translation performance. In other words, this embodiment makes it possible to control the number of sentences to be output without degrading translation performance. Because a neural network was used to verify this embodiment, the reason why such an advantage is obtained was not necessarily explicitly stated. However, one possibility is 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.
[文数推定装置の実施例と評価]
原言語を日本語とし、目的言語を英語とした場合の実施例を評価した。具体的には、以下の2つの方法を比較し、出力文数の評価用英文との一致率と翻訳性能を比較した。モデルを学習するための学習データとしては、日本語文と、それに対応する人手による英訳文との、約96000文対の対訳データを用いた。また、同様の対訳データから、開発データ5001文対を用いた。評価データとしては、日本語一文を二名の翻訳者がそれぞれ翻訳したマルチリファレンスデータ773文を用いた。
[Example and Evaluation of the 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, development data of 5,001 sentence pairs was used. As evaluation data, multi-reference data of 773 sentences in which one Japanese sentence was translated by two translators each were used.
第1の方法は、出力文数推定を用いる方法である。上記の学習データで学習した文数推定装置320(第1実施形態)を用いて、評価用日本語文に対応する出力文数を推定した。推定された文数のタグを付与し、翻訳装置1(第2実施形態)で翻訳した。翻訳装置1の翻訳モデルも、同様の学習データで学習済みである。 The first method is a method that uses output sentence number estimation. The number of output sentences corresponding to the Japanese sentences for evaluation was estimated using a sentence number estimation device 320 (first embodiment) trained with the above-mentioned training data. A tag for the estimated number of sentences was added, and translation was performed using a translation device 1 (second embodiment). The translation model of the translation device 1 has also been trained with the same training data.
第2の方法は、出力文数推定を用いない方法である。出力文数推定を用いることなく、第1の方法と同様の翻訳モデルを用いて翻訳を行った。 The second method does not use output sentence number estimation. Translation was performed using the same translation model as the first method, without using output sentence number estimation.
実験結果は次の通りである。上記の第1および第2の方法のそれぞれにおける出力文数の、評価用英文テキストとの一致率により評価した。ただし、一致率は、翻訳者二名のいずれかの翻訳結果の英文数と一致していれば一致、として算出している。
第1の方法(出力文数推定あり、本実施形態):87.0%
第2の方法(出力文数推定なし、比較対象):81.8%
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 for evaluation. The degree of agreement was calculated as a match if the number of English sentences in the translation results of either of the two translators matched.
First method (with estimation of the number of output sentences, this embodiment): 87.0%
Second method (no estimation of the number of output sentences, comparison): 81.8%
上記の通り、第1実施形態の文数推定装置320を用いることにより、適切な出力文数を推定できることがわかった。また、第2実施形態の翻訳装置1を用いることにより、適切な文数で翻訳結果を出力できることがわかった。
As described above, it has been found that by using the sentence
以上、この発明の複数の実施形態および変形例について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 Although several embodiments and variations 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 include designs that do not deviate from the gist of the present invention.
本発明は、例えば、自然言語の翻訳処理を利用する産業において利用することができる。一例として、報道あるいはコンテンツ提供の事業において、ニュース等の文章によるコンテンツを自動的に翻訳する業務に利用できる。但し、本発明の利用範囲はここに例示したものには限られない。 The present invention can be used, for example, in industries that use natural language translation processing. As an example, it can be used in the business of automatically translating news and other written content in the news reporting or content provision industry. However, the scope of use of the present invention is not limited to the examples given here.
1 翻訳装置(学習装置、自然言語処理装置)
21 原言語文入力部
22 文数指定部
23 翻訳処理部(学習処理部)
24 翻訳結果出力部
31 文対供給部
32 文数推定部
33 文数情報付与部
34 学習用データ供給部
320 文数推定装置(学習装置、自然言語処理装置)
321 推定部
322 原言語文供給部
323 文数情報抽出部
326 文対供給部
327 文数情報付与部
328 学習用データ供給部
901 中央処理装置
902 RAM
903 入出力ポート
904,905 入出力デバイス
906 バス
1. Translation device (learning device, natural language processing device)
21 source language
24 Translation
321
903 Input/
Claims (5)
供給された前記学習用目的言語文に含まれる文数を求める文数推定部と、
前記学習用原言語文に、前記文数推定部が求めた前記文数の情報を付加して、前記学習用目的言語文の文数の情報が付加された前記学習用原言語文のデータを出力する文数情報付与部と、
前記学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、前記学習用目的言語文のデータとの対を、学習用データとして供給する学習用データ供給部と、
入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加する文数指定部と、
モデルを備え、前記学習用データを用いて前記モデルの学習を行うとともに、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、
自然言語処理装置と、
を備え、
前記自然言語処理装置は、
学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データを供給する学習用データ供給部と、
機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、
前記推定部に対して前記原言語文を供給する原言語文供給部と、
を備え、
学習モードで動作する場合には、前記推定部は、前記学習用データ供給部が供給する前記学習用データに基づいて、前記モデルの機械学習を行い、
推定実行モードで動作する場合には、前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、
ものであり、
前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、
前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、
翻訳装置。 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 language 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 that
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.
供給された前記学習用目的言語文に含まれる文数を求める文数推定部と、
前記学習用原言語文に、前記文数推定部が求めた前記文数の情報を付加して、前記学習用目的言語文の文数の情報が付加された前記学習用原言語文のデータを出力する文数情報付与部と、
前記学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、前記学習用目的言語文のデータとの対を、学習用データとして供給する学習用データ供給部と、
入力された入力原言語文に、当該入力原言語文に対応する出力用の出力目的言語文の文数の情報を付加する文数指定部と、
モデルを備え、前記学習用データを用いて前記モデルの学習を行うとともに、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、
自然言語処理装置と、
を備え、
前記自然言語処理装置は、
機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、
前記推定部に対して前記原言語文を供給する原言語文供給部と、
を備え、
前記モデルは、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データに基づいて機械学習済みであり、
前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、
ものであり、
前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、
前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、
翻訳装置。 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 language 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 that
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.
モデルを備え、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、
自然言語処理装置と、
を備え、
前記自然言語処理装置は、
学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データを供給する学習用データ供給部と、
機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、
前記推定部に対して前記原言語文を供給する原言語文供給部と、
を備え、
学習モードで動作する場合には、前記推定部は、前記学習用データ供給部が供給する前記学習用データに基づいて、前記モデルの機械学習を行い、
推定実行モードで動作する場合には、前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、
ものであり、
前記モデルは、学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、学習用目的言語文のデータと、の対である学習用データを用いて学習済みであり、
前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、
前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、
翻訳装置。 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 about 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.
モデルを備え、前記出力目的言語文の文数の情報を付加した前記入力原言語文を、前記モデルに入力することによって、前記モデルが求めた出力目的言語文を出力する翻訳処理部と、
自然言語処理装置と、
を備え、
前記自然言語処理装置は、
機械学習可能なモデルを備え、原言語文を入力し、前記原言語文に対応する目的言語文の文数を表す文数情報を少なくとも出力する推定部と、
前記推定部に対して前記原言語文を供給する原言語文供給部と、
を備え、
前記モデルは、学習用原言語文と、前記学習用原言語文に対応する学習用目的言語文と、前記学習用目的言語文の文数を表す学習用文数情報と、を含む学習用データに基づいて機械学習済みであり、
前記推定部は、前記原言語文供給部が供給する前記原言語文に基づいて、当該原言語文に対応する前記文数情報を出力する、
ものであり、
前記モデルは、学習用目的言語文の文数の情報が付加された学習用原言語文のデータと、学習用目的言語文のデータと、の対である学習用データを用いて学習済みであり、
前記自然言語処理装置の原言語文供給部は、前記入力原言語文を、前記自然言語処理装置の前記推定部に供給し、
前記文数指定部は、前記自然言語処理装置の前記推定部が出力した前記文数情報に基づいて、前記出力用の出力目的言語文の文数の情報を付加する、
翻訳装置。 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 about 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 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.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021035594A JP7624851B2 (en) | 2021-03-05 | 2021-03-05 | Natural language processing device, translation device, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021035594A JP7624851B2 (en) | 2021-03-05 | 2021-03-05 | Natural language processing device, translation device, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2022135649A JP2022135649A (en) | 2022-09-15 |
| JP7624851B2 true JP7624851B2 (en) | 2025-01-31 |
Family
ID=83232032
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2021035594A Active JP7624851B2 (en) | 2021-03-05 | 2021-03-05 | Natural language processing device, translation device, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7624851B2 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008233955A (en) | 2007-03-16 | 2008-10-02 | Nippon Hoso Kyokai <Nhk> | Example database creation device, example database creation program, translation device, and translation program |
| CN109344413A (en) | 2018-10-16 | 2019-02-15 | 北京百度网讯科技有限公司 | Translation processing method and apparatus |
| JP2019036093A (en) | 2017-08-14 | 2019-03-07 | 日本電信電話株式会社 | Model learning device, conversion device, method, and program |
| JP2020166501A (en) | 2019-03-29 | 2020-10-08 | 株式会社日立製作所 | Split model generation system, text segmentation device and split model generation method |
-
2021
- 2021-03-05 JP JP2021035594A patent/JP7624851B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008233955A (en) | 2007-03-16 | 2008-10-02 | Nippon Hoso Kyokai <Nhk> | Example database creation device, example database creation program, translation device, and translation program |
| JP2019036093A (en) | 2017-08-14 | 2019-03-07 | 日本電信電話株式会社 | Model learning device, conversion device, method, and program |
| CN109344413A (en) | 2018-10-16 | 2019-02-15 | 北京百度网讯科技有限公司 | Translation processing method and apparatus |
| JP2020166501A (en) | 2019-03-29 | 2020-10-08 | 株式会社日立製作所 | Split model generation system, text segmentation device and split model generation method |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022135649A (en) | 2022-09-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11816442B2 (en) | Multi-turn dialogue response generation with autoregressive transformer models | |
| US11934781B2 (en) | Systems and methods for controllable text summarization | |
| US12032910B2 (en) | Joint intent and entity recognition using transformer models | |
| US12079602B2 (en) | Systems and methods for a conversational framework of program synthesis | |
| US11520992B2 (en) | Hybrid learning system for natural language understanding | |
| US10970487B2 (en) | Templated rule-based data augmentation for intent extraction | |
| CN107656921B (en) | A short text dependency analysis method based on deep learning | |
| US20240176962A1 (en) | CROSS-LINGUAL NATURAL LANGUAGE UNDERSTANDING MODEL FOR MULTI-LANGUAGE NATURAL LANGUAGE UNDERSTANDING (mNLU) | |
| US20220100967A1 (en) | Lifecycle management for customized natural language processing | |
| CN119968612A (en) | Code recommendations based on software licenses | |
| US20220229986A1 (en) | System and method for compiling and using taxonomy lookup sources in a natural language understanding (nlu) framework | |
| US20240241714A1 (en) | Source code conversion from an original computer programming language to a target programming language | |
| JP7624851B2 (en) | Natural language processing device, translation device, and program | |
| JP7527176B2 (en) | Translation device, learning device, translation method, and program | |
| JP7716885B2 (en) | Natural language processing device, classification device, and program | |
| US20260050589A1 (en) | Better inference pattern for long context retrieval | |
| Du et al. | Generate-then-Revise: An Effective Synthetic Training Data Generation Framework for Event Detection | |
| KR20240073535A (en) | Method and apparatus for training question generation model | |
| JP2025122963A (en) | Information processing device and program | |
| JP2025162196A (en) | Comment generation program, comment generation device, and comment generation method | |
| JP2025071488A (en) | Voice recognition device and program | |
| Sulaiman | Digital Linguistic Sovereignty: The Exclusion of African Languages in Natural Language Processing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A80 | Written request to apply exceptions to lack of novelty of invention |
Free format text: JAPANESE INTERMEDIATE CODE: A80 Effective date: 20210331 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240201 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20240918 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20241105 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20241213 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20241224 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250121 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7624851 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |