第15章自然言語処理:事前学習
15.8.1. From Context-Independent to Context-Sensitive15.8.1 文脈に依存しない表現から文脈に依存する表現へ
Recall the experiments in Section 15.4 and Section 15.7. For instance, word2vec and GloVe both assign the same pretrained vector to the same word regardless of the context of the word (if any). Formally, a context-independent representation of any token is a function that only takes as its input. Given the abundance of polysemy and complex semantics in natural languages, context-independent representations have obvious limitations. For instance, the word “crane” in contexts “a crane is flying” and “a crane driver came” has completely different meanings; thus, the same word may be assigned different representations depending on contexts.
英語のヒント
15.4節と15.7節の実験を思い出そう。たとえば、word2vecもGloVeも、単語の文脈(もしあれば)にかかわらず、同じ単語には同じ事前学習済みのベクトルを割り当てる。形式的には、任意のトークンの文脈に依存しない表現は、だけを入力にとる関数である。自然言語には多義性や複雑な意味があふれていることを考えると、文脈に依存しない表現には明らかな限界がある。たとえば、「a crane is flying」(鶴が飛んでいる)と「a crane driver came」(クレーンの運転手が来た)という文脈での単語「crane」は、まったく異なる意味をもつ。したがって、同じ単語でも、文脈に応じて異なる表現を割り当ててよいはずである。
This motivates the development of context-sensitive word representations, where representations of words depend on their contexts. Hence, a context-sensitive representation of token is a function depending on both and its context . Popular context-sensitive representations include TagLM (language-model-augmented sequence tagger) (Peters et al., 2017), CoVe (Context Vectors) (McCann et al., 2017), and ELMo (Embeddings from Language Models) (Peters et al., 2018).
英語のヒント
このことが、単語の表現がその文脈に依存する、文脈に依存する単語表現の開発を促した。したがって、トークンの文脈に依存する表現は、とその文脈の両方に依存する関数である。よく使われる文脈依存の表現には、TagLM(言語モデルで拡張した系列タガー)(Peters et al., 2017)、CoVe(文脈ベクトル)(McCann et al., 2017)、ELMo(言語モデルからの埋め込み)(Peters et al., 2018)がある。
For example, by taking the entire sequence as input, ELMo is a function that assigns a representation to each word from the input sequence. Specifically, ELMo combines all the intermediate layer representations from pretrained bidirectional LSTM as the output representation. Then the ELMo representation will be added to a downstream task’s existing supervised model as additional features, such as by concatenating ELMo representation and the original representation (e.g., GloVe) of tokens in the existing model. On the one hand, all the weights in the pretrained bidirectional LSTM model are frozen after ELMo representations are added. On the other hand, the existing supervised model is specifically customized for a given task. Leveraging different best models for different tasks at that time, adding ELMo improved the state of the art across six natural language processing tasks: sentiment analysis, natural language inference, semantic role labeling, coreference resolution, named entity recognition, and question answering.
英語のヒント
たとえば、ELMoは、系列全体を入力にとることで、入力系列の各単語に表現を割り当てる関数である。具体的には、ELMoは、事前学習した双方向LSTMの中間層の表現をすべて組み合わせて出力表現とする。それから、ELMoの表現は、たとえば既存のモデルでのトークンの元の表現(たとえばGloVe)とELMoの表現を連結するというやり方で、追加の特徴として下流のタスクの既存の教師ありモデルに加えられる。一方では、ELMoの表現を加えた後、事前学習した双方向LSTMモデルの重みはすべて凍結される。他方では、既存の教師ありモデルは、与えられたタスクに合わせて特別にあつらえられている。当時のさまざまなタスクでのそれぞれ最良のモデルを活用して、ELMoを加えることで、感情分析、自然言語推論、意味役割付与、共参照解析、固有表現認識、質問応答の六つの自然言語処理のタスクで最先端が更新された。