JP2022018928A - 翻訳装置、翻訳方法及びプログラム - Google Patents
翻訳装置、翻訳方法及びプログラム Download PDFInfo
- Publication number
- JP2022018928A JP2022018928A JP2020122380A JP2020122380A JP2022018928A JP 2022018928 A JP2022018928 A JP 2022018928A JP 2020122380 A JP2020122380 A JP 2020122380A JP 2020122380 A JP2020122380 A JP 2020122380A JP 2022018928 A JP2022018928 A JP 2022018928A
- Authority
- JP
- Japan
- Prior art keywords
- translation
- attention mechanism
- attention
- output
- head
- 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.)
- Granted
Links
- 238000013519 translation Methods 0.000 title claims abstract description 146
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000007246 mechanism Effects 0.000 claims abstract description 49
- 230000006870 function Effects 0.000 claims description 12
- 230000009467 reduction Effects 0.000 claims description 4
- 230000014616 translation Effects 0.000 description 131
- 238000013528 artificial neural network Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 13
- 238000012549 training Methods 0.000 description 12
- 238000002474 experimental method Methods 0.000 description 10
- 230000001537 neural effect Effects 0.000 description 10
- 238000010606 normalization Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 230000009466 transformation Effects 0.000 description 8
- 239000011159 matrix material Substances 0.000 description 6
- 238000011156 evaluation Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 239000013598 vector Substances 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 2
- 101000863927 Streptomyces peucetius Aklanonic acid methyltransferase DnrC Proteins 0.000 description 2
- 101000863926 Streptomyces sp. (strain C5) Aklanonic acid methyltransferase DauC Proteins 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000000052 comparative effect Effects 0.000 description 2
- 230000002542 deteriorative effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- BSYNRYMUTXBXSQ-UHFFFAOYSA-N Aspirin Chemical compound CC(=O)OC1=CC=CC=C1C(O)=O BSYNRYMUTXBXSQ-UHFFFAOYSA-N 0.000 description 1
- 235000008694 Humulus lupulus Nutrition 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000012886 linear function Methods 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 231100000989 no adverse effect Toxicity 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Landscapes
- Machine Translation (AREA)
Abstract
Description
本実施形態に係る翻訳モデルを説明する前に、いくつかの従来技術について説明する。
・エンコーダデコーダモデル
ニューラル機械翻訳は、エンコーダデコーダモデルに基づいて、原言語文から目的言語文への変換を実現する。
初期のニューラル機械翻訳ではエンコーダ及びデコーダのニューラルネットワークとして再帰型ニューラルネットワークを用いていた。また、エンコーダデコーダモデルは、注意機構(以下、単に「注意」ともいう。)を導入することにより、翻訳精度が大きく向上することが知られている。注意機構とは、デコーダにおいて目的言語文の各単語を生成する際に、エンコーダの内部状態に対する重みを変えることで原言語文のどの単語の情報を利用するかを決定する仕組みである。
注意は、1つのクエリ(query)とキー-値ペア(key-value pair)の集合を出力に写像する関数とみなせる。ここで、クエリ、キー、値、出力はすべてベクトルである。出力は値の重み付き和として計算され、それぞれの値に対する重みはクエリとキーの適合度(compatibility)により決まる。
Transformerでは、dmodel次元のクエリ、キー、値について1つの注意を計算する代わりに、学習された重みを使ってクエリ、キー、値をそれぞれdk、dk、dv次元に線形射影(linearly project)することをh回繰り返し、射影されたクエリ、キー、値を使ってh個の注意を並列に計算する。そして、得られたh個のdv次元の注意を連結(concatenate)し、線形射影したものを出力する。この仕組みはマルチヘッド注意と呼ばれ、1つの注意を計算する仕組みはヘッド(head)と呼ばれる。マルチヘッド注意は、異なる表現の異なる位置の情報をモデルが同時に注視(attend)することを可能にする。
エンコーダとデコーダの各層は、各位置で同一の全結合順伝播型ニューラルネットワークを含む。これは、ReLU活性化関数と2つの線形変換から構成される。すなわち、全結合順伝播型ニューラルネットワークが表す関数をFFNとすれば、FFN(x)=max(0,xW1+b1)W2+b2である。なお、W1及びb1は1つ目の線形変換のパラメータ(重み及びバイアス)、W2及びb2は2つ目の線形変換のパラメータである。
入力トークン及び出力トークン(つまり、それぞれ入力文及び出力文のトークン列)は、学習により求めた単語埋め込み行列によりdmodel次元のベクトルに変換する。また、デコーダの出力は、学習により求めた線形変換とソフトマックスにより次のトークンの確率に変換する。入力トークンに対する単語埋め込み行列、出力トークンに対する単語埋め込み行列、ソフトマックスの前の線形変換は同じ重み行列を用いる。単語埋め込み層(図1では「入力埋め込み層」及び「出力埋め込み層」)では、この重みに対して
Transformerは学習が不安定になりやすく、バッチサイズや学習率等のハイパーパラメータの調整が難しいことが知られている。このことの詳細については、例えば、参考文献3「Martin Popel and Ondrej Bojar. Training tips for the transformer model. In The Prague Bulletin of Mathematical Linguistics, No. 110, pp. 43-70, 2018.」等を参照されたい。
メモリネットワークを用いた質問応答では、質問文と文脈の間で注意を計算し、この計算によって得られた注意と文脈の間で再度注意を計算することを繰り返すことで、より回答に近い洗練された注意を得るマルチホップ注意(multi-hop attention)が参考文献5「Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks. In Proceedings of NeurIPS-2015, 2015.」で提案されている。この参考文献5では、注意の計算を3回繰り返すマルチホップ注意が提案されている。
次に、本実施形態で提案する翻訳モデルの構成について説明する。本実施形態に係る翻訳モデルはTransformerと基本的な構成は同じであるが、マルチヘッド注意を統合する際に上記の数6のように単純に連結するのではなく、階層的注意のように各ヘッドの出力に対して注意の計算を行って統合する。この仕組みは注意を2回計算することになり、かつ、このヘッドに対する注意は繰り返し適用することが可能であるため、上記の参考文献5の用語を使用し、本実施形態でも「マルチホップ注意」と呼ぶことにする。以降、「マルチホップ注意」と表記した場合は、本実施形態で提案するマルチホップ注意のことを指すものとする。なお、本実施形態で提案するマルチホップ注意の詳細については後述する。
本実施形態に係るマルチホップ注意について説明する。まず、従来のマルチヘッド注意とマルチホップ注意の比較例を図2に示す。図2の左図が従来のマルチヘッド注意、右図がマルチホップ注意である。図2に示すように、マルチホップ注意は、マルチヘッド注意に対して多層パーセプトロン注意とゲーティング機構を導入したものである。以降では、縮小付き内積注意を一次ホップ、多層パーセプトロン注意及びゲーティング機構を二次ホップと呼ぶことにする。ただし、二次ホップには、必ずしも多層パーセプトロン注意を用いる必要はなく、例えば、縮小付き内積注意が用いられてもよい。
次に、本実施形態に係る翻訳装置10の全体構成について、図4を参照しながら説明する。図4は、本実施形態に係る翻訳装置10の全体構成の一例を示す図である。
次に、本実施形態に係る学習処理の流れについて、図5を参照しながら説明する。図5は、本実施形態に係る学習処理の流れの一例を示すフローチャートである。
次に、本実施形態に係る翻訳処理の流れについて、図6を参照しながら説明する。図6は、本実施形態に係る翻訳処理の流れの一例を示すフローチャートである。
次に、本実施形態に係る翻訳装置10のハードウェア構成について、図7を参照しながら説明する。図7は、本実施形態に係る翻訳装置10のハードウェア構成の一例を示す図である。
次に、本実施形態に係る翻訳装置10を評価するために行った実験及びその結果について説明する。
本実験では、IWSLT2017英独翻訳タスク及びWMT17英独翻訳タスクの対訳コーパスに加え、科学技術論文コーパスAsian Scientific Paper Except Corpus(ASPEC)及びOpenSubtitles2018の日英対訳コーパスを用いた翻訳実験を行った。なお、IWSLT2017の詳細については、例えば、参考文献7「IWSLT Evaluation 2017,インターネット<URL:https://sites.google.com/site/iwsltevaluation2017/>」等を参照されたい。また、WMT17の詳細については、例えば、参考文献8「Translation Task - ACL 2017 Second Conference on Machine Translation,インターネット<URL:http://www.statmt.org/wmt17/translation-task.html>」等を参照されたい。ASPECの詳細については、例えば、参考文献9「Toshiaki Nakazawa, Manabu Yaguchi, Kiyotaka Uchimoto, Masao Utiyama, Eiichiro Sumita, Sadao Kurohashi, and Hitoshi Isahara. Aspec: Asian scientific paper excerpt corpus. In Proceedings of the LREC-2016, pp. 2204-2208, 2016.」等を参照されたい。
本実験では、fairseqのTransformerをベースラインとし、本実施形態に係る翻訳装置10の翻訳モデル(以下、「提案手法」という。)もfairseqを使って実装した。翻訳精度の評価には自動評価手法BLEUを用い、有意差の判定にはmtevalツールを用いブートストラップ法によって検定を行った。訓練はAdamによる最適化を行い、埋め込み層は512次元とし、各隠れ層は2048次元、ヘッド数は8とし、エンコーダ及びデコーダはそれぞれ6層とした。また、IWSLT2017においては100エポック、WMT17、ASPEC及びOpenSubtitles2018においては20エポックの学習を実施した。更に、本実験では、NVIDIA(登録商標)製のグラフィックスカードであるGEFORCE(登録商標) RTX 2080 Tiを1枚使用した。
提案手法とベースラインの翻訳精度を以下の表2に示す。
バッチサイズが小さい場合においても提案手法が安定して収束することを示すために、デフォルトのバッチサイズ4096を基準として、半分の2048、更に半分の1024の設定でベースライン及び翻訳モデルを訓練した。このときの翻訳精度を以下の表3に示す。
IWSLT2017独英翻訳タスクにおける汎化誤差の学習曲線を図8及び図9に示す。図8は学習曲線の全体、図9は汎化誤差が3.800~4.000の範囲で拡大した学習曲線である。図8及び図9に示されるように、提案手法は、ベースラインよりも早期に収束する傾向があることがわかる。
従来のTransformerでは残差接続の後で層正規化を行う(POSTNORM)が、上記の非特許文献2には残差接続の前で層正規化を行うPRENORMと呼ばれる方法が記載されている。上述したように、このPRENORMはTransformerの訓練を安定化できることが示されている。そこで、IWSLT2017独英翻訳タスクにおいて、様々なバッチサイズ及び学習率の下で翻訳精度(BLEUスコア)に関して提案手法と比較する実験を行った。その結果を以下の表4及び表5に示す。
101 翻訳モデル学習部
102 翻訳実行部
201 入力装置
202 表示装置
203 外部I/F
203a 記録媒体
204 通信I/F
205 プロセッサ
206 メモリ装置
Claims (6)
- 原言語の入力文を入力する入力部と、
Transformerのデコーダ及びエンコーダに含まれる複数のマルチヘッド注意機構のうちの少なくとも1つのマルチヘッド注意機構を、前記マルチヘッド注意機構に含まれる縮小付き内積注意機構の出力に対して更に所定の注意機構を適用するマルチホップ注意機構に置き換えたモデルにより、前記入力文を目的言語の出力文に翻訳する翻訳部と、
を有することを特徴とする翻訳装置。 - 前記所定の注意機構は、多層パーセプトロン注意機構又は縮小付き内積注意機構のいずれかである、ことを特徴とする請求項1に記載の翻訳装置。
- 前記マルチホップ注意機構では、
前記所定の注意機構が前記多層パーセプトロン注意機構である場合、前記多層パーセプトロン注意機構の出力をソフトマックス関数により正規化し、前記正規化された出力を用いて前記マルチヘッド注意機構に含まれる縮小付き内積注意機構の出力をゲーティングし、前記ゲーティングにより得られた値を連結及び線形変換する、ことを特徴とする請求項2に記載の翻訳装置。 - 前記正規化された出力は、
前記多層パーセプトロン注意機構の出力をヘッド単位でソフトマックス関数により正規化した値、又は、前記多層パーセプトロン注意機構の出力をヘッド及びバッチ単位でソフトマックス関数により正規化した値のいずれかである、ことを特徴する請求項3に記載の翻訳装置。 - 原言語の入力文を入力する入力手順と、
Transformerのデコーダ及びエンコーダに含まれる複数のマルチヘッド注意機構のうちの少なくとも1つのマルチヘッド注意機構を、前記マルチヘッド注意機構に含まれる縮小付き内積注意機構の出力に対して更に所定の注意機構を適用するマルチホップ注意機構に置き換えたモデルにより、前記入力文を目的言語の出力文に翻訳する翻訳手順と、
をコンピュータが実行することを特徴とする翻訳方法。 - コンピュータを、請求項1乃至4の何れか一項に記載の翻訳装置として機能させるプログラム。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020122380A JP7357291B2 (ja) | 2020-07-16 | 2020-07-16 | 翻訳装置、翻訳方法及びプログラム |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020122380A JP7357291B2 (ja) | 2020-07-16 | 2020-07-16 | 翻訳装置、翻訳方法及びプログラム |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2022018928A true JP2022018928A (ja) | 2022-01-27 |
JP7357291B2 JP7357291B2 (ja) | 2023-10-06 |
Family
ID=80203180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020122380A Active JP7357291B2 (ja) | 2020-07-16 | 2020-07-16 | 翻訳装置、翻訳方法及びプログラム |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7357291B2 (ja) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115130483A (zh) * | 2022-07-13 | 2022-09-30 | 湘潭大学 | 一种基于多目标群体智能算法的神经架构搜索方法及用途 |
CN117132997A (zh) * | 2023-10-26 | 2023-11-28 | 国网江西省电力有限公司电力科学研究院 | 一种基于多头注意力机制和知识图谱的手写表格识别方法 |
CN117312931A (zh) * | 2023-11-30 | 2023-12-29 | 山东科技大学 | 一种基于transformer的钻机卡钻预测方法 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018217948A1 (en) * | 2017-05-23 | 2018-11-29 | Google Llc | Attention-based sequence transduction neural networks |
WO2020123207A1 (en) * | 2018-12-11 | 2020-06-18 | Salesforce.Com, Inc. | Structured text translation |
-
2020
- 2020-07-16 JP JP2020122380A patent/JP7357291B2/ja active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018217948A1 (en) * | 2017-05-23 | 2018-11-29 | Google Llc | Attention-based sequence transduction neural networks |
WO2020123207A1 (en) * | 2018-12-11 | 2020-06-18 | Salesforce.Com, Inc. | Structured text translation |
Non-Patent Citations (1)
Title |
---|
飯田頌平 他4名: "マルチホップ注意機構を用いたニューラル機械翻訳", 言語処理学会第25回年次大会 発表論文集 [ONLINE], JPN6023017925, 4 March 2019 (2019-03-04), JP, pages 113 - 116, ISSN: 0005058357 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115130483A (zh) * | 2022-07-13 | 2022-09-30 | 湘潭大学 | 一种基于多目标群体智能算法的神经架构搜索方法及用途 |
CN117132997A (zh) * | 2023-10-26 | 2023-11-28 | 国网江西省电力有限公司电力科学研究院 | 一种基于多头注意力机制和知识图谱的手写表格识别方法 |
CN117132997B (zh) * | 2023-10-26 | 2024-03-12 | 国网江西省电力有限公司电力科学研究院 | 一种基于多头注意力机制和知识图谱的手写表格识别方法 |
CN117312931A (zh) * | 2023-11-30 | 2023-12-29 | 山东科技大学 | 一种基于transformer的钻机卡钻预测方法 |
CN117312931B (zh) * | 2023-11-30 | 2024-02-23 | 山东科技大学 | 一种基于transformer的钻机卡钻预测方法 |
Also Published As
Publication number | Publication date |
---|---|
JP7357291B2 (ja) | 2023-10-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Torfi et al. | Natural language processing advancements by deep learning: A survey | |
Ye et al. | Slot self-attentive dialogue state tracking | |
JP7357291B2 (ja) | 翻訳装置、翻訳方法及びプログラム | |
Grefenstette et al. | A deep architecture for semantic parsing | |
Liu et al. | Additive neural networks for statistical machine translation | |
Khemchandani et al. | Exploiting language relatedness for low web-resource language model adaptation: An Indic languages study | |
US20220237377A1 (en) | Graph-based cross-lingual zero-shot transfer | |
US20220245353A1 (en) | System and method for entity labeling in a natural language understanding (nlu) framework | |
Chen et al. | Decoupled dialogue modeling and semantic parsing for multi-turn text-to-SQL | |
Mocialov et al. | Transfer learning for british sign language modelling | |
Wu et al. | Sequence generation with mixed representations | |
US20220245361A1 (en) | System and method for managing and optimizing lookup source templates in a natural language understanding (nlu) framework | |
Feng et al. | Enhanced neural machine translation by joint decoding with word and POS-tagging sequences | |
Singh et al. | Improving neural machine translation for low-resource Indian languages using rule-based feature extraction | |
Wahab et al. | Dibert: Dependency injected bidirectional encoder representations from transformers | |
Hujon et al. | Transfer learning based neural machine translation of english-khasi on low-resource settings | |
Ma et al. | Graph augmented sequence-to-sequence model for neural question generation | |
Le Thi et al. | Machine learning using context vectors for object coreference resolution | |
US20220237383A1 (en) | Concept system for a natural language understanding (nlu) framework | |
US20220229990A1 (en) | System and method for lookup source segmentation scoring in a natural language understanding (nlu) framework | |
US11868716B2 (en) | Knowledge base question answering | |
Hujon et al. | Neural machine translation systems for English to Khasi: A case study of an Austroasiatic language | |
Ziai | Compositional pre-training for neural semantic parsing | |
Alimova et al. | Cross-lingual transfer learning for semantic role labeling in Russian | |
Singh et al. | English-Manipuri machine translation: an empirical study of different supervised and unsupervised methods |
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: 20200806 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20220812 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230516 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20230510 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230713 |
|
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: 20230905 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20230915 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7357291 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |