https://www.jiqizhixin.com/articles/2019-08-13-3 四种常见NLP框架使用总结(里面有关于allennlp的部分)
AllenNLP是一个基于PyTorch的NLP研究库,可为开发者提供语言任务中的各种业内最佳训练模型。官网提供了一个很好的入门教程[2]https://guide.allennlp.org/,能够让初学者在30分钟内就了解AllenNLP的使用方法。
1. https://docs.allennlp.org/master/ 官方allennlp的docs文档
1) 安装:pip install allennlp
2) 帮助(查看完整用法信息):allennlp --help
3) 测试是否安装成功:allennlp test-install
(pytorch1.2) C:\Users\Chen>allennlp --help
2020-12-05 16:43:15,728 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2020-12-05 16:43:35,809 - INFO - pytorch_transformers.modeling_bert - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2020-12-05 16:43:35,974 - INFO - pytorch_transformers.modeling_xlnet - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2020-12-05 16:43:53,012 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-12-05 16:43:53,049 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-12-05 16:43:53,058 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-12-05 16:43:53,065 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
usage: allennlp
Run AllenNLP
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
Commands:
configure Run the configuration wizard.
train Train a model.
evaluate Evaluate the specified model + dataset.
predict Use a trained model to make predictions.
make-vocab Create a vocabulary.
elmo Create word vectors using a pretrained ELMo model.
fine-tune Continue training a model on a new dataset.
dry-run Create a vocabulary, compute dataset statistics and other
training utilities.
test-install
Run the unit tests.
find-lr Find a learning rate range.
print-results
Print results from allennlp serialization directories to the
console.
2. https://guide.allennlp.org/ 官网指导文档
什么是AllenNLP
AllenNLP是由艾伦人工智能研究所开发的用于构建用于自然语言处理的深度学习模型的开源库。它建立在PyTorch之上,旨在为希望轻松构建高质量深度NLP模型的研究人员,工程师,学生等提供支持。它为现代NLP中的通用组件和模型提供了高级抽象和API。它还提供了可扩展的框架,可以轻松地运行和管理NLP实验。
简而言之,AllenNLP是
- 具有深思熟虑的抽象的库,封装了在NLP研究中完成的通用数据和模型操作
- 训练PyTorch模型的命令行工具
- 可以用来进行预测的预训练模型的集合
- 常见/最新NLP模型的可读参考实现的集合
- 做可复制科学的实验框架
- 一种演示您的研究的方法
- 开源和社区驱动
AllenNLP被许多组织和研究项目所使用。