SkillAgentSearch skills...

Allennlp

An open-source NLP research library, built on PyTorch.

Install / Use

/learn @allenai/Allennlp
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center"> <br> <img src="https://raw.githubusercontent.com/allenai/allennlp/main/docs/img/allennlp-logo-dark.png" width="400"/> <p> An Apache 2.0 NLP research library, built on PyTorch, for developing state-of-the-art deep learning models on a wide variety of linguistic tasks. </p> <hr/> </div> <p align="center"> <a href="https://github.com/allenai/allennlp/actions"> <img alt="CI" src="https://github.com/allenai/allennlp/workflows/CI/badge.svg?event=push&branch=main"> </a> <a href="https://pypi.org/project/allennlp/"> <img alt="PyPI" src="https://img.shields.io/pypi/v/allennlp"> </a> <a href="https://github.com/allenai/allennlp/blob/main/LICENSE"> <img alt="License" src="https://img.shields.io/github/license/allenai/allennlp.svg?color=blue&cachedrop"> </a> <a href="https://codecov.io/gh/allenai/allennlp"> <img alt="Codecov" src="https://codecov.io/gh/allenai/allennlp/branch/main/graph/badge.svg"> </a> <a href="https://optuna.org"> <img alt="Optuna" src="https://img.shields.io/badge/Optuna-integrated-blue"> </a> <br/> </p>

⚠️ NOTICE: The AllenNLP library is now in maintenance mode. That means we are no longer adding new features or upgrading dependencies. We will still respond to questions and address bugs as they arise up until December 16th, 2022. If you have any concerns or are interested in maintaining AllenNLP going forward, please open an issue on this repository.

AllenNLP has been a big success, but as the field is advancing quickly it's time to focus on new initiatives. We're working hard to make AI2 Tango the best way to organize research codebases. If you are an active user of AllenNLP, here are some suggested alternatives:

  • If you like the trainer, the configuration language, or are simply looking for a better way to manage your experiments, check out AI2 Tango.
  • If you like AllenNLP's modules and nn packages, check out delmaksym/allennlp-light. It's even compatible with AI2 Tango!
  • If you like the framework aspect of AllenNLP, check out flair. It has multiple state-of-art NLP models and allows you to easily use pretrained embeddings such as those from transformers.
  • If you like the AllenNLP metrics package, check out torchmetrics. It has the same API as AllenNLP, so it should be a quick learning curve to make the switch.
  • If you want to vectorize text, try the transformers library.
  • If you want to maintain the AllenNLP Fairness or Interpret components, please get in touch. There is no alternative to it, so we are looking for a dedicated maintainer.
  • If you are concerned about other AllenNLP functionality, please create an issue. Maybe we can find another way to continue supporting your use case.

Quick Links

In this README

Getting Started Using the Library

If you're interested in using AllenNLP for model development, we recommend you check out the AllenNLP Guide for a thorough introduction to the library, followed by our more advanced guides on GitHub Discussions.

When you're ready to start your project, we've created a couple of template repositories that you can use as a starting place:

  • If you want to use allennlp train and config files to specify experiments, use this template. We recommend this approach.
  • If you'd prefer to use python code to configure your experiments and run your training loop, use this template. There are a few things that are currently a little harder in this setup (loading a saved model, and using distributed training), but otherwise it's functionality equivalent to the config files setup.

In addition, there are external tutorials:

And others on the AI2 AllenNLP blog.

Plugins

AllenNLP supports loading "plugins" dynamically. A plugin is just a Python package that provides custom registered classes or additional allennlp subcommands.

There is ecosystem of open source plugins, some of which are maintained by the AllenNLP team here at AI2, and some of which are maintained by the broader community.

<table> <tr> <td><b> Plugin </b></td> <td><b> Maintainer </b></td> <td><b> CLI </b></td> <td><b> Description </b></td> </tr> <tr> <td> <a href="https://github.com/allenai/allennlp-models"><b>allennlp-models</b></a> </td> <td> AI2 </td> <td> No </td> <td> A collection of state-of-the-art models </td> </tr> <tr> <td> <a href="https://github.com/allenai/allennlp-semparse"><b>allennlp-semparse</b></a> </td> <td> AI2 </td> <td> No </td> <td> A framework for building semantic parsers </td> </tr> <tr> <td> <a href="https://github.com/allenai/allennlp-server"><b>allennlp-server</b></a> </td> <td> AI2 </td> <td> Yes </td> <td> A simple demo server for serving models </td> </tr> <tr> <td> <a href="https://github.com/himkt/allennlp-optuna"><b>allennlp-optuna</b></a> </td> <td> <a href="https://himkt.github.io/profile/">Makoto Hiramatsu</a> </td> <td> Yes </td> <td> <a href="https://optuna.org/">Optuna</a> integration for hyperparameter optimization </td> </tr> </table>

AllenNLP will automatically find any official AI2-maintained plugins that you have installed, but for AllenNLP to find personal or third-party plugins you've installed, you also have to create either a local plugins file named .allennlp_plugins in the directory where you run the allennlp command, or a global plugins file at ~/.allennlp/plugins. The file should list the plugin modules that you want to be loaded, one per line.

To test that your plugins can be found and imported by AllenNLP, you can run the allennlp test-install command. Each discovered plugin will be logged to the terminal.

For more information about plugins, see the plugins API docs. And for information on how to create a custom subcommand to distribute as a plugin, see the subcommand API docs.

Package Overview

<table> <tr> <td><b> allennlp </b></td> <td> An open-source NLP research library, built on PyTorch </td> </tr> <tr> <td><b> allennlp.commands </b></td> <td> Functionality for the CLI </td> </tr> <tr> <td><b> allennlp.common </b></td> <td> Utility modules that are used across the library </td> </tr> <tr> <td><b> allennlp.data </b></td> <td> A data processing module for loading datasets and encoding strings as integers for representation in matrices </td> </tr> <tr> <td><b> allennlp.fairness </b></td> <td> A module for bias mitigation and fairness algorithms and metrics </td> </tr> <tr> <td><b> allennlp.modules </b></td> <td> A collection of PyTorch modules for use with text </td> </tr> <tr> <td><b> allennlp.nn </b></td> <td> Tensor utility functions, such as initializers and activation functions </td> </tr> <tr> <td><b> allennlp.training </b></td> <td> Functionality for training models </td> </tr> </table>

Installation

AllenNLP requires Python 3.6.1 or later and PyTorch.

We support AllenNLP on Mac and Linux environments. We presently do not support Wi

Related Skills

View on GitHub
GitHub Stars11.9k
CategoryData
Updated2d ago
Forks2.2k

Languages

Python

Security Score

100/100

Audited on Mar 23, 2026

No findings