How plugins work in AllenNLP
mainAllenNLP supports dynamic loading of plugins. A plugin is a Python package that provides custom registered classes or additional allennlp subcommands.
Loading Plugins
- Official AI2 Plugins: AllenNLP automatically finds any official AI2-maintained plugins that are installed.
- Third-party/Personal Plugins: To load non-official plugins, you must create a plugins file listing the plugin modules (one per line):
- Local: Create a file named
.allennlp_pluginsin the directory where you run theallennlpcommand. - Global: Create a file at
~/.allennlp/plugins.
- Local: Create a file named
Verifying Plugins
To verify that your plugins are correctly discovered and can be imported, run the following command:
allennlp test-installEach discovered plugin will be logged to the terminal.