AllenNLP: A Deep Semantic Natural Language Processing Platform
Written for the Research library (claude-opus-5-5) from the paper text, in our own words: the license "arXiv — non-exclusive licence to distribute" does not allow redistributing the text itself. Original — arxiv.org/pdf/1803.07640
Summary
Code for neural NLP research is often hard to rerun, debug, and extend. Important hyperparameters get lost among low-level details, and baselines are frequently rebuilt from scratch. A team from the Allen Institute for AI introduces AllenNLP, an open-source PyTorch library that makes deep learning experiments in NLP easier to specify, reproduce, and share.
Its data layer represents each example as an Instance made of typed Fields. Batching by sequence length, padding, and shuffling happen automatically. Models are built from interchangeable NLP-specific components, such as token embedders, encoders, and span extractors. One model class therefore covers many variants, and a declarative configuration file selects among them without code changes.
The library includes reference reimplementations of strong models for SRL, machine comprehension, textual entailment, and constituency parsing, along with interactive web demos. Their scores match or exceed the original publications. The work matters as shared infrastructure: it lowers the entry barrier, encourages controlled comparisons, and gives the field dependable baselines.
Key points
- Built on PyTorch and released under Apache 2.0. It installs via pip, Docker, or GitHub and maintains test coverage above 90%.
- Core abstractions are TokenEmbedder, Seq2SeqEncoder, Seq2VecEncoder, and SpanExtractor. They are wired up through a HOCON (JSON with comments) configuration file and a registry, and missing required settings raise a ConfigurationError.
- The SRL reimplementation of the He et al. (2017) deep BiLSTM reaches 78.9 F1 on English Ontonotes 5.0 in the CoNLL 2011/12 format. A BiDAF model is provided for SQuAD.
- The decomposable attention model scores 86.4% accuracy on the SNLI 1.0 test set. That is about 2 points above typical public implementations, a gain attributed to ELMo embeddings.
- With ELMo, the Stern et al. (2017) constituency parser rises from 92.6 to 94.11 F1 on the Penn Treebank, roughly a 20% relative error reduction.
Cited by
- SciBERT: A Pretrained Language Model for Scientific Text
- Toward Gender-Inclusive Coreference Resolution
- QuAC: Question Answering in Context
- SPECTER: Document-level Representation Learning using Citation-informed Transformers
- Quoref: A Reading Comprehension Dataset with Questions Requiring Coreferential Reasoning
- DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs
- FEQA: A Question Answering Evaluation Framework for Faithfulness Assessment in Abstractive Summarization
- Bottom-Up Abstractive Summarization
- DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations
- Combining Event Semantics and Degree Semantics for Natural Language Inference
- Pretrained Transformers Improve Out-of-Distribution Robustness
- He Thinks He Knows Better than the Doctors: BERT for Event Factuality Fails on Pragmatics
- Probing What Different NLP Tasks Teach Machines about Function Word Comprehension
- QANom: Question-Answer driven SRL for Nominalizations
- Explainable Automated Fact-Checking for Public Health Claims
- VisualBERT: A Simple and Performant Baseline for Vision and Language
- Linguistic Knowledge and Transferability of Contextual Representations
- Right for the Wrong Reasons: Diagnosing Syntactic Heuristics in Natural Language Inference
- Dissecting Contextual Word Embeddings: Architecture and Representation
- Sentence Encoders on STILTs: Supplementary Training on Intermediate Labeled-data Tasks
- Intermediate-Task Transfer Learning with Pretrained Language Models: When and Why Does It Work?
- The Possible, the Plausible, and the Desirable: Event-Based Modality Detection for Language Processing
- Pre-trained Models for Natural Language Processing: A Survey
- Probing Natural Language Inference Models through Semantic Fragments
- Towards Debiasing Fact Verification Models
- Harnessing the linguistic signal to predict scalar inferences
- What do you learn from context? Probing for sentence structure in contextualized word representations
- FEVER: a Large-scale Dataset for Fact Extraction and VERification
- Entity, Relation, and Event Extraction with Contextualized Span Representations
- SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems
- Transformers: State-of-the-Art Natural Language Processing
- Break It Down: A Question Understanding Benchmark
- Discourse-Aware Neural Extractive Text Summarization
- Opinion Piece: Can we Fix the Scope for Coreference? Problems and Solutions for Benchmarks beyond OntoNotes
- ReCoRD: Bridging the Gap between Human and Machine Commonsense Reading Comprehension
- DialoGPT: Large-Scale Generative Pre-training for Conversational Response Generation
- Revisiting Few-sample BERT Fine-tuning
- Revisiting Shallow Discourse Parsing in the PDTB-3: Handling Intra-sentential Implicits
Cite
@misc{gardner2018allennlp,
title = {{AllenNLP: A Deep Semantic Natural Language Processing Platform}},
author = {Gardner, Matt and Grus, Joel and Neumann, Mark and Tafjord, Oyvind and Dasigi, Pradeep and Liu, Nelson and Peters, Matthew and Schmitz, Michael and Zettlemoyer, Luke},
year = {2018},
doi = {10.48550/arxiv.1803.07640},
eprint = {1803.07640},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.1803.07640}
}References
- Martı́n Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. 2016. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. CoRR abs/1603.04467. find our card
- James Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. 2010. Theano: A cpu and gpu math compiler in python. In Proc. 9th Python in Science Conf, pages 1–7. find
- Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics. find
- Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. 2015. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. CoRR abs/1512.01274. find our card
- Jianpeng Cheng, Li Dong, and Mirella Lapata. 2016. Long short-term memory-networks for machine reading. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP). find our card
- Kyunghyun Cho, Bart van Merrienboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, Graham Neubig, Chris Dyer, Yoav Goldberg, Austin Holger Schwenk, and Yoshua Bengio. 2014. Matthews, Waleed Ammar, Antonios Anastasopou-Learning phrase representations using RNN encoder-decoder for statistical… find our card
- François Chollet et al. 2015. Keras. Martha Palmer, Daniel Gildea, and Paul Kingsbury. https://keras.io.2005. The proposition bank: An annotated corpus of semantic roles. Computational linguistics, Christopher T Clark and Matthew Gardner. 2017. Sim-31(1):71–106. ple and effective multi-paragraph re… ↗ our card
- Luheng He, Kenton Lee, Mike Lewis, and Luke Zettlemoyer. 2017. Deep semantic role labeling: What works and whats next. In Proceedings of the Association for Computational Linguistics (ACL). find our card
- Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735–1780. find
- Jeremy Howard and Sebastian Ruder. 2018. Fine-tuned language models for text classification. CoRR, abs/1801.06146. find
- Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. 2017. Opennmt: Open-source toolkit for neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL, pages 67–72. find our card
- Jayant Krishnamurthy, Pradeep Dasigi, and Matthew Gardner. 2017. Neural semantic parsing with type constraints for semi-structured tables. In EMNLP. find
- Kenton Lee, Luheng He, Mike Lewis, and Luke Zettlemoyer. 2017a. End-to-end neural coreference resolution. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP). find our card
- Kenton Lee, Omer Levy, and Luke Zettlemoyer. 2017b. Recurrent additive networks. CoRR abs/1705.07393. — [arXiv:1705.07393](https://arxiv.org/abs/1705.07393) find
- Christopher D Manning, Mihai Surdeanu, John Bauer, Jenny Rose Finkel, Steven Bethard, and David Mc-Closky. 2014. The stanford corenlp natural language processing toolkit. In Proceedings of the Association for Computational Linguistics (ACL) (System Demonstrations). find our card
- Alexander H. Miller, Will Feng, Dhruv Batra, Antoine Bordes, Adam Fisch, Jiasen Lu, Devi Parikh, and Jason Weston. 2017. Parlai: A dialog research software platform. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, EMNLP, pages 79–84. find our card
- Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in pytorch. In NIPS-W. find
- F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:282… find
- Matthew E Peters, Waleed Ammar, Chandra Bhagavatula, and Russell Power. 2017. Semi-supervised sequence tagging with bidirectional language models. In Proceedings of the Association for Computational Linguistics (ACL). find our card
- Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matthew Gardner, Christopher T Clark, Kenton Lee, and Luke S. Zettlemoyer. 2018. Deep contextualized word representations. CoRR, abs/1802.05365. find
- Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP). find our card
- Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2017. Bidirectional attention flow for machine comprehension. find our card
- Mitchell Stern, Jacob Andreas, and Dan Klein. 2017. A minimal span-based neural constituency parser. In ACL. find our card
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS. find
- Ian H. Witten and Eibe Frank. 1999. Data mining: Practical machine learning tools and techniques with java implementations. find
- Dong Yu, Adam Eversole, Mike Seltzer, Kaisheng Yao, Zhiheng Huang, Brian Guenter, Oleksii Kuchaiev, Yu Zhang, Frank Seide, Huaming Wang, et al. 2014. An introduction to computational networks and the computational network toolkit. Microsoft Technical Report MSR-TR-2014–112. find
- Jie Zhou and Wei Xu. 2015. End-to-end learning of semantic role labeling using recurrent neural networks. In Proceedings of the Association for Computational Linguistics (ACL). find