第16章自然言語処理:応用
16.6.2. Text Pair Classification or Regression16.6.2 テキスト対の分類または回帰
We have also examined natural language inference in this chapter. It belongs to text pair classification, a type of application classifying a pair of text.
英語のヒント
この章では、自然言語推論も調べた。これは、テキストの対を分類する応用の一種であるテキスト対の分類に属する。
Taking a pair of text as input but outputting a continuous value, semantic textual similarity is a popular text pair regression task. This task measures semantic similarity of sentences. For instance, in the Semantic Textual Similarity Benchmark dataset, the similarity score of a pair of sentences is an ordinal scale ranging from 0 (no meaning overlap) to 5 (meaning equivalence) (Cer et al., 2017). The goal is to predict these scores. Examples from the Semantic Textual Similarity Benchmark dataset include (sentence 1, sentence 2, similarity score):
英語のヒント
テキストの対を入力にとるが連続値を出力する意味的テキスト類似度は、よく使われるテキスト対の回帰のタスクである。このタスクは文の意味の類似度を測る。たとえば、意味的テキスト類似度ベンチマークのデータセットでは、文の対の類似度のスコアは、0(意味の重なりなし)から5(意味が同等)までの順序尺度である(Cer et al., 2017)。目標はこれらのスコアを予測することである。意味的テキスト類似度ベンチマークのデータセットの例には、次のようなもの(文1、文2、類似度のスコア)がある。
- “A plane is taking off.”, “An air plane is taking off.”, 5.000;
英語のヒント
「A plane is taking off.」(飛行機が離陸している)、「An air plane is taking off.」(航空機が離陸している)、5.000。 - “A woman is eating something.”, “A woman is eating meat.”, 3.000;
英語のヒント
「A woman is eating something.」(女性が何かを食べている)、「A woman is eating meat.」(女性が肉を食べている)、3.000。 - “A woman is dancing.”, “A man is talking.”, 0.000.
英語のヒント
「A woman is dancing.」(女性が踊っている)、「A man is talking.」(男性が話している)、0.000。
Fig. 16.6.2図16.6.2
Fine-tuning BERT for text pair classification or regression applications, such as natural language inference and semantic textual similarity. Suppose that the input text pair has two and three tokens.
英語のヒント
自然言語推論や意味的テキスト類似度のような、テキスト対の分類または回帰の応用のためのBERTの微調整。入力のテキスト対には二つと三つのトークンがあるとする。
Comparing with single text classification in Fig. 16.6.1, fine-tuning BERT for text pair classification in Fig. 16.6.2 is different in the input representation. For text pair regression tasks such as semantic textual similarity, trivial changes can be applied such as outputting a continuous label value and using the mean squared loss: they are common for regression.