ELMo is a deep contextualized word representation that models both (1) complex characteristics of word use (e.g., syntax and semantics), and (2) how these uses vary across linguistic contexts (i.e., to model polysemy). These word vectors are learned functions of the internal states of a deep bidirectional language model (biLM), which is pre-trained on a large text corpus. They can be easily added to existing models and significantly improve the state of the art across a broad range of challenging NLP problems, including question answering, textual entailment and sentiment analysis.
ELMo representations are:
Adding ELMo to existing NLP systems significantly improves the state-of-the-art for every considered task. In most cases, they can be simply swapped for pre-trained GloVe or other word vectors.
|Task||Previous SOTA||Our baseline||ELMo + Baseline||Increase (Absolute/Relative)|
|SQuAD||SAN||84.4||81.1||85.8||4.7 / 24.9%|
|SNLI||Chen et al (2017)||88.6||88.0||88.7 +/- 0.17||0.7 / 5.8%|
|SRL||He et al (2017)||81.7||81.4||84.6||3.2 / 17.2%|
|Coref||Lee et al (2017)||67.2||67.2||70.4||3.2 / 9.8%|
|NER||Peters et al (2017)||91.93 +/- 0.19||90.15||92.22 +/- 0.10||2.06 / 21%|
|Sentiment (5-class)||McCann et al (2017)||53.7||51.4||54.7 +/- 0.5||3.3 / 6.8%|
There are reference implementations of the pre-trained bidirectional language model available in both PyTorch and TensorFlow. The PyTorch verison is fully integrated into AllenNLP, with a detailed tutorial available. The TensorFlow version is also available in bilm-tf.
See our paper Deep contextualized word representations for more information about the algorithm and a detailed analysis.