プリンキピア

第16章自然言語処理:応用

16. Natural Language Processing: Applications16 自然言語処理:応用

We have seen how to represent tokens in text sequences and train their representations in Section 15. Such pretrained text representations can be fed to various models for different downstream natural language processing tasks.
英語のヒント
第15章では、テキストの系列の中のトークンをどう表し、その表現をどう訓練するかを見た。そうした事前学習したテキストの表現は、さまざまな下流の自然言語処理のタスクのために、多様なモデルに入れることができる。
In fact, earlier chapters have already discussed some natural language processing applications without pretraining, just for explaining deep learning architectures. For instance, in Section 9, we have relied on RNNs to design language models to generate novella-like text. In Section 10 and Section 11, we have also designed models based on RNNs and attention mechanisms for machine translation.
英語のヒント
実は、前の章では、深層学習のアーキテクチャを説明するためだけに、事前学習なしでいくつかの自然言語処理の応用をすでに論じている。たとえば、第9章では、RNNに頼って言語モデルを設計し、中編小説のようなテキストを生成した。第10章と第11章では、機械翻訳のための、RNNと注意機構にもとづくモデルも設計した。
However, this book does not intend to cover all such applications in a comprehensive manner. Instead, our focus is on how to apply (deep) representation learning of languages to addressing natural language processing problems. Given pretrained text representations, this chapter will explore two popular and representative downstream natural language processing tasks: sentiment analysis and natural language inference, which analyze single text and relationships of text pairs, respectively.
英語のヒント
しかし、この本はそうした応用のすべてを網羅的に扱うつもりはない。その代わりに、焦点は、言語の(深い)表現学習を自然言語処理の問題の解決にどう当てはめるかにある。事前学習したテキストの表現が与えられたとき、この章では、よく使われ代表的な二つの下流の自然言語処理のタスク、つまり感情分析と自然言語推論を探る。これらはそれぞれ、単一のテキストと、テキストの対の関係を分析する。
Fig. 16.1図16.1
Pretrained text representations can be fed to various deep learning architectures for different downstream natural language processing applications. This chapter focuses on how to design models for different downstream natural language processing applications.
英語のヒント
事前学習したテキストの表現は、さまざまな下流の自然言語処理の応用のために、多様な深層学習のアーキテクチャに入れることができる。この章では、さまざまな下流の自然言語処理の応用のためのモデルをどう設計するかに焦点を当てる。
As depicted in Fig. 16.1, this chapter focuses on describing the basic ideas of designing natural language processing models using different types of deep learning architectures, such as MLPs, CNNs, RNNs, and attention. Though it is possible to combine any pretrained text representations with any architecture for either application in Fig. 16.1, we select a few representative combinations. Specifically, we will explore popular architectures based on RNNs and CNNs for sentiment analysis. For natural language inference, we choose attention and MLPs to demonstrate how to analyze text pairs. In the end, we introduce how to fine-tune a pretrained BERT model for a wide range of natural language processing applications, such as on a sequence level (single text classification and text pair classification) and a token level (text tagging and question answering). As a concrete empirical case, we will fine-tune BERT for natural language inference.
英語のヒント
図16.1に描いたように、この章では、MLP、CNN、RNN、注意のような、さまざまな種類の深層学習のアーキテクチャを使って自然言語処理のモデルを設計する基本的な考え方を説明することに焦点を当てる。図16.1のどちらの応用でも、どの事前学習したテキストの表現とどのアーキテクチャを組み合わせることもできるが、代表的な組み合わせをいくつか選ぶ。具体的には、感情分析のために、RNNとCNNにもとづくよく使われるアーキテクチャを探る。自然言語推論では、注意とMLPを選んで、テキストの対をどう分析するかを示す。最後に、系列単位(単一テキストの分類とテキスト対の分類)やトークン単位(テキストのタグづけと質問応答)のような、幅広い自然言語処理の応用のために、事前学習したBERTモデルをどう微調整するかを紹介する。具体的な実証の例として、自然言語推論のためにBERTを微調整する。
As we have introduced in Section 15.8, BERT requires minimal architecture changes for a wide range of natural language processing applications. However, this benefit comes at the cost of fine-tuning a huge number of BERT parameters for the downstream applications. When space or time is limited, those crafted models based on MLPs, CNNs, RNNs, and attention are more feasible. In the following, we start by the sentiment analysis application and illustrate the model design based on RNNs and CNNs, respectively.
英語のヒント
15.8節で紹介したように、BERTは、幅広い自然言語処理の応用に対して、アーキテクチャにわずかな変更しか必要としない。しかし、この利点には、下流の応用のために膨大な数のBERTのパラメータを微調整するという代価がともなう。空間や時間が限られているときは、MLP、CNN、RNN、注意にもとづいて作り込んだモデルのほうが現実的である。以下では、感情分析の応用から始めて、RNNとCNNにもとづくモデルの設計をそれぞれ示す。