JP7262231B2 - learning devices and programs - Google Patents
learning devices and programs Download PDFInfo
- Publication number
- JP7262231B2 JP7262231B2 JP2019009658A JP2019009658A JP7262231B2 JP 7262231 B2 JP7262231 B2 JP 7262231B2 JP 2019009658 A JP2019009658 A JP 2019009658A JP 2019009658 A JP2019009658 A JP 2019009658A JP 7262231 B2 JP7262231 B2 JP 7262231B2
- Authority
- JP
- Japan
- Prior art keywords
- unit
- sentence
- output
- domain
- parameters
- 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
本発明は、翻訳装置、学習装置、およびプログラムに関する。 The present invention relates to a translation device, a learning device, and a program.
ニューラルネットワークによる機械学習を利用した機械翻訳では、学習データが多いほど、翻訳精度が向上する。翻訳精度を向上させるためには、できるだけ多くの学習データを準備することが望ましいが、そのためには高いコストがかかる。学習データの量を増やすために、ドメインが異なるデータを合わせて学習させることも考えられるが、ドメインが異なるデータを用いることにより翻訳精度が低下するという問題がある。 In machine translation using machine learning by neural networks, the more learning data there is, the more the translation accuracy improves. In order to improve translation accuracy, it is desirable to prepare as much learning data as possible, but this requires high costs. In order to increase the amount of learning data, it is conceivable to combine data of different domains for learning.
非特許文献1に記載されている技術では、複数のドメインに属する学習データを合わせて機械学習を行った後で、目的とするドメインに属するデータのみを用いて再学習を行っている。
In the technique described in Non-Patent
非特許文献2に記載されている技術では、分類問題において、ドメインが異なるデータで学習したモデルの一部を共有させている。
In the technique described in Non-Patent
特許文献1には、自動翻訳の素性重み最適化装置が記載されている。この素性重み最適化装置では、素性重み最適化部278が、複数のドメイン開発セット212を用い、複数のドメイン別統計モデル272及び汎用統計モデル274から得られる素性又はその対数の線形補間を用いて自然言語の翻訳を行う際の各素性重みを最適化する。素性重み最適化部278は、ドメイン開発セット212の各々について設けられたドメイン別素性記憶領域を持つ。その各々は、汎用統計モデルの素性を記憶する第1の領域と、複数のドメイン開発セットから得られる素性を記憶する複数の第2の領域と、重みの最適化に用いられる損失関数の値を記憶する第3の領域とを含む。
従来技術では、複数のドメインの翻訳モデル間で知識を共有することができないという問題があった。非特許文献1に記載されている技術では、性質の異なる学習データ(例えば、旅行会話分野の文と、特許文献の文といったようにドメインの異なる学習データ)を合わせて学習するため、翻訳精度が落ちる場合があった。非特許文献2には、分類問題において、ドメインが異なるデータで学習したモデルの一部を共有させているが、翻訳処理をはじめとする生成問題には適応することができないという問題があった。
Conventional techniques have the problem that knowledge cannot be shared between translation models of multiple domains. In the technology described in Non-Patent
機械翻訳では、学習データが多ければ多いほど精度が高くなることが知られており、ドメインごとに学習データを分離して学習することは非効率である。本発明は、上記の事情を考慮して為されたものであり、ドメインの異なる学習データを完全に分離することなく、複数のドメインの翻訳モデル間で知識を共有できるようにするための翻訳装置、学習装置、およびプログラムを提供しようとするものである。 In machine translation, it is known that the more learning data, the higher the accuracy, and it is inefficient to learn by separating the learning data for each domain. The present invention has been made in view of the above circumstances, and provides a translation device for sharing knowledge between translation models of a plurality of domains without completely separating learning data of different domains. , a learning device, and a program.
[1]上記の課題を解決するため、本発明の一態様による学習装置は、第1ドメインにおけるエンコード処理のパラメーターに基づいて、前記第1ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第1エンコーダー部と、第2ドメインにおけるエンコード処理のパラメーターに基づいて、前記第2ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第2エンコーダー部と、前記第1ドメインと前記第2ドメインとで共有されるエンコード処理のパラメーターに基づいて、前記第1ドメインまたは前記第2ドメインのいずれかに属する前記入力文のエンコード処理を行う共有エンコーダー部と、前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、前記第2エンコーダー部におけるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第2デコーダー部と、を具備し、前記第1ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第1エンコーダー部と前記共有エンコーダー部と前記第1デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、前記第2ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第2エンコーダー部と前記共有エンコーダー部と前記第2デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新するものである。 [1] In order to solve the above problems, a learning device according to an aspect of the present invention converts an input sentence belonging to the first domain into a source language based on encoding processing parameters in the first domain. a first encoder unit that performs an encoding process; a second encoder unit that performs an encoding process on an input sentence belonging to the second domain and in a source language based on parameters for the encoding process in the second domain; a shared encoder unit that encodes the input sentence belonging to either the first domain or the second domain based on encoding parameters shared between the first domain and the second domain; Based on a first semantic vector output as a result of encoding processing in one encoder unit, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the first domain, A first decoder unit that generates an output sentence corresponding to the input sentence, a second semantic vector that is output as a result of encoding processing in the second encoder unit, and a second semantic vector that is output as a result of encoding processing in the shared encoder unit a second decoder unit that generates an output sentence corresponding to the input sentence based on a common semantic vector and parameters of the decoding process in the second domain; When a sentence pair, which is a pair of sentences in a language, is input as training data, an output sentence is generated based on the input sentence in the source language by the processing of the first encoder unit, the shared encoder unit, and the first decoder unit. is generated, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, parameters for encoding processing in the first encoder unit, parameters for encoding processing in the shared encoder unit, and the first Decoding parameters in the decoder unit are updated, and when a sentence pair that is a pair of sentences in the source language and the target language belonging to the second domain is input as learning data, based on the input sentence in the source language An output sentence is generated by processing of the second encoder unit, the shared encoder unit, and the second decoder unit, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, the second encoder unit section, the encoding process parameter in the shared encoder section, and the decoding process parameter in the second decoder section are updated.
[2]また、本発明の一態様は、上記の学習装置において、前記第1エンコーダー部によるエンコード処理の結果として出力される第1意味ベクトルの要素と、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルの要素とを並べて得られる連結ベクトルを、前記第1ドメインにおける低次元化処理のパラメーターに基づいて低次元化し、低次元化した結果である第1低次元化ベクトルを出力する第1低次元化部、を具備し、前記第1デコーダー部は、前記第1低次元化部が出力する前記第1低次元化ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成し、前記文対の目的言語による文と、前記第1デコーダー部からの前記出力文との差に基づいて、前記第1低次元化部における低次元化処理のパラメーターをも更新する、ものである。 [2] Further, according to one aspect of the present invention, in the above learning device, the element of the first semantic vector output as a result of encoding processing by the first encoder unit and the result of encoding processing by the shared encoder unit are The concatenated vector obtained by arranging the elements of the common semantic vector to be output is reduced in dimension based on the parameters of the dimension reduction processing in the first domain, and the first reduced dimension vector that is the result of the reduction in dimension is output. The first decoder unit is based on the first reduced-order vector output by the first order reduction unit and the parameters of the decoding process in the first domain to generate an output sentence corresponding to the input sentence, and based on the difference between the sentence in the target language of the sentence pair and the output sentence from the first decoder unit, It also updates the parameters of the dimensioning process.
[3]また、本発明の一態様は、上記の学習装置において、前記第2エンコーダー部によるエンコード処理の結果として出力される第2意味ベクトルの要素と、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルの要素とを並べて得られる連結ベクトルを、前記第2ドメインにおける低次元化処理のパラメーターに基づいて低次元化し、低次元化した結果である第2低次元化ベクトルを出力する第2低次元化部、を具備し、前記第2デコーダー部は、前記第2低次元化部が出力する前記第2低次元化ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成し、前記文対の目的言語による文と、前記第2デコーダー部からの前記出力文との差に基づいて、前記第2低次元化部における低次元化処理のパラメーターをも更新する、ものである。 [3] In addition, in the above learning device, an element of a second semantic vector output as a result of encoding processing by the second encoder unit and an element of the second semantic vector output as a result of encoding processing by the shared encoder unit are The concatenated vector obtained by arranging the elements of the common semantic vector to be output is reduced in dimension based on the parameters of the dimension reduction processing in the second domain, and the second reduced dimension vector that is the result of the reduction in dimension is output. and the second decoder unit is configured based on the second reduced-order vector output by the second order reduction unit and the parameters of the decoding process in the second domain. to generate an output sentence corresponding to the input sentence, and based on the difference between the sentence in the target language of the sentence pair and the output sentence from the second decoder unit, It also updates the parameters of the dimensioning process.
[4]また、本発明の一態様は、上記の学習装置において、前記第1エンコーダー部によるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第1直交誤差を算出する第1直交誤差算出部と、前記第2エンコーダー部によるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第2直交誤差を算出する第2直交誤差算出部と、を具備し、前記文対の目的言語による文と前記第1デコーダー部から出力される前記出力文との差とともに、前記第1直交誤差算出部が算出した前記第1直交誤差にも基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、前記文対の目的言語による文と前記第2デコーダー部から出力される前記出力文との差とともに、前記第2直交誤差算出部が算出した前記第2直交誤差にも基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新する、ものである。 [4] Further, according to one aspect of the present invention, in the above learning device, a first semantic vector output as a result of encoding processing by the first encoder unit and a first semantic vector output as a result of encoding processing by the shared encoder unit a first orthogonal error calculation unit that calculates a first orthogonal error that is an orthogonal error with the common semantic vector, a second semantic vector output as a result of encoding processing by the second encoder unit, and a common encoder unit a second orthogonal error calculator that calculates a second orthogonal error that is an orthogonal error between the common semantic vector output as a result of the encoding process, and the sentence in the target language of the sentence pair and the first decoder unit Based on the first orthogonal error calculated by the first orthogonal error calculation unit as well as the difference from the output sentence output from, the encoding processing parameters in the first encoder unit and the encoding in the shared encoder unit updating parameters of processing and parameters of decoding processing in the first decoder unit, and updating the difference between the sentence in the target language of the sentence pair and the output sentence output from the second decoder unit, together with the second orthogonal Also based on the second orthogonal error calculated by the error calculation unit, parameters for encoding processing in the second encoder unit, parameters for encoding processing in the shared encoder unit, and parameters for decoding processing in the second decoder unit. to update the .
[5]本発明の一態様による翻訳装置は、第1ドメインにおけるエンコード処理のパラメーターに基づいて、原言語による入力文のエンコード処理を行う第1エンコーダー部と、前記第1ドメインおよび他のドメインで共有されるエンコード処理のパラメーターに基づいて、前記入力文のエンコード処理を行う共有エンコーダー部と、前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、を具備するものである。 [5] A translation device according to an aspect of the present invention includes: a first encoder unit that encodes an input sentence in a source language based on encoding processing parameters in the first domain; A shared encoder unit that performs encoding processing on the input sentence based on shared encoding processing parameters, a first semantic vector that is output as a result of the encoding processing in the first encoder unit, and encoding in the shared encoder unit A first decoder section for generating an output sentence corresponding to the input sentence based on a common semantic vector output as a result of processing and parameters of the decoding process in the first domain.
[6]また、本発明の一態様は、上記の翻訳装置において、前記第1エンコーダー部によるエンコード処理の結果として出力される第1意味ベクトルの要素と、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルの要素とを並べて得られる連結ベクトルを、前記第1ドメインにおける低次元化処理のパラメーターに基づいて低次元化し、低次元化した結果である第1低次元化ベクトルを出力する第1低次元化部、を具備し、前記第1デコーダー部は、前記第1低次元化部が出力する前記第1低次元化ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成するものである。 [6] Further, in the translation device described above, an element of the first semantic vector output as a result of the encoding process by the first encoder unit and an element of the first semantic vector output as a result of the encoding process by the shared encoder unit are The concatenated vector obtained by arranging the elements of the common semantic vector to be output is reduced in dimension based on the parameters of the dimension reduction processing in the first domain, and the first reduced dimension vector that is the result of the reduction in dimension is output. The first decoder unit is based on the first reduced-order vector output by the first order reduction unit and the parameters of the decoding process in the first domain to generate an output sentence corresponding to the input sentence.
[7]また、本発明の一態様は、上記の翻訳装置において、前記他のドメインの数は、1以上である、というものである。 [7] Further, according to one aspect of the present invention, in the above translation device, the number of the other domains is one or more.
[8]また、本発明の一態様は、上記の翻訳装置において、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとは、上記[1]から[4]までのいずれか一項に記載の学習装置の処理によって求められたものである。 [8] Further, according to one aspect of the present invention, in the translation device described above, parameters for encoding processing in the first encoder unit, parameters for encoding processing in the shared encoder unit, parameters for decoding processing in the first decoder unit, A parameter is obtained by the processing of the learning device described in any one of [1] to [4] above.
[9]また、本発明の一態様は、コンピューターを、第1ドメインにおけるエンコード処理のパラメーターに基づいて、前記第1ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第1エンコーダー部と、第2ドメインにおけるエンコード処理のパラメーターに基づいて、前記第2ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第2エンコーダー部と、前記第1ドメインと前記第2ドメインとで共有されるエンコード処理のパラメーターに基づいて、前記第1ドメインまたは前記第2ドメインのいずれかに属する前記入力文のエンコード処理を行う共有エンコーダー部と、前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、前記第2エンコーダー部におけるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第2デコーダー部と、を具備し、前記第1ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第1エンコーダー部と前記共有エンコーダー部と前記第1デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、前記第2ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第2エンコーダー部と前記共有エンコーダー部と前記第2デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新する、学習装置として機能させるためのプログラムである。 [9] Further, according to one aspect of the present invention, a computer performs encoding processing of an input sentence belonging to the first domain and in a source language based on encoding processing parameters in the first domain. an encoder unit; a second encoder unit that encodes an input sentence belonging to the second domain and in a source language based on encoding processing parameters in the second domain; a shared encoder unit that performs encoding processing of the input sentence belonging to either the first domain or the second domain based on encoding processing parameters shared by the two domains; and encoding processing in the first encoder unit. corresponding to the input sentence based on a first semantic vector output as a result of, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the first domain a first decoder unit that generates an output sentence; a second semantic vector that is output as a result of encoding processing in the second encoder unit; a common semantic vector that is output as a result of encoding processing in the shared encoder unit; and a second decoder unit that generates an output sentence corresponding to the input sentence based on parameters of the decoding process in the second domain, and a pair of source language and target language sentences belonging to the first domain When a certain sentence pair is input as learning data, an output sentence is generated based on the input sentence in the source language through processing by the first encoder unit, the shared encoder unit, and the first decoder unit, and the sentence is parameters for encoding processing in the first encoder unit, parameters for encoding processing in the shared encoder unit, and parameters for decoding processing in the first decoder unit based on the difference between the sentence in the paired target language and the output sentence. parameters, and when a sentence pair, which is a pair of sentences in the source language and the target language belonging to the second domain, is input as learning data, the second encoder unit and the An output sentence is generated by the processing of the shared encoder unit and the second decoder unit, and parameters for encoding processing in the second encoder unit based on the difference between the sentence in the target language of the sentence pair and the output sentence and a program for functioning as a learning device that updates encoding processing parameters in the shared encoder section and decoding processing parameters in the second decoder section.
[10]また、本発明の一態様は、コンピューターを、第1ドメインにおけるエンコード処理のパラメーターに基づいて、原言語による入力文のエンコード処理を行う第1エンコーダー部と、前記第1ドメインおよび他のドメインで共有されるエンコード処理のパラメーターに基づいて、前記入力文のエンコード処理を行う共有エンコーダー部と、前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、を具備する翻訳装置として機能させるためのプログラムである。 [10] Further, according to one aspect of the present invention, a computer includes a first encoder unit that performs encoding processing of an input sentence in a source language based on encoding processing parameters in the first domain, the first domain and other A shared encoder unit that performs encoding processing of the input sentence based on encoding processing parameters shared by the domain, a first semantic vector that is output as a result of the encoding processing in the first encoder unit, and the shared encoder unit. and a first decoder unit that generates an output sentence corresponding to the input sentence based on a common semantic vector output as a result of the encoding process in and parameters of the decoding process in the first domain. It is a program for functioning as
本発明によれば、異なるドメイン間で知識を共有するための学習処理を行える。また、異なるドメイン間で共有した知識(モデル)に基づいて翻訳処理を行える。このような知識の共有のしくみを実現することにより学習データの量を増やすことができるため、翻訳精度を上げることができる。 According to the present invention, learning processing for sharing knowledge between different domains can be performed. In addition, translation processing can be performed based on knowledge (model) shared between different domains. By realizing such a mechanism for sharing knowledge, the amount of learning data can be increased, so that translation accuracy can be improved.
[第1実施形態]
次に、図面を参照しながら、本発明の一実施形態について説明する。本実施形態では、ニューラル機械翻訳モデルを、ドメイン間で共有する部分と、ドメイン内でのみ利用する部分とに分割する。ドメイン間で共有する部分については、複数の機械翻訳システムで共有して学習を行う。
[First embodiment]
Next, one embodiment of the present invention will be described with reference to the drawings. In this embodiment, the neural machine translation model is divided into a part shared between domains and a part used only within the domain. Parts shared between domains are shared by multiple machine translation systems for learning.
図1は、本実施形態による翻訳装置の概略機能構成を示すブロック図である。図示する翻訳装置1を、翻訳モデルの学習を行うための学習装置と捉えることもできる。図示するように、翻訳装置1は、第1入力部11と、第1エンコーダー部12と、第1低次元化部13と、第1デコーダー部14と、第1出力部15と、第2入力部21と、第2エンコーダー部22と、第2低次元化部23と、第2デコーダー部24と、第2出力部25と、共有エンコーダー部31とを含んで構成される。これらの各機能部は、例えば、コンピューターと、プログラムとで実現することが可能である。また、各機能部は、必要に応じて、記憶手段を有する。記憶手段は、例えば、プログラム上の変数や、プログラムの実行によりアロケーションされるメモリである。また、必要に応じて、磁気ハードディスク装置やソリッドステートドライブ(SSD)といった不揮発性の記憶手段を用いるようにしてもよい。また、各機能部の少なくとも一部の機能を、プログラムではなく専用の電子回路として実現してもよい。
FIG. 1 is a block diagram showing a schematic functional configuration of a translation device according to this embodiment. The illustrated
以下において、第1エンコーダー部12や第2エンコーダー部22や共有エンコーダー部31のそれぞれを単に「エンコーダー」と呼ぶ場合がある。また、第1デコーダー部14や第2デコーダー部24のそれぞれを単に「デコーダー」と呼ぶ場合がある。
Hereinafter, each of the
第1エンコーダー部12と、第1低次元化部13と、第1デコーダー部14と、共有エンコーダー部31とを合わせて、第1翻訳モデル部17と呼んでもよい。また、第2エンコーダー部22と、第2低次元化部23と、第2デコーダー部24と、共有エンコーダー部31とを合わせて、第2翻訳モデル部27と呼んでもよい。第1翻訳モデル部17と第2翻訳モデル部27とは、互いに異なるドメインの翻訳モデルとして機能する。
The
ここで、ドメインとは、翻訳処理の対象の文が属する分野である。例えば、旅行会話文、特許文、放送字幕文、新聞文、ニュースアナウンス文などといった括りをドメインとすることができる。なお、上で挙げたドメインは一例であり、一般的なドメインはこれらの例に限らない。便宜的に、第1翻訳モデル部17が対象とするドメインを第1ドメインと呼び、第2翻訳モデル部27が対象とするドメインを第2ドメインと呼ぶ。つまり、翻訳装置1は、第1ドメインおよび第2ドメインという2つのドメイン用の翻訳モデルが統合された構成を持つ。
Here, a domain is a field to which a sentence to be translated belongs. For example, a domain can be a grouping of travel conversation sentences, patent sentences, broadcast caption sentences, newspaper sentences, news announcement sentences, and the like. Note that the domains listed above are only examples, and general domains are not limited to these examples. For convenience, the domain targeted by the first
翻訳装置1は、翻訳処理を行う場合には入力文を翻訳した結果を出力文として出力する。また、翻訳装置1は、入力文と出力文の対の集合を学習データとして取得し、翻訳モデルの機械学習を行う学習装置としても機能し得る。
The
第1入力部11は、外部から、第1ドメインに属する文を取得し、第1エンコーダー部12および共有エンコーダー部31に渡す。第1入力部11は、学習処理時には学習データの文対を取得し、その文対のうちの原言語による文を第1エンコーダー部12および共有エンコーダー部31に渡す。第1入力部11は、翻訳処理時には翻訳対象である原言語による文を取得し、その入力文を第1エンコーダー部12および共有エンコーダー部31に渡す。なお、後段のエンコーダーが処理するために、第1入力部11が入力文の形態素解析処理等を行ってもよい。第1入力部11が、単語ごとに既に分割されている単語列のデータとして表された入力文のデータを取得するようにしてもよい。
The
第1エンコーダー部12は、第1ドメインにおけるエンコード処理のパラメーターに基づいて、第1ドメインに属する入力文であって原言語による入力文のエンコード処理を行う。第1ドメインにおけるエンコード処理のパラメーターは、後述する翻訳処理において参照されるとともに、後述する学習処理においては誤差逆伝搬法等の方法によって更新され得る。第1エンコーダー部12は、第1ドメインに属する入力文のエンコード処理を行うため、後述する学習処理においては、これら第1ドメインに固有の知識を蓄積する作用を持つ。つまり、第1エンコーダー部12は、第1ドメインの特徴を知識として取り出す。
The
第1低次元化部13は、第1エンコーダー部12から出力される意味ベクトルの情報と、共有エンコーダー部31から出力される意味ベクトルとの情報とを合わせた上で、その情報を低次元化する。具体的には、第1低次元化部13は、第1エンコーダー部12から出力される意味ベクトルと、共有エンコーダー部31から出力される意味ベクトルとを連結し、連結後のベクトルを線形変換によって低次元化する。これにより、第1低次元化部13は、第1エンコーダー部12から得られる情報と、共有エンコーダー部31から得られる情報とのうち、翻訳するために有用な部分のみを抽出し、他の部分を排除する作用を有する。第1低次元化部13は、通常の機械翻訳システムが動作するのに十分な次元数の程度まで、前段から取得するベクトルを低次元化する。例えば、第1エンコーダー部12から出力されるベクトルと共有エンコーダー部31から出力されるベクトルとの次元数が同じであれば、両者を単純に連結することにより次元数は2倍になるが、第1低次元化部13は、その次元数を半分に削減する。即ち、第1低次元化部13は、第1エンコーダー部12や共有エンコーダー部31が出力する意味ベクトルの次元数程度までの低次元化を行う。第1低次元化部13が、2つのエンコーダーから出力される情報の一部を削除することにより、後段における計算処理の高速化、効率化が可能となる。つまり、第1低次元化部13は、第1エンコーダー部12からの出力と、共有エンコーダー部31からの出力を基に、第1デコーダー部14に入力するためのデータを作成する。
The first
第1デコーダー部14は、第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、第1ドメインにおけるデコード処理のパラメーターとに基づいて、入力文に対応する出力文を生成する。第1デコーダー部14が生成する出力文は、上記入力文(原言語による文)の翻訳文(目的言語による文)である。つまり、第1デコーダー部14は、第1低次元化部13からの出力を入力として、翻訳先である目的言語の文を出力する。
The
第1出力部15は、第1デコーダー部14によって出力された文を外部に出力する。
The
第2入力部21は、上述した第1入力部11と同様の処理を、第2ドメインに関して実行するものである。その処理の詳細および作用については、既に第1入力部11の説明において述べた通りであるため、ここでは説明を省略する。
The
第2エンコーダー部22は、上述した第1エンコーダー部12と同様の処理を、第2ドメインに関して実行するものである。その処理の詳細および作用については、既に第1エンコーダー部12の説明において述べた通りであるため、ここでは説明を省略する。
The
第2低次元化部23は、上述した第1低次元化部13と同様の処理を、第2ドメインに関して実行するものである。その処理の詳細および作用については、既に第1低次元化部13の説明において述べた通りであるため、ここでは説明を省略する。つまり、第2低次元化部23は、低次元化した結果である第2低次元化ベクトルを出力する。
The second
第2デコーダー部24は、上述した第1デコーダー部14と同様の処理を、第2ドメインに関して実行するものである。その処理の詳細および作用については、既に第1デコーダー部14の説明において述べた通りであるため、ここでは説明を省略する。
The
第2出力部25は、上述した第1出力部15と同様の処理を、第2ドメインに関して実行するものである。その処理の詳細および作用については、既に第1出力部15の説明において述べた通りであるため、ここでは説明を省略する。
The
共有エンコーダー部31は、第1ドメインと第2ドメインとで共有されるエンコード処理のパラメーターに基づいて、第1ドメインまたは第2ドメインのいずれかに属する入力文のエンコード処理を行う。共有エンコーダー部31におけるエンコード処理のパラメーターは、後述する翻訳処理において参照されるとともに、後述する学習処理においては誤差逆伝搬法等の方法によって更新され得る。共有エンコーダー部31は、第1ドメインまたは第2ドメインのいずれかに属する入力文(両ドメインの入力文)のエンコード処理を行うため、後述する学習処理においては、これら両ドメインに共通の知識を蓄積する作用を持つ。つまり、共有エンコーダー部31は、ドメインに共通する特徴を知識として取り出す。
The shared
つまり、翻訳装置1の構成において、1つのドメイン(第1ドメインあるいは第2ドメイン)の翻訳モデルをみたとき、エンコーダー部分が2つに分割されている。その2つとは、当該ドメインに専用のエンコーダーと、他のドメインと共有されるエンコーダーである。このため、第1エンコーダー部12と第1低次元化部13と第1デコーダー部14とは、第1ドメインの学習データを用いた学習処理においてのみ学習される。また、第2エンコーダー部22と第2低次元化部23と第2デコーダー部24とは、第2ドメインの学習データを用いた学習処理においてのみ学習される。これらに対して、共有エンコーダー部31は、第1ドメインおよび第2ドメインのどちらの学習データを利用した場合においても学習される。
That is, in the configuration of the
本実施形態におけるエンコーダーおよびデコーダーのモデルは、再帰型ニューラルネットワーク(RNN,Recurrent Neural Network)の構造をベースとする。あるいは、デコーダーのモデルは、RNNの一種であるLSTM(Long Short-Term Memory)型のニューラルネットワーク構造をベースとしてもよい。再帰型ニューラルネットワーク自体は既存技術によるものである。再帰型ニューラルネットワークは、一般的なニューラルネットワークの一種である。再帰型ニューラルネットワークの特徴として、時系列データを処理することができる。この時系列データは、固定長の系列であっても、可変長の系列であってもよい。例えば時系列データの各要素を単語等として、再帰型ニューラルネットワークは、文を処理することができる。例えば、下記の各文献では、再帰型ニューラルネットワークについて記載されている。 The encoder and decoder models in this embodiment are based on the structure of a recurrent neural network (RNN). Alternatively, the decoder model may be based on an LSTM (Long Short-Term Memory) type neural network structure, which is a type of RNN. The recurrent neural network itself is based on existing technology. A recurrent neural network is one type of general neural network. A feature of recurrent neural networks is that they can process time-series data. This time-series data may be a fixed-length series or a variable-length series. For example, the recursive neural network can process sentences using each element of the time-series data as a word or the like. For example, the following documents describe recurrent neural networks.
参考文献:再帰型ニューラルネットワーク:RNN入門,@kiminaka,2017年02月12日更新,URL:https://qiita.com/kiminaka/items/87afd4a433dc655d8cfd
参考文献:自然言語処理プログラミング勉強会8 リカレントニューラルネット,Graham Neubig,奈良先端科学技術大学院大学,URL:http://www.phontron.com/slides/nlp-programming-ja-08-rnn.pdf
References: Recurrent Neural Networks: Introduction to RNN, @kiminaka, updated on February 12, 2017, URL: https://qiita.com/kiminaka/items/87afd4a433dc655d8cfd
Reference: Natural Language Processing Programming Study Group 8 Recurrent Neural Net, Graham Neubig, Nara Institute of Science and Technology, URL: http://www.phontron.com/slides/nlp-programming-ja-08-rnn.pdf
次に、図2、図3、図4を参照しながら、本実施形態における処理の概略を説明する。 Next, the outline of the processing in this embodiment will be described with reference to FIGS. 2, 3, and 4. FIG.
図2は、本実施形態の、第1エンコーダー部12と第2エンコーダー部22と共有エンコーダー部31とのそれぞれにおける、エンコード処理のモデルを示す概略図である。前述の通り、第1エンコーダー部12と第2エンコーダー部22と共有エンコーダー部31とのそれぞれは、例えば、再帰型ニューラルネットワークを用いて実現される。
FIG. 2 is a schematic diagram showing a model of encoding processing in each of the
同図において、h1,h2,・・・,hMは、入力文に対応する時系列データである。h1,h2,・・・,hMの各々は、入力文に含まれる単語等に対応し、例えばワンホット(one-hot)表現などを用いたベクトルとして表わされ得る。図示する例では、「私/は/京都/に/行く/。」(スラッシュは単語の区切りを表す)という入力文がエンコーダーに入力される。この例のように、句読点等も1つの単語として扱われる。また、W1,W2は、それぞれ、再帰型ニューラルネットワークにおけるパラメーターである。つまり、W1は、ベクトルhiをベクトルeiに変換するための行列である。また、W2は、ベクトルeiをベクトルei+1に変換するための行列である(1≦i≦M-1)。また、行列W2は、ベクトルeMを内容ベクトルc1に変換する際にも用いられる。W1,W2の各々の要素の値は、例えば更新可能なメモリ等で記憶され、機械学習処理によって更新され得る。 In the figure, h 1 , h 2 , . . . , h M are time-series data corresponding to the input sentence. Each of h 1 , h 2 , . In the illustrated example, an input sentence of "I/ha/Kyoto/ni/go/." (forward slashes denote word breaks) is input to the encoder. As in this example, punctuation marks and the like are treated as one word. W 1 and W 2 are parameters in the recurrent neural network, respectively. That is, W1 is a matrix for transforming vector h i into vector e i . W 2 is a matrix for transforming vector e i into vector e i+1 (1≦i≦M−1). The matrix W2 is also used when converting the vector eM into the content vector c1 . The value of each element of W 1 and W 2 can be stored, for example, in updatable memory or the like and updated by machine learning processing.
エンコーダーは順次、時系列の入力を処理し、最終的に入力文に対応する内容ベクトルc1を出力する。つまり、エンコーダーは、最初の入力h1とパラメーターW1とに基づき、ベクトルe1を生成する。次に、エンコーダーは、次の入力h2およびパラメーターW1と、上記のベクトルe1およびパラメーターW2とに基づき、ベクトルe2を生成する。以後同様に、エンコーダーは、入力hi+1およびパラメーターW1と、既に生成されたベクトルeiおよびパラメーターW2とに基づき、ベクトルei+1を生成する(ただし、1≦i≦(M-1))。そして、エンコーダーは、生成されたベクトルei+1とパラメーターW2とに基づいて生成される内容ベクトルc1を出力する。 The encoder sequentially processes the time-series input and finally outputs the content vector c1 corresponding to the input sentence. That is, the encoder generates vector e 1 based on the initial input h 1 and parameter W 1 . The encoder then generates vector e2 based on the next input h2 and parameter W1 and the above vector e1 and parameter W2 . Similarly thereafter, the encoder generates vector e i+1 based on input h i+1 and parameter W 1 and already generated vector e i and parameter W 2 ( where 1≦i≦(M−1)). . The encoder then outputs a content vector c1 generated based on the generated vector e i+1 and the parameter W2 .
内容ベクトルc1は、入力文に対応する時系列データh1,h2,・・・,hMの情報を含むものである。内容ベクトルc1は、例えば、250次元程度のベクトルである。ただし、内容ベクトルc1の次元数は、例えば、250,500,1000,2000等、適宜定められてよい。 The content vector c 1 contains information on the time-series data h 1 , h 2 , . . . , h M corresponding to the input sentence. The content vector c1 is, for example, a vector of about 250 dimensions. However, the number of dimensions of the content vector c1 may be determined as appropriate, such as 250, 500, 1000, 2000, for example.
図3は、本実施形態の、第1デコーダー部14および第2デコーダー部24のそれぞれにおける、デコード処理のモデルを示す概略図である。前述の通り、第1デコーダー部14と第2デコーダー部24のそれぞれは、例えば、再帰型ニューラルネットワークを用いて実現される。
FIG. 3 is a schematic diagram showing a model of decoding processing in each of the
同図において、c2は、デコーダーに入力される内容ベクトルである。また、y1,y2,・・・,yL1は、デコーダーから出力される時系列データである。y1,y2,・・・,yL1は、それぞれ、ワンホット表現などを用いたベクトルであり、単語に対応する。また、W3,W4は、それぞれ、再帰型ニューラルネットワークにおけるパラメーターである。つまり、W3は、ベクトルdiをベクトルdi+1に変換するための行列である(1≦i≦L1-1)。また、W3は、デコーダーに入力されるベクトルc2をベクトルd1に変換する際にも用いられる。また、W4は、ベクトルdiをベクトルyiに変換するための行列である(1≦i≦L1)。W3,W4の要素の値もまた、メモリ等に記憶され、機械学習処理によって更新され得る。 In the figure, c2 is the content vector input to the decoder. y 1 , y 2 , . . . , y L1 are time-series data output from the decoder. y 1 , y 2 , . W 3 and W 4 are parameters in the recurrent neural network, respectively. That is, W 3 is a matrix for transforming vector d i into vector d i+1 (1≦i≦L1−1). W3 is also used when converting vector c2 input to the decoder into vector d1 . W4 is a matrix for transforming vector d i into vector y i (1≦i≦L1). The values of the elements of W 3 and W 4 may also be stored in memory or the like and updated by machine learning processing.
デコーダーは、入力される内容ベクトルc2を基に、系列データY1,Y2,・・・,YL1を生成し、出力する。つまり、デコーダーは、まず入力される内容ベクトルc2とパラメーターW3とに基づき、ベクトルd1を生成する。そして、デコーダーは、ベクトルd1とパラメーターW4とに基づき、最初の出力データy1を生成する。次に、デコーダーは、ベクトルd1と、パラメーターW3と、生成された出力データy1とに基づき、ベクトルd2を生成する。以後同様に、デコーダーは、ベクトルdi-1とパラメーターW3と出力データyi-1とに基づきベクトルdiを生成するとともに、ベクトルdiおよびパラメーターW4とに基づき出力データyiを生成する(ただし、2≦i≦L1)。 The decoder generates and outputs series data Y 1 , Y 2 , . . . , YL1 based on the input content vector c2 . That is, the decoder first generates vector d1 based on the input content vector c2 and parameter W3 . Then the decoder generates the first output data y1 based on vector d1 and parameter W4 . The decoder then generates vector d2 based on vector d1 , parameter W3 , and the generated output data y1 . Similarly, the decoder generates vector d i based on vector d i−1 , parameter W 3 and output data y i−1 , and generates output data y i based on vector d i and parameter W 4 . (where 2≤i≤L1).
デコーダーが出力する時系列データy1,y2,・・・,yL1は、入力される内容ベクトルc2をデコードして得られるデータである。一例として、時系列データy1,y2,・・・,yL1は、「I/go/to/Kyoto/.」(スラッシュは単語の区切りを表す)といった単語列に対応する。ここで、文末を表すピリオドも、一単語として扱うことができる。 The time-series data y 1 , y 2 , . . . , y L1 output by the decoder are data obtained by decoding the input content vector c 2 . As an example , the time-series data y 1 , y 2 , . Here, a period indicating the end of a sentence can also be treated as one word.
図4は、本実施形態の、第1低次元化部13および第2低次元化部23のそれぞれにおける、低次元化の処理を示す概略図である。次に述べる通り、第1低次元化部13および第2低次元化部23は、ニューラルネットワークを用いて実現される。
FIG. 4 is a schematic diagram showing the order reduction processing in each of the first
同図において、ベクトルhencは、第1エンコーダー部12または第2エンコーダー部22から出力される内容ベクトルである。また、ベクトルhsencは、共有エンコーダー部31から出力される内容ベクトルである。第1低次元化部13または第2低次元化部23は、まず、ベクトルhencとベクトルhsencとを単純に連結し、その連結結果であるベクトルをhconc生成する。次に、第1低次元化部13または第2低次元化部23は、連結されたベクトルhconcと、パラメーターWlowdとに基づき、低次元化されたベクトルhlowdを生成する。この低次元化の処理は、例えば、線形変換を用いて行われる。このパラメーターWlowdは、行列であり、その行列の要素は学習処理によって更新され得る値である。つまり、ベクトルhconcに行列Wlowdを乗ずることによって、また適宜ベクトルを転地することによって、ベクトルhlowdが得られる。
In the figure, vector h enc is the content vector output from the
具体的には、第1低次元化部13は、第1エンコーダー部12から出力されるベクトルhencと共有エンコーダー部31から出力されるベクトルhsencとを連結し、さらに低次元化することによって、低次元化されたベクトルhlowdを生成する。第1低次元化部13は、生成したベクトルhlowdを第1デコーダー部14に渡す。また、第2低次元化部23は、第2エンコーダー部22から出力されるベクトルhencと共有エンコーダー部31から出力されるベクトルhsencとを連結し、さらに低次元化することによって、低次元化されたベクトルhlowdを生成する。第2低次元化部23は、生成したベクトルhlowdを第2デコーダー部24に渡す。
Specifically, the first
ベクトルhencとベクトルhsencの次元数がHであるとき、連結結果であるベクトルhconcの次元数は2Hである。また、低次元化処理の結果であるベクトルhlowdの次元数は、例えば、Hである。このように、第1低次元化部13と第2低次元化部23のそれぞれは、ドメイン固有のエンコード処理結果(ベクトルhenc)と、ドメイン間で共通のエンコード処理結果(ベクトルhsenc)との情報を含みながら、その冗長性を削減した低次元化ベクトルhlowdを出力する。第1低次元化部13や第2低次元化部23を持つことにより、翻訳装置1は、リーズナブルな計算資源を用いて翻訳モデルを実現する。
When the number of dimensions of vector h enc and vector h senc is H, the number of dimensions of vector h conc , which is the result of concatenation, is 2H. Also, the number of dimensions of the vector h lowd , which is the result of the dimension reduction process, is H, for example. In this way, each of the first
次に、翻訳装置1の、学習処理時および翻訳処理時のそれぞれの処理手順について、フローチャートを参照しながら説明する。
Next, the processing procedures of the
図5は、本実施形態による翻訳装置の、学習処理の手順を示すフローチャートである。この学習処理の前提として、外部から大量の学習データが与えられる。学習データは、原言語による入力文と目的言語による出力文(正解文)の対の集合である。学習データに含まれる各文対は、第1ドメインまたは第2ドメインのいずれかに属するものであり、どのドメインに属するものであるかは既知である。以下、このフローチャートに沿って、学習処理の手順を説明する。 FIG. 5 is a flow chart showing the procedure of learning processing of the translation device according to the present embodiment. As a prerequisite for this learning process, a large amount of learning data is given from the outside. The learning data is a set of pairs of input sentences in the source language and output sentences (correct sentences) in the target language. Each sentence pair included in the learning data belongs to either the first domain or the second domain, and it is known to which domain it belongs. The procedure of the learning process will be described below along this flow chart.
ステップS1において、翻訳装置1は、外部から与えられる学習データのうち、未処理の文対の1つを選択する。
In step S1, the
ステップS2において、翻訳装置1は、ステップS1で選択された文対が第1ドメインに属するものであるか否かを判定し、判定結果に応じて処理を分岐する。ある文対が第1ドメインまたは第2ドメインのいずれに属するものであるかを表す情報は、学習データの一部として与えられている。当該文対が第1ドメインに属するものである場合(ステップS2:YES)、第1入力部11が当該文対を処理し、次にステップS3に進む。当該文対が第1ドメインに属するものでない場合、即ち当該文対が第2ドメインに属するものである場合(ステップS2:NO)、第2入力部21が当該文対を処理し、次にステップS7に進む。ステップS3に進む場合には、ステップS3からS6までの処理を順次行った後で、ステップS11に移る。ステップS7に進む場合には、ステップS7からS10までの処理を順次行った後で、ステップS11に移る。
At step S2, the
ステップS3において、第1入力部11は、文対に含まれる入力文を単語ごとに分割し、適宜、時系列のベクトルデータにする。第1入力部11は、この時系列のベクトルデータを、第1エンコーダー部12と共有エンコーダー部31とに渡す。第1エンコーダー部12と共有エンコーダー部31のそれぞれは、第1入力部11から渡された時系列データを処理し、それぞれ、内容ベクトル(図2のベクトルc1)を出力する。この内容ベクトルは、それぞれ、図4に示したベクトルhencとベクトルhsencとにあたる。
In step S<b>3 , the
ステップS4において、第1低次元化部13は、第1エンコーダー部12と共有エンコーダー部31から、それぞれ、ベクトルhencとベクトルhsencを取得する。第1低次元化部13は、図4に示したように、ベクトルhencとベクトルhsencとを連結してベクトルhconcを生成する。そして、第1低次元化部13は、パラメーターWlowdに基づいてベクトルhconcを低次元化し、ベクトルhlowdを出力する。
In step S4, the first
ステップS5において、翻訳装置1は、第1低次元化部13から出力されたベクトルhlowdを、第1デコーダー部14に入力する。第1デコーダー部14は、ベクトルhlowdをデコードする処理を行う。第1デコーダー部14は、デコード処理の結果である時系列データを出力する。出力された時系列データは、必要に応じて単語の列に変換されてもよい。
At step S<b>5 , the
ステップS6において、翻訳装置1は、ステップS5において第1デコーダー部14が出力したデータと、元の入力文対に含まれていた正解データとの誤差を算出する。また、翻訳装置1は、算出された誤差に基づいて、バックプロパゲーション(誤差逆伝搬法)により、第1エンコーダー部12と、第1低次元化部13と、第1デコーダー部14と、共有エンコーダー部31の中のパラメーターを調整する。つまり、翻訳装置1は、バックプロパゲーションにより、これらのパラメーターの値を更新する。具体的には、更新対象のパラメーターは、第1エンコーダー部12におけるW1とW2(図2参照)、第1低次元化部13におけるWlowd(図4参照)、第1デコーダー部14におけるW3とW4(図3参照)、そして、共有エンコーダー部31におけるW1とW2(図2参照)である。つまり、機械学習処理により、第1翻訳モデル部17内のパラメーターが更新される。
In step S6, the
ステップS7にからS10おいて、翻訳装置1の第2入力部21、第2エンコーダー部22、第2低次元化部23、第2デコーダー部24、および共有エンコーダー部31は、ステップS3からS6で説明した処理と同様の処理を行う。ただし、ステップS3からS6までの処理が第1ドメインに関する処理であったのに対して、ステップS7にからS10までの処理は第2ドメインに関する処理である。この一連の処理の結果として、第2ドメインに属する学習データに基づいて、機械学習処理により、第2翻訳モデル部27内のパラメーターが更新される。具体的には、更新対象のパラメーターは、第2エンコーダー部22におけるW1とW2(図2参照)、第2低次元化部23におけるWlowd(図4参照)、第2デコーダー部24におけるW3とW4(図3参照)、そして、共有エンコーダー部31におけるW1とW2(図2参照)である。
In steps S7 to S10, the
ステップS6またはステップS10のいずれかの処理が終了すると、ステップS11に移る。 After completing either step S6 or step S10, the process proceeds to step S11.
ステップS11において、学習データの処理がすべて終了したか否かを判定する。学習データの処理がすべて終了した場合(ステップS11:YES)には、本フローチャートの処理全体を終了する。学習データの処理のすべてが完了していない場合、即ち、未処理の学習データが1文対以上残っている場合(ステップS11:NO)には、次の文対を処理するために、ステップS1に戻る。 In step S11, it is determined whether or not the processing of all the learning data has been completed. If all learning data processing is completed (step S11: YES), the entire processing of this flowchart is completed. If all the processing of the learning data has not been completed, that is, if one or more sentence pairs remain unprocessed learning data (step S11: NO), step S1 is performed to process the next sentence pair. back to
上で説明したように、学習処理時には、翻訳装置1は、大量の学習データ(例えば、日本語の文と、その日本語文を英訳して得られた英語の文との、対の集合)を用いて、エンコーダー内、デコーダー内、低次元化部内の、パラメーターを修正する。
As described above, during the learning process, the
一例として、学習データの文対が、日本語の「私は京都に行く。」と英語の「I go to Kyoto.」(正解文)であり、且つ上記日本語文を翻訳処理した結果(デコーダーからの出力)が「I went to Tokyo.」(出力文)である場合の処理は、次の通りである。正解文と出力文と差は、次の通りである。第1に、正解文における「go」に対応して、出力文では「went」が出力されている。第2に、正解文における「Kyoto」に対応して、出力文では「Tokyo」が出力されている。これらの差に基づいて、翻訳装置1は、例えば交差クロスエントロピーによる損失関数の値を計算する。つまり、翻訳装置1は、誤差を算出する。そして、翻訳装置1は、その誤差を小さくするようにパラメーター値の学習を実施する。
As an example, the sentence pair of the training data is Japanese "I go to Kyoto." and English "I go to Kyoto." (output) is "I went to Tokyo." (output sentence), the processing is as follows. The correct sentence, the output sentence, and the difference are as follows. First, "went" is output in the output sentence corresponding to "go" in the correct sentence. Second, "Tokyo" is output in the output sentence corresponding to "Kyoto" in the correct sentence. Based on these differences, the
なお、ここでは、一例として、学習データに含まれる文対が日本語文(入力側)と英語文(出力側)である場合を説明したが、入力側と出力側の言語が逆でもよい。また、日本語と英語以外の言語による文が学習データに含まれていてもよい。 Here, as an example, a sentence pair included in the learning data is a Japanese sentence (input side) and an English sentence (output side), but the languages of the input side and the output side may be reversed. Also, the learning data may include sentences in languages other than Japanese and English.
以上において説明したように、学習処理において、翻訳装置1は、第1ドメインに属する学習データに基づき、第1ドメインの文の特徴を用いて、第1エンコーダー部12、第1低次元化部13、第1デコーダー部14におけるパラメーターを更新する。また、翻訳装置1は、第1ドメインに属する学習データに基づき、第2ドメインの文の特徴を用いて、第2エンコーダー部22、第2低次元化部23、第2デコーダー部24におけるパラメーターを更新する。また、翻訳装置1は、第1ドメインの文および第2ドメインの両方の文の特徴を用いて、共有エンコーダー部31のパラメーターを更新する。つまり、学習処理により、各パラメーターの値は、第1ドメインあるいは第2ドメインの特徴を表すようになる。
As described above, in the learning process, the
つまり、学習処理は、次の通りの処理である。学習処理は、第1ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には原言語による入力文を基に第1エンコーダー部12と共有エンコーダー部31と第1デコーダー部14との処理によって出力文を生成し、文対の目的言語による文と、当該出力文との差に基づいて、第1エンコーダー部12におけるエンコード処理のパラメーターと、共有エンコーダー部31におけるエンコード処理のパラメーターと、第1デコーダー部14におけるデコード処理のパラメーターとを更新する。この場合、学習処理は、さらに、第1低次元化部13のパラメーターを更新する。また、学習処理は、第2ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には原言語による入力文を基に第2エンコーダー部22と共有エンコーダー部31と第2デコーダー部24との処理によって出力文を生成し、文対の目的言語による文と、当該出力文との差に基づいて、第2エンコーダー部22におけるエンコード処理のパラメーターと、共有エンコーダー部31におけるエンコード処理のパラメーターと、第2デコーダー部24におけるデコード処理のパラメーターとを更新する。この場合、学習処理は、さらに、第2低次元化部23のパラメーターを更新する。
That is, the learning process is as follows. In the learning process, when a sentence pair, which is a pair of sentences in the source language and the target language belonging to the first domain, is input as learning data, the
図6は、本実施形態による翻訳装置の、翻訳処理の手順を示すフローチャートである。この翻訳処理の前提として、翻訳装置1内のモデルは予め学習済みである。また、翻訳装置1には外部から、原言語による翻訳対象文が与えられる。翻訳対象文は、第1ドメインまたは第2ドメインのいずれかに属するものであり、どのドメインに属するものであるかは既知である。以下、このフローチャートに沿って、翻訳処理の手順を説明する。
FIG. 6 is a flow chart showing the procedure of translation processing of the translation device according to the present embodiment. As a premise of this translation processing, the model in the
ステップS21において、翻訳装置1は、外部から与えられる入力文を取得する。この入力文は、原言語(例えば、日本語)で記述された翻訳対象の文である。
At step S21, the
ステップS22において、翻訳装置1は、ステップS21で取得された入力文が第1ドメインに属するものであるか否かを判定し、判定結果に応じて処理を分岐する。入力文が第1ドメインまたは第2ドメインのいずれに属するものであるかを表す情報は、入力文とともに与えられる。当該入力文が第1ドメインに属するものである場合(ステップS22:YES)、第1入力部11が当該入力文を処理し、次にステップS23に進む。当該入力文が第1ドメインに属するものでない場合、即ち当該入力文が第2ドメインに属するものである場合(ステップS22:NO)、第2入力部21が当該入力文を処理し、次にステップS27に進む。ステップS23に進む場合には、翻訳装置1は、ステップS23からS26までの処理を順次行う。ステップS7に進む場合には、翻訳装置1は、ステップS27からS30までの処理を順次行う。
At step S22, the
ステップS23において、第1入力部11は、入力文を単語ごとに分割し、適宜、時系列のベクトルデータにする。第1入力部11は、この時系列のベクトルデータを、第1エンコーダー部12と共有エンコーダー部31とに渡す。第1エンコーダー部12と共有エンコーダー部31のそれぞれは、第1入力部11から渡された時系列データを処理し、それぞれ、内容ベクトル(図2のベクトルc1)を出力する。この内容ベクトルは、それぞれ、図4に示したベクトルhencとベクトルhsencとにあたる。
In step S<b>23 , the
ステップS24において、第1低次元化部13は、第1エンコーダー部12と共有エンコーダー部31から、それぞれ、ベクトルhencとベクトルhsencを取得する。第1低次元化部13は、図4に示したように、ベクトルhencとベクトルhsencとを連結してベクトルhconcを生成する。そして、第1低次元化部13は、パラメーターWlowdに基づいてベクトルhconcを低次元化し、ベクトルhlowdを出力する。
In step S24, the first
ステップS25において、翻訳装置1は、第1低次元化部13から出力されたベクトルhlowdを、第1デコーダー部14に入力する。第1デコーダー部14は、ベクトルhlowdをデコードする処理を行う。第1デコーダー部14は、デコード処理の結果である時系列データを出力する。出力された時系列データは、単語の列に変換される。
In step S<b>25 , the
ステップS26において、第1出力部15は、ステップS25において第1デコーダー部14が出力した単語の列を基に、出力文を作成する。第1出力部15は、この出力文を翻訳結果として出力する。
In step S26, the
ステップS27にからS30おいて、翻訳装置1の第2入力部21、第2エンコーダー部22、第2低次元化部23、第2デコーダー部24、第2出力部25、および共有エンコーダー部31は、ステップS23からS26で説明した処理と同様の処理を行う。ただし、ステップS23からS26までの処理が第1ドメインに関する処理であったのに対して、ステップS27にからS30までの処理は第2ドメインに関する処理である。この一連の処理の結果として、第2出力部25は、出力文を翻訳結果として出力する。
In steps S27 to S30, the
ステップS26またはステップS30のいずれかの処理が終了すると、翻訳装置1は、本フローチャート全体の処理を終了する。
When the process of either step S26 or step S30 ends,
一例として、入力文が「彼は京都に出かけた。」であり、当該入力文が第2ドメイン(例えば、旅行会話のドメイン)である場合、翻訳装置1は次の処理を行う。第2ドメインの翻訳モデルを持つ翻訳装置1は、第2エンコーダー部22および共有エンコーダー部31において、それぞれ、内容ベクトルhencおよびhsencを獲得する。第2低次元化部23は、これらの内容ベクトルhencおよびhsencを基に、低次元化の処理を行い、ベクトルhlowdを獲得する。第2デコーダー部24は、ベクトルhlowdに基づいて、出力単語列「He/went/to/Kyoto/.」を出力する。第2出力部25は、第2デコーダー部24の出力に基づき、翻訳結果である出力文「He went to Kyoto.」を出力する。
As an example, when the input sentence is "He went to Kyoto."
以上説明したように、本実施形態では、翻訳装置1は、それぞれのドメインに対応した複数(2個)の翻訳モデルを有する。また、翻訳装置1は、各翻訳モデルにおいて、各ドメインに固有の部分(第1エンコーダー部12、第1低次元化部13、第1デコーダー部14、第2エンコーダー部22、第2低次元化部23、第2デコーダー部24)と、複数のドメインによって共有される部分(共有エンコーダー部31)とを有する。翻訳装置1は、あるドメインに属する学習データを用いて学習処理を行うときには、当該ドメインに固有の部分と、上記の共有部分との学習を行い、モデルのパラメーターを更新する。このような構成により、ドメインに固有の知識は、上記のドメインに固有の部分に蓄積される。また、ドメイン間に跨る共通の知識は、上記の共有部分に蓄積される。つまり、あるドメインの翻訳モデルは、当該ドメインに属する学習データによる固有部分のモデルの学習だけでではなく、他のドメインに属する学習データによる共有部分のモデルの学習を行うことができる。つまり、他のドメインの学習データをも用いて、当該ドメインのモデルの学習を行うことができる。つまり、準備する学習データの量に対して、学習処理の量を多くすることができる。即ち、学習データを効率化することができる。学習データを準備することが高コストな作業であることが多いが、本実施形態では、学習のために必要なコスト(学習データを準備するコスト)を削減することができる。
As described above, in this embodiment, the
一例として、第1ドメインがニュースアナウンス文であり、第2ドメインがテレビ番組の字幕テキストである場合には、本実施形態は次の貢献をする。第1ドメインのニュースアナウンス文を準備するためには高コストを要する。第2ドメインのテレビ番組の字幕テキストに関しては、学習データとして、既存の大量の資産を低コストで利用することができる。第1ドメインの学習データは、ニュース特有の言い回しを含めた文の表現を学習するために貢献する。第2ドメインの学習データは、アナウンスされるニュース原稿の文(話し言葉)ではないが、政治、経済、スポーツ、エンターテインメント等、様々な分野の文の表現(語彙等)を豊富にする学習のために貢献する。本実施形態の共有エンコーダー部31は、第1ドメインの学習データだけからではなく、第2ドメインの学習データから得られる知識をも蓄積する。第1デコーダー部14は、第1ドメインに専用の知識と、共有エンコーダー部31のモデルに蓄積されるドメインに共通の知識とを反映した結果である出力文を出力する。
As an example, if the first domain is news announcement text and the second domain is television program closed caption text, the present embodiment contributes the following. It is expensive to prepare the news announcement text for the first domain. As for the subtitle texts of the television programs in the second domain, a large amount of existing resources can be used as learning data at low cost. The learning data of the first domain contributes to learning expressions of sentences including expressions peculiar to news. The learning data of the second domain is not the news manuscript sentences (spoken language) to be announced, but for learning to enrich sentence expressions (vocabulary, etc.) in various fields such as politics, economics, sports, entertainment, etc. To contribute. The shared
第1低次元化部13は、線形変換により、ベクトルの次元数を少なくする処理を行う。第1低次元化部13は、第1デコーダー部14が適切な出力を行うために十分な次元数まで、入力されるベクトルを低次元化する。つまり、第1低次元化部13の処理によって、第1エンコーダー部12と共有エンコーダー部31の出力に含まれる、冗長な情報を削除することができる。これにより、計算の高速化、効率化が可能となる。
The first
以上、第1ドメインの翻訳モデルについて主に説明したが、翻訳装置1において、第1ドメインと第2ドメインとは対称な関係にあり、上記の説明は第2ドメインの翻訳モデルについても言えることである。
Although the translation model for the first domain has been mainly described above, the first domain and the second domain have a symmetrical relationship in the
[第2実施形態]
次に、本発明の第2実施形態について説明する。なお、前実施形態において既に説明した事項については以下において説明を省略する場合がある。ここでは、本実施形態に特有の事項を中心に説明する。
[Second embodiment]
Next, a second embodiment of the invention will be described. In addition, description may be abbreviate|omitted below about the matter already demonstrated in the previous embodiment. Here, the description will focus on matters specific to this embodiment.
図7は、本実施形態による翻訳装置(学習装置)の概略機能構成を示すブロック図である。図示するように、翻訳装置2は、第1入力部11と、第1エンコーダー部12と、第1デコーダー部14と、第1出力部15と、第2入力部21と、第2エンコーダー部22と、第2デコーダー部24と、第2出力部25と、共有エンコーダー部31とを含んで構成される。本実施形態において、第1エンコーダー部12と、第1デコーダー部14と、共有エンコーダー部31とを合わせて、第1翻訳モデル部217と呼んでもよい。また、第2エンコーダー部22と、第2デコーダー部24と、共有エンコーダー部31とを合わせて、第2翻訳モデル部227と呼んでもよい。第1翻訳モデル部217と第2翻訳モデル部227とは、互いに異なるドメインの翻訳モデルとして機能する。
FIG. 7 is a block diagram showing a schematic functional configuration of the translation device (learning device) according to this embodiment. As illustrated, the
つまり、本実施形態における翻訳装置2は、第1実施形態における翻訳装置1と異なり、第1低次元化部や第2低次元化部を持たない。即ち、翻訳装置2は、第1エンコーダー部12から出力された意味ベクトルと、共有エンコーダー部31から出力された意味ベクトルとを連結するものの、連結されたベクトルの低次元化の処理を行わない。第2エンコーダー部22から出力された意味ベクトルと、共有エンコーダー部31から出力された意味ベクトルとを連結して得られるベクトルは、低次元化されることなく、そのまま第1デコーダー部14への入力として用いられる。また、第2エンコーダー部22から出力された意味ベクトルと、共有エンコーダー部31から出力された意味ベクトルとについても、同様に、連結された後に低次元化されず、そのまま第2デコーダー部24への入力として用いられる。
That is, unlike the
本実施形態の上記の構成によれば、低次元化処理を用いずに、翻訳モデルの学習処理を行ったり、学習済みの翻訳モデルを用いた機械翻訳処理を行ったりすることが、可能となる。 According to the above configuration of the present embodiment, it is possible to perform translation model learning processing or perform machine translation processing using a trained translation model without using dimensionality reduction processing. .
[第3実施形態]
次に、本発明の第3実施形態について説明する。なお、前実施形態までにおいて既に説明した事項については以下において説明を省略する場合がある。ここでは、本実施形態に特有の事項を中心に説明する。
[Third embodiment]
Next, a third embodiment of the invention will be described. In addition, description may be abbreviate|omitted below about the matter already demonstrated by the previous embodiment. Here, the description will focus on matters specific to this embodiment.
図8は、本実施形態による翻訳装置(学習装置)の概略機能構成を示すブロック図である。図示するように、翻訳装置3は、n個(n≧3)のドメインのそれぞれに関して、翻訳処理および学習処理を行う。具体的には、翻訳装置3は、第1ドメインから第nドメインまでの翻訳モデルを含んで構成される。そして、翻訳装置3における第iドメイン(1≦i≦n)の翻訳モデルは、第i入力部i-1と、第iエンコーダー部i-2と、第i低次元化部i-3と、第iデコーダー部i-4と、第i出力部i-5と、共有エンコーダー部331とを含んで構成される。共有エンコーダー部331は、第1ドメインから第nドメインまでの複数の翻訳モデルによって共有される。
FIG. 8 is a block diagram showing a schematic functional configuration of a translation device (learning device) according to this embodiment. As illustrated, the
本実施形態では、翻訳装置3は、学習処理の際、第1ドメインから第nドメインまでのいずれかのドメインに属する文対(原言語および目的言語で記述された文)を取得する。翻訳装置3は、第iドメイン(1≦in)に属する文対を用いて、第iドメインの翻訳モデルに含まれるパラメーター(共有エンコーダー部331のパラメーターを含む)を学習する。翻訳装置3は、翻訳処理の際、第1ドメインから第nドメインまでのいずれかのドメインに属する入力文(原言語文)を取得する。翻訳装置3は、第iドメインの翻訳モデルを用いて、当該入力文に対応する翻訳文(目的言語文)を出力する。
In this embodiment, the
本実施形態によれば、2つのドメインに限らず、3つ以上のドメインにおいて翻訳のための知識を共有することができる。言い換えれば、翻訳装置3の共有エンコーダー部331は、3つ以上のドメインに属する文対を用いて学習されるため、これらすべてのドメインの文対に基づくパラメーターを有する。
According to this embodiment, knowledge for translation can be shared not only in two domains but also in three or more domains. In other words, since the shared
なお、図8に示した構成では、第iドメインの翻訳モデルは、第i低次元化部i-3を備えていた。この第i低次元化部i-3を省略して実施してもよい。内容ベクトルを低次元化する機能を省略した構成の詳細については、既に第2実施形態において説明した通りである。つまり、第3実施形態と第2実施形態とを組み合わせて実施するようにしてもよい。 In the configuration shown in FIG. 8, the translation model of the i-th domain has the i-th reduction part i-3. This i-th order reduction unit i-3 may be omitted. The details of the configuration omitting the function of reducing the dimensionality of the content vectors are already described in the second embodiment. That is, the third embodiment and the second embodiment may be combined for implementation.
[第4実施形態]
次に、本発明の第4実施形態について説明する。なお、前実施形態までにおいて既に説明した事項については以下において説明を省略する場合がある。ここでは、本実施形態に特有の事項を中心に説明する。
[Fourth embodiment]
Next, a fourth embodiment of the invention will be described. In addition, description may be abbreviate|omitted below about the matter already demonstrated by the previous embodiment. Here, the description will focus on matters specific to this embodiment.
図9は、本実施形態による翻訳装置(学習装置)の概略機能構成を示すブロック図である。図示するように、翻訳装置4は、第1入力部11と、第1エンコーダー部12と、第1低次元化部13と、第1デコーダー部14と、第1出力部15と、第2入力部21と、第2エンコーダー部22と、第2低次元化部23と、第2デコーダー部24と、第2出力部25と、共有エンコーダー部31と、第1直交誤差算出部419と、第2直交誤差算出部429とを含んで構成される。第1入力部11と、第1エンコーダー部12と、第1低次元化部13と、第1デコーダー部14と、第1出力部15と、第2入力部21と、第2エンコーダー部22と、第2低次元化部23と、第2デコーダー部24と、第2出力部25と、共有エンコーダー部31の各部の機能等については、前実施形態までにおいてすでに説明した通りである。本実施形態の特徴は、翻訳装置4が、第1直交誤差算出部419と、第2直交誤差算出部429とを有する点である。
FIG. 9 is a block diagram showing a schematic functional configuration of a translation device (learning device) according to this embodiment. As illustrated, the
第1直交誤差算出部419は、第1エンコーダー部12と共有エンコーダー部31とが同一の入力文をエンコードしたときにそれぞれ出力する意味ベクトル間の直交誤差を算出する。この直交誤差をLdiffとする。直交誤差Ldiffは、正の値として算出される。第1エンコーダー部12から出力される意味ベクトルと共有エンコーダー部31から出力される意味ベクトルとが完全に直交する場合に、直交誤差Ldiffの値は0である。両意味ベクトルの直交の度合いが低くなるほど、直交誤差Ldiffの値は大きくなる。
The first orthogonal
第2直交誤差算出部429は、第2エンコーダー部22と共有エンコーダー部31とが同一の入力文をエンコードしたときにそれぞれ出力する意味ベクトル間の直交誤差Ldiffを算出する。第2直交誤差算出部429が算出する直交誤差の値は、上記の第1直交誤差算出部419が算出する直交誤差の値と、同様のものであり、同様の意味を持つ。
The second
翻訳装置4は、学習処理時に、第1直交誤差算出部419あるいは第2直交誤差算出部429が算出する直交誤差Ldiffにも基づいて、パラメーター値の調整を行う。
During the learning process, the
第1ドメインの翻訳モデルに関して、第1ドメインに属する文対を用いて、第1デコーダー部14が出力する出力文と、当該文対に含まれる正解データ(目的語文)との差に基づいて誤差逆伝搬法を用いることは、第1実施形態等で既に説明した通りである。本実施形態では、翻訳装置4は、第1デコーダー部14が出力する出力文と当該文対に含まれる正解データ(目的語文)との差だけではなく、第1直交誤差算出部419が算出する直交誤差Ldiffをも用いて、誤差逆伝搬法により、パラメーターの更新を行う。出力文と正解データとの誤差をLoutputとした場合、翻訳装置4がパラメーターの更新のために用いる総合誤差Lは、下の式で表される。ここで、αおよびβは、それぞれ、適宜設定される重み値である。
Regarding the translation model of the first domain, using a sentence pair belonging to the first domain, an error based on the difference between the output sentence output by the
L=α・Loutput+β・Ldiff L=α·L output +β·L diff
なお、第2直交誤差算出部429が算出する直交誤差Ldiffに基づいた第2ドメインの翻訳モデルのパラメーター更新についても、上述した第1ドメインの翻訳モデルのそれと同様である。
Note that parameter update of the translation model for the second domain based on the orthogonal error L diff calculated by the second
本実施形態によると、第1直交誤差算出部419あるいは第2直交誤差算出部429は、それぞれ、第1エンコーダー部12あるいは第2エンコーダー部22(各ドメインに固有の専用エンコーダー)から出力される意味ベクトルと、共有エンコーダー部31から出力される意味ベクトルとの直交誤差Ldiffを算出する。また、翻訳装置4は、学習処理時に、この直交誤差Ldiffにも基づく誤差伝搬法により、パラメーターを調整する。この学習処理は、第1エンコーダー部12あるいは第2エンコーダー部22から出力されるベクトルと、共有エンコーダー部31から出力されるベクトルとの間の直交性が増す方向に作用する。つまり、充分な量の学習データを用いて学習を行うことにより、第1エンコーダー部12あるいは第2エンコーダー部22から出力されるベクトルと、共有エンコーダー部31から出力されるベクトルとの間の直交性が高まる。これにより、各ドメインに固有の専用エンコーダーのモデルと共有エンコーダーのモデルとが重ならないようになる。即ち、専用エンコーダーのモデルと共有エンコーダーのモデルとの間の冗長性が削減され、効率的に翻訳モデルの学習を行うことができる。
According to the present embodiment, the first
なお、図9に示した構成では、第1ドメインおよび第2ドメインの翻訳モデルは、それぞれ、第1低次元化部13および第2低次元化部23を備えていた。これらの第1低次元化部13および第2低次元化部23を省略して実施してもよい。内容ベクトルを低次元化する機能を省略した構成の詳細については、既に第2実施形態において説明した通りである。つまり、第4実施形態と第2実施形態とを組み合わせて実施するようにしてもよい。
In the configuration shown in FIG. 9, the translation models of the first domain and the second domain are provided with the first
また、図9に示した構成では、ドメイン数は2であった。ドメイン数を3以上として第4実施形態を実施してもよい。つまり、第4実施形態と第2実施形態とを組み合わせて実施するようにしてもよい。さらに、第4実施形態と、第3実施形態と、第2実施形態とを組み合わせて実施するようにしてもよい。 Also, in the configuration shown in FIG. 9, the number of domains was two. The fourth embodiment may be implemented with three or more domains. That is, the fourth embodiment and the second embodiment may be combined for implementation. Furthermore, the fourth embodiment, the third embodiment, and the second embodiment may be combined for implementation.
以上、複数の実施形態を説明したが、次のような変形例による実施をしてもよい。また、組み合わせることが可能な場合において、複数の変形例を組み合わせて実施してもよい。 A plurality of embodiments have been described above, but the following modifications may be implemented. Moreover, when combinations are possible, a plurality of modified examples may be combined and implemented.
[第1変形例]上で説明した実施形態において、翻訳装置(学習装置)が低次元化部を有する場合、すべてのドメインにおいて低次元化部を持つこととした。変形例として、すべてのドメインの翻訳モデルのうちの一部のドメインの翻訳モデルのみが低次元化部を持つようにしてもよい。例えば、2個のドメインのうちの片方のドメインのみに関して低次元化部を持つようにしてもよい。また、例えば、3個以上のドメインのうちの、任意の1個以上のドメインのみに関して低次元化部を持つようにしてもよい。 [First Modification] In the above-described embodiment, when the translation device (learning device) has a dimensionality reduction unit, all domains have the dimensionality reduction unit. As a modification, only some of the domain translation models among all the domain translation models may have the dimensionality reduction portion. For example, only one of the two domains may have a dimension reduction part. Also, for example, only one or more arbitrary domains among three or more domains may have a dimensionality reduction unit.
[第2変形例]ドメインとして、ニュースアナウンス文や放送字幕文等のドメインを例示して説明した箇所があるが、他のドメインに上記の各実施形態を適用してもよい。 [Second Modification] Although domains such as news announcement sentences and broadcast subtitle sentences have been described as examples of domains, the above embodiments may be applied to other domains.
[第3変形例]上記の各実施形態では、単一の装置が、学習装置と翻訳装置とを兼ねる場合を説明した。変形例として、学習装置と翻訳装置とが別の装置であってもよい。この場合、学習装置における学習処理の結果として得られる知識(パラメーターの数値等)を、例えばデータファイルとして翻訳装置側にコピーすることにより、翻訳装置は、その学習結果を用いた翻訳処理を行うことができる。 [Third Modification] In each of the above-described embodiments, a single device serves as both a learning device and a translation device. As a modification, the learning device and the translation device may be separate devices. In this case, by copying the knowledge (numerical values of parameters, etc.) obtained as a result of the learning process in the learning device to the translation device side as, for example, a data file, the translation device performs translation processing using the learning result. can be done.
なお、上述した実施形態(変形例を含む)における翻訳装置(学習装置)の少なくとも一部の機能をコンピューターで実現することができる。その場合、この機能を実現するためのプログラムをコンピューター読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピューターシステムに読み込ませ、実行することによって実現しても良い。なお、ここでいう「コンピューターシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピューター読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM、DVD-ROM、USBメモリ等の可搬媒体、コンピューターシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピューター読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、一時的に、動的にプログラムを保持するもの、その場合のサーバーやクライアントとなるコンピューターシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピューターシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。 At least part of the functions of the translation device (learning device) in the above-described embodiments (including modifications) can be realized by a computer. In that case, a program for realizing this function may be recorded in a computer-readable recording medium, and the program recorded in this recording medium may be read into a computer system and executed. It should be noted that the "computer system" referred to here includes hardware such as an OS and peripheral devices. In addition, “computer-readable recording media” refers to portable media such as flexible discs, magneto-optical discs, ROMs, CD-ROMs, DVD-ROMs, USB memories, and storage devices such as hard disks built into computer systems. Say things. In addition, "computer-readable recording medium" means a medium that temporarily and dynamically retains a program, such as a communication line for transmitting a program via a network such as the Internet or a communication line such as a telephone line. , it may also include something that holds the program for a certain period of time, such as a volatile memory inside a computer system that serves as a server or client in that case. Further, the program may be for realizing part of the functions described above, or may be a program capable of realizing the functions described above in combination with a program already recorded in the computer system.
以上において説明した実施形態および変形例の特徴をまとめると、次の通りである。 The features of the embodiment and modifications described above are summarized as follows.
第1低次元化部または第2低次元化部の少なくともいずれかを有する場合、次の通りである。第1低次元化部13は、第1エンコーダー部12によるエンコード処理の結果として出力される第1意味ベクトルの要素と、共有エンコーダー部31によるエンコード処理の結果として出力される共通意味ベクトルの要素とを並べて得られる連結ベクトルを、第1ドメインにおける低次元化処理のパラメーターに基づいて低次元化し、低次元化した結果である第1低次元化ベクトルを出力する。このとき、第1デコーダー部14は、第1低次元化部13が出力する第1低次元化ベクトルと、第1ドメインにおけるデコード処理のパラメーターとに基づいて、入力文に対応する出力文を生成する。この場合の学習処理としては、学習データに含まれる文対の目的言語による文と、第1デコーダー部14からの出力文との差に基づいて、第1低次元化部13における低次元化処理のパラメーターをも更新する。なお、第2低次元化部23についても、ここで説明した第1低次元化部13と同様である。
In the case of having at least one of the first order reduction section and the second order reduction section, it is as follows. The first
エンコーダー出力間の直交誤差に基づく学習を行う場合には、次の通りである。即ち、学習装置は、第1直交誤差算出部419と第2直交誤差算出部429とを具備する。第1直交誤差算出部419は、第1エンコーダー部12によるエンコード処理の結果として出力される第1意味ベクトルと、共有エンコーダー部31によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第1直交誤差を算出する第2直交誤差算出部429は、第2エンコーダー部22によるエンコード処理の結果として出力される第2意味ベクトルと、共有エンコーダー部31によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第2直交誤差を算出する。逆誤差伝搬法等によるパラメーターの調整においては、学習データの文対の目的言語による文と第1デコーダー部14から出力される出力文との差とともに、第1直交誤差算出部419が算出した第1直交誤差にも基づいて、第1エンコーダー部12におけるエンコード処理のパラメーターと、共有エンコーダー部31におけるエンコード処理のパラメーターと、第1デコーダー部14におけるデコード処理のパラメーターとを更新する。さらに、低次元化部を有する場合には、低次元化処理のパラメーターをも更新する。また、学習データの文対の目的言語による文と第2デコーダー部24から出力される出力文との差とともに、第2直交誤差算出部429が算出した第2直交誤差にも基づいて、第2エンコーダー部22におけるエンコード処理のパラメーターと、共有エンコーダー部31におけるエンコード処理のパラメーターと、第2デコーダー部24におけるデコード処理のパラメーターとを更新する。さらに、低次元化部を有する場合には、低次元化処理のパラメーターをも更新する。なお、上記の直交誤差に基づくパラメーターの調整を全ドメインのうちの一部のドメインのみに関して実施するようにしてもよい。
When performing learning based on the quadrature error between encoder outputs, it is as follows. That is, the learning device includes a first
少なくとも、翻訳装置における、第1エンコーダー部12におけるエンコード処理のパラメーターと、共有エンコーダー部31におけるエンコード処理のパラメーターと、第1デコーダー部14におけるデコード処理のパラメーターとは、上記実施形態における学習処理によって求められたものとしてよい。低次元化処理のためのパラメーターについても同様である。他のドメインのパラメーターについても同様である。
At least the parameters for the encoding process in the
以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 Although the embodiment of the present invention has been described in detail with reference to the drawings, the specific configuration is not limited to this embodiment, and design and the like are included within the scope of the gist of the present invention.
[実証実験]
実証実験の結果を以下において説明する。実証実験においては、原言語を英語とし、目的言語を日本語とした。第1ドメインの言語資源として特許コーパス(NTCIR, NII Testbeds and Community for Information access Research) を用いた。第2ドメインとして、科学技術論文(ASPEC)を用いた。評価結果には第1ドメインの特許コーパス(NTCIR)のテストセットを用いた。第1の評価対象手法は、第1ドメインの特徴を知識として取り出す第1エンコーダー部(12)と、ドメインに共通する特徴を知識として取り出す共有エンコーダー部(31)を利用した翻訳モデルによるものである。
第2の評価対象手法は、上記第1の評価手法の構成に加えて、第1エンコーダー部と共有エンコーダー部のパラメーター学習の際に、これら両エンコーダーからの出力間の直交性に関する制約を加えたもの(第4実施形態)である。第1の比較対象の手法は、第1ドメインと第2ドメインとをそれぞれ独立に学習させたものである。第2の比較対象の手法は、先行研究における最新手法の1つである、コーパスの先頭にドメインタグ(例:<NTCIR>)を付与する手法である。第2の比較対象の手法は、下の文献に記載されている。
[Demonstration experiment]
The results of the demonstration experiment are described below. In the demonstration experiment, the original language was English and the target language was Japanese. A patent corpus (NTCIR, NII Testbeds and Community for Information access Research) was used as the language resource of the first domain. Scientific and technical papers (ASPEC) were used as the second domain. A test set of the first domain patent corpus (NTCIR) was used for the evaluation results. The first evaluation target method is based on a translation model that uses a first encoder section (12) that extracts the features of the first domain as knowledge and a shared encoder section (31) that extracts features common to the domains as knowledge. .
In addition to the configuration of the first evaluation method, the second evaluation method adds a constraint on the orthogonality between the outputs from the first encoder unit and the shared encoder unit when learning the parameters of the first encoder unit and the shared encoder unit. It is a thing (4th Embodiment). The first method for comparison is to independently learn the first domain and the second domain. The second method to be compared is one of the latest methods in previous research, which adds a domain tag (eg <NTCIR>) to the beginning of the corpus. A second comparative approach is described in the literature below.
第2の比較対象の手法に関する文献: Chenhui Chu, Raj Dabre, and Sadao Kurohashi. An empirical comparison of domain adaptation methods for neural machine translation. In Proceedings of ACL, 2017. The literature on the second comparative method: Chenhui Chu, Raj Dabre, and Sadao Kurohashi. An empirical comparison of domain adaptation methods for neural machine translation. In Proceedings of ACL, 2017.
精度の計測は一般的に用いられている機械翻訳の評価尺度BLEUを用いた。BLEUは、その値が高いほど参照訳となる正解に近いと判断される。第1の比較対象の手法では、BLEUスコアは44.2であった。第2の比較対象の手法では、BLEUスコアは46.0であった。第1の評価対象手法では、BLEUスコアは48.1であった。第2の評価対象手法では、BLEUスコアは49.76であった。つまり、上に記載した実施形態である第1および第2の評価対象手法のスコアは、第1および第2の比較対象の手法のスコアよりも高い。つまり、第1および第2の評価対象手法について、良好な評価が得られた。 Accuracy was measured using a commonly used evaluation scale BLEU for machine translation. BLEU is judged to be closer to the correct reference translation as its value increases. In the first comparative approach, the BLEU score was 44.2. In the second comparative approach, the BLEU score was 46.0. In the first evaluated approach, the BLEU score was 48.1. In the second evaluated approach, the BLEU score was 49.76. That is, the scores for the first and second evaluated approaches, which are the embodiments described above, are higher than the scores for the first and second comparative approaches. In other words, good evaluations were obtained for the first and second evaluation target methods.
実証実験における翻訳例は、次の通りである。原言語による文は「A data space is established in the memory.」である。これに対する参照訳(目的言語による文)は、「メモリ内にはデータ空間が形成される。」である。第1の比較対象の手法による翻訳結果は「このメモリ内にはデータ空間が設けられる。」である。第2の比較対象の手法による翻訳結果は「メモリにはデータ空間が形成される。」である。第1の評価対象手法による翻訳結果は「メモリにはデータ空間が形成される。」である。第2の評価対象手法による翻訳結果は「メモリ内にはデータ空間が形成される。」である。第2の評価対象手法による翻訳結果の出力は、参照訳と同じであり、最も良い結果であることがわかる。 Translation examples in the demonstration experiment are as follows. The sentence in the original language is "A data space is established in the memory." The reference translation (sentence in the target language) for this is "A data space is formed in memory." The translation result by the method for the first comparison is "a data space is provided in this memory". The result of translation by the second method for comparison is "a data space is formed in the memory." The translation result by the first evaluation target method is "a data space is formed in the memory." The translation result by the second evaluation target method is "a data space is formed in the memory". The output of the translation result by the second evaluation target method is the same as the reference translation, and it can be seen that it is the best result.
本発明は、機械翻訳技術に利用することができる。本発明を用いた機械翻訳処理は、例えば、放送事業などのメディア産業にも利用することができる。但し、本発明の利用範囲はここに例示したものには限られない。 INDUSTRIAL APPLICABILITY The present invention can be used for machine translation technology. Machine translation processing using the present invention can also be used, for example, in the media industry such as the broadcasting business. However, the scope of application of the present invention is not limited to those exemplified here.
1,2,3,4 翻訳装置(学習装置)
11 第1入力部
12 第1エンコーダー部
13 第1低次元化部
14 第1デコーダー部
15 第1出力部
17 第1翻訳モデル部
21 第2入力部
22 第2エンコーダー部
23 第2低次元化部
24 第2デコーダー部
25 第2出力部
27 第2翻訳モデル部
31 共有エンコーダー部
217 第1翻訳モデル部
227 第2翻訳モデル部
331 共有エンコーダー部
419 第1直交誤差算出部
429 第2直交誤差算出部
1, 2, 3, 4 translation device (learning device)
11
Claims (4)
第2ドメインにおけるエンコード処理のパラメーターに基づいて、前記第2ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第2エンコーダー部と、
前記第1ドメインと前記第2ドメインとで共有されるエンコード処理のパラメーターに基づいて、前記第1ドメインまたは前記第2ドメインのいずれかに属する前記入力文のエンコード処理を行う共有エンコーダー部と、
前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、
前記第2エンコーダー部におけるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第2デコーダー部と、
前記第1エンコーダー部によるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第1直交誤差を算出する第1直交誤差算出部と、
前記第2エンコーダー部によるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第2直交誤差を算出する第2直交誤差算出部と、
を具備し、
前記第1ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第1エンコーダー部と前記共有エンコーダー部と前記第1デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、
前記第2ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第2エンコーダー部と前記共有エンコーダー部と前記第2デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新し、
前記文対の目的言語による文と前記第1デコーダー部から出力される前記出力文との差とともに、前記第1直交誤差算出部が算出した前記第1直交誤差にも基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、
前記文対の目的言語による文と前記第2デコーダー部から出力される前記出力文との差とともに、前記第2直交誤差算出部が算出した前記第2直交誤差にも基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新する、
学習装置。 a first encoder unit that encodes an input sentence belonging to the first domain and in a source language based on parameters for encoding in the first domain;
a second encoder unit that encodes an input sentence belonging to the second domain in the source language based on parameters for encoding in the second domain;
a shared encoder unit that encodes the input sentence belonging to either the first domain or the second domain based on encoding parameters shared between the first domain and the second domain;
Based on a first semantic vector output as a result of encoding processing in the first encoder unit, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the first domain a first decoder unit for generating an output sentence corresponding to the input sentence;
Based on a second semantic vector output as a result of encoding processing in the second encoder unit, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the second domain a second decoder unit for generating an output sentence corresponding to the input sentence;
calculating a first orthogonal error that is an orthogonal error between a first semantic vector output as a result of encoding processing by the first encoder unit and a common semantic vector output as a result of encoding processing by the shared encoder unit; 1 orthogonal error calculator;
calculating a second orthogonal error that is an orthogonal error between a second semantic vector output as a result of encoding processing by the second encoder unit and a common semantic vector output as a result of encoding processing by the shared encoder unit; a two-orthogonal error calculator;
and
When a sentence pair, which is a pair of sentences in the source language and the target language belonging to the first domain, is input as learning data, based on the input sentence in the source language, the first encoder unit, the shared encoder unit, and the An output sentence is generated by processing with the first decoder unit, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, parameters for encoding processing in the first encoder unit and the shared encoder unit updating the parameters of the encoding process in and the parameters of the decoding process in the first decoder unit,
When a sentence pair, which is a pair of sentences in the source language and the target language belonging to the second domain, is input as learning data, based on the input sentence in the source language, the second encoder unit, the shared encoder unit, and the An output sentence is generated by processing with the second decoder unit, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, parameters for encoding processing in the second encoder unit and the shared encoder unit updating the parameters of the encoding process in and the parameters of the decoding process in the second decoder unit,
Based on the first orthogonal error calculated by the first orthogonal error calculating unit as well as the difference between the sentence in the target language of the sentence pair and the output sentence output from the first decoder unit, the first encoder updating parameters for encoding processing in the unit, parameters for encoding processing in the shared encoder unit, and parameters for decoding processing in the first decoder unit;
Based on the second orthogonal error calculated by the second orthogonal error calculating unit as well as the difference between the sentence in the target language of the sentence pair and the output sentence output from the second decoder unit, the second encoder updating parameters of encoding processing in the unit, parameters of encoding processing in the shared encoder unit, and parameters of decoding processing in the second decoder unit;
learning device.
を具備し、
前記第1デコーダー部は、前記第1低次元化部が出力する前記第1低次元化ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成し、
前記文対の目的言語による文と、前記第1デコーダー部からの前記出力文との差に基づいて、前記第1低次元化部における低次元化処理のパラメーターをも更新する、
請求項1に記載の学習装置。 The concatenated vector obtained by arranging the elements of the first semantic vector output as a result of the encoding process by the first encoder unit and the elements of the common semantic vector output as a result of the encoding process by the shared encoder unit, A first order reduction unit that reduces the order based on the parameters of the order reduction process in the first domain and outputs a first reduced order vector that is the result of the order reduction;
and
The first decoder unit generates an output sentence corresponding to the input sentence based on the first reduced-dimensional vector output by the first reduced-order unit and parameters of decoding processing in the first domain. death,
Also updating parameters for order reduction processing in the first order reduction unit based on the difference between the sentence in the target language of the sentence pair and the output sentence from the first decoder unit;
A learning device according to claim 1.
を具備し、
前記第2デコーダー部は、前記第2低次元化部が出力する前記第2低次元化ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成し、
前記文対の目的言語による文と、前記第2デコーダー部からの前記出力文との差に基づいて、前記第2低次元化部における低次元化処理のパラメーターをも更新する、
請求項1または請求項2に記載の学習装置。 The concatenated vector obtained by arranging the elements of the second semantic vector output as a result of the encoding process by the second encoder unit and the elements of the common semantic vector output as a result of the encoding process by the shared encoder unit, A second order reduction unit that reduces the order based on the parameter of the order reduction process in the second domain and outputs a second order reduction vector that is the result of the order reduction,
and
The second decoder unit generates an output sentence corresponding to the input sentence based on the second reduced-dimensional vector output by the second reduced-order unit and parameters of decoding processing in the second domain. death,
Also updating the parameter of the order reduction processing in the second order reduction unit based on the difference between the sentence in the target language of the sentence pair and the output sentence from the second decoder unit;
3. The learning device according to claim 1 or 2.
第1ドメインにおけるエンコード処理のパラメーターに基づいて、前記第1ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第1エンコーダー部と、
第2ドメインにおけるエンコード処理のパラメーターに基づいて、前記第2ドメインに属する入力文であって原言語による入力文のエンコード処理を行う第2エンコーダー部と、
前記第1ドメインと前記第2ドメインとで共有されるエンコード処理のパラメーターに基づいて、前記第1ドメインまたは前記第2ドメインのいずれかに属する前記入力文のエンコード処理を行う共有エンコーダー部と、
前記第1エンコーダー部におけるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第1ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第1デコーダー部と、
前記第2エンコーダー部におけるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部におけるエンコード処理の結果として出力される共通意味ベクトルと、前記第2ドメインにおけるデコード処理のパラメーターとに基づいて、前記入力文に対応する出力文を生成する第2デコーダー部と、
前記第1エンコーダー部によるエンコード処理の結果として出力される第1意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第1直交誤差を算出する第1直交誤差算出部と、
前記第2エンコーダー部によるエンコード処理の結果として出力される第2意味ベクトルと、前記共有エンコーダー部によるエンコード処理の結果として出力される共通意味ベクトルとの直交誤差である第2直交誤差を算出する第2直交誤差算出部と、
を具備し、
前記第1ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第1エンコーダー部と前記共有エンコーダー部と前記第1デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、
前記第2ドメインに属する原言語および目的言語の文の対である文対が学習データとして入力された場合には前記原言語による入力文を基に前記第2エンコーダー部と前記共有エンコーダー部と前記第2デコーダー部との処理によって出力文を生成し、前記文対の目的言語による文と、当該出力文との差に基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新する、
前記文対の目的言語による文と前記第1デコーダー部から出力される前記出力文との差とともに、前記第1直交誤差算出部が算出した前記第1直交誤差にも基づいて、前記第1エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第1デコーダー部におけるデコード処理のパラメーターとを更新し、
前記文対の目的言語による文と前記第2デコーダー部から出力される前記出力文との差とともに、前記第2直交誤差算出部が算出した前記第2直交誤差にも基づいて、前記第2エンコーダー部におけるエンコード処理のパラメーターと、前記共有エンコーダー部におけるエンコード処理のパラメーターと、前記第2デコーダー部におけるデコード処理のパラメーターとを更新する、
学習装置として機能させるためのプログラム。 the computer,
a first encoder unit that encodes an input sentence belonging to the first domain and in a source language based on parameters for encoding in the first domain;
a second encoder unit that encodes an input sentence belonging to the second domain in the source language based on parameters for encoding in the second domain;
a shared encoder unit that encodes the input sentence belonging to either the first domain or the second domain based on encoding parameters shared between the first domain and the second domain;
Based on a first semantic vector output as a result of encoding processing in the first encoder unit, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the first domain a first decoder unit for generating an output sentence corresponding to the input sentence;
Based on a second semantic vector output as a result of encoding processing in the second encoder unit, a common semantic vector output as a result of encoding processing in the shared encoder unit, and parameters of decoding processing in the second domain a second decoder unit for generating an output sentence corresponding to the input sentence;
calculating a first orthogonal error that is an orthogonal error between a first semantic vector output as a result of encoding processing by the first encoder unit and a common semantic vector output as a result of encoding processing by the shared encoder unit; 1 orthogonal error calculator;
calculating a second orthogonal error that is an orthogonal error between a second semantic vector output as a result of encoding processing by the second encoder unit and a common semantic vector output as a result of encoding processing by the shared encoder unit; a two-orthogonal error calculator;
and
When a sentence pair, which is a pair of sentences in the source language and the target language belonging to the first domain, is input as learning data, based on the input sentence in the source language, the first encoder unit, the shared encoder unit, and the An output sentence is generated by processing with the first decoder unit, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, parameters for encoding processing in the first encoder unit and the shared encoder unit updating the parameters of the encoding process in and the parameters of the decoding process in the first decoder unit,
When a sentence pair, which is a pair of sentences in the source language and the target language belonging to the second domain, is input as learning data, based on the input sentence in the source language, the second encoder unit, the shared encoder unit, and the An output sentence is generated by processing with the second decoder unit, and based on the difference between the sentence in the target language of the sentence pair and the output sentence, parameters for encoding processing in the second encoder unit and the shared encoder unit updating the parameters of the encoding process in and the parameters of the decoding process in the second decoder unit;
Based on the first orthogonal error calculated by the first orthogonal error calculating unit as well as the difference between the sentence in the target language of the sentence pair and the output sentence output from the first decoder unit, the first encoder updating parameters for encoding processing in the unit, parameters for encoding processing in the shared encoder unit, and parameters for decoding processing in the first decoder unit;
Based on the second orthogonal error calculated by the second orthogonal error calculating unit as well as the difference between the sentence in the target language of the sentence pair and the output sentence output from the second decoder unit, the second encoder updating parameters of encoding processing in the unit, parameters of encoding processing in the shared encoder unit, and parameters of decoding processing in the second decoder unit;
A program to function as a learning device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019009658A JP7262231B2 (en) | 2019-01-23 | 2019-01-23 | learning devices and programs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019009658A JP7262231B2 (en) | 2019-01-23 | 2019-01-23 | learning devices and programs |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020119244A JP2020119244A (en) | 2020-08-06 |
JP7262231B2 true JP7262231B2 (en) | 2023-04-21 |
Family
ID=71892093
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019009658A Active JP7262231B2 (en) | 2019-01-23 | 2019-01-23 | learning devices and programs |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7262231B2 (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017151804A (en) | 2016-02-25 | 2017-08-31 | 国立研究開発法人情報通信研究機構 | Automatic translation feature weight optimization device and computer program for the same |
-
2019
- 2019-01-23 JP JP2019009658A patent/JP7262231B2/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017151804A (en) | 2016-02-25 | 2017-08-31 | 国立研究開発法人情報通信研究機構 | Automatic translation feature weight optimization device and computer program for the same |
Non-Patent Citations (2)
Title |
---|
CHENHUI CHU 他2名,A Comprehensive Empirical Comparison of Domain Adaptation Methods for Neural Machine Translation[online],2018年07月,[令和04年11月17日検索],インターネット<URL:https://www.jstage.jst.go.jp/article/ipsjjip/26/0/26_529/_pdf> |
高里盛良 他2名,ニューラルVQAのTOEIC写真問題への領域適応,言語処理学会第24回年次大会 発表論文集[online],日本,言語処理学会,2018年03月05日,264-267頁 |
Also Published As
Publication number | Publication date |
---|---|
JP2020119244A (en) | 2020-08-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10460036B2 (en) | Multi-lingual semantic parser based on transferred learning | |
CN111222347B (en) | Sentence translation model training method and device and sentence translation method and device | |
JP5128629B2 (en) | Part-of-speech tagging system, part-of-speech tagging model training apparatus and method | |
Gaido et al. | End-to-end speech-translation with knowledge distillation: FBK@ IWSLT2020 | |
Shen et al. | Voting between multiple data representations for text chunking | |
Khan et al. | RNN-LSTM-GRU based language transformation | |
CN113590761B (en) | Training method of text processing model, text processing method and related equipment | |
Wang et al. | Bilingual continuous-space language model growing for statistical machine translation | |
CN116324972A (en) | System and method for a multilingual speech recognition framework | |
Adelani et al. | The Effect of Domain and Diacritics in Yor\ub\'a-English Neural Machine Translation | |
EP4235485A1 (en) | Method for converting text data into acoustic feature, electronic device, and storage medium | |
Wang et al. | Word, subword or character? An empirical study of granularity in Chinese-English NMT | |
Rubino et al. | Extremely low-resource neural machine translation for Asian languages | |
Inaguma et al. | Orthros: Non-autoregressive end-to-end speech translation with dual-decoder | |
White et al. | Generating bags of words from the sums of their word embeddings | |
US20220147721A1 (en) | Adapters for zero-shot multilingual neural machine translation | |
JP7262231B2 (en) | learning devices and programs | |
Shi et al. | Adding Visual Information to Improve Multimodal Machine Translation for Low‐Resource Language | |
Gogineni et al. | An effective neural machine translation for english to hindi language | |
Wan et al. | Abstractive document summarization via bidirectional decoder | |
Gaido et al. | Direct speech-to-text translation models as students of text-to-text models | |
JP7375943B2 (en) | Conversion device, conversion method, and program | |
Laitonjam et al. | A hybrid machine transliteration model based on multi-source encoder–decoder framework: English to manipuri | |
Tardy et al. | Leverage unlabeled data for abstractive speech summarization with self-supervised learning and back-summarization | |
Sun et al. | Improving the Robustness of Low-Resource Neural Machine Translation with Adversarial Examples |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211223 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20221122 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20221122 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20221206 |
|
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: 20230314 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230411 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7262231 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |