第16章自然言語処理:応用
16.6.1. Single Text Classification16.6.1 単一テキストの分類
Single text classification takes a single text sequence as input and outputs its classification result. Besides sentiment analysis that we have studied in this chapter, the Corpus of Linguistic Acceptability (CoLA) is also a dataset for single text classification, judging whether a given sentence is grammatically acceptable or not (Warstadt et al., 2019). For instance, “I should study.” is acceptable but “I should studying.” is not.
英語のヒント
単一テキストの分類は、単一のテキストの系列を入力にとり、その分類結果を出力する。この章で学んだ感情分析のほかに、言語的容認性コーパス(CoLA)も単一テキストの分類のためのデータセットで、与えられた文が文法的に容認できるかどうかを判定する(Warstadt et al., 2019)。たとえば、「I should study.」は容認できるが、「I should studying.」は容認できない。
Fig. 16.6.1図16.6.1
Fine-tuning BERT for single text classification applications, such as sentiment analysis and testing linguistic acceptability. Suppose that the input single text has six tokens.
英語のヒント
感情分析や言語的容認性の判定のような、単一テキストの分類の応用のためのBERTの微調整。入力の単一テキストには六つのトークンがあるとする。
Section 15.8 describes the input representation of BERT. The BERT input sequence unambiguously represents both single text and text pairs, where the special classification token “<cls>” is used for sequence classification and the special classification token “<sep>” marks the end of single text or separates a pair of text. As shown in Fig. 16.6.1, in single text classification applications, the BERT representation of the special classification token “<cls>” encodes the information of the entire input text sequence. As the representation of the input single text, it will be fed into a small MLP consisting of fully connected (dense) layers to output the distribution of all the discrete label values.