【发布时间】:2021-04-03 18:12:40
【问题描述】:
我正在试用 Allen NLP 预训练模型进行问答。
在线演示在这里:https://demo.allennlp.org/reading-comprehension
我创建了一个 python 脚本来尝试各种模型。
这是我笔记本电脑上的基准测试摘要
- Macbook Pro (2017)
- 2.9 Ghz Intel i7 四核
- 16G 内存
| Benchmark | transformer-qa | bidaf-model | bidaf-elmo-model |
|---|---|---|---|
| loading time | 31.6 seconds | 1.6 seconds | 13.8 seconds |
| questions | |||
| Who stars in The Matrix? | 794 ms | 62 ms | 1,798 ms |
| where does polar bear live | 2,211 ms | 96 ms | 7,125 ms |
| how much does a polar bear weigh | 2,435 ms | 98 ms | 7,082 ms |
| what is lightning | 1,361 ms | 69 ms | 3,173 ms |
| How many lightning bolts strike earth | 1,019 ms | 47 ms | 2,885 ms |
查看output 我可以看到所有 3 个模型都提供了很好的答案。我喜欢transformer-qa 模型,但预测需要一段时间(以秒为单位)。
有没有办法加快预测时间?
谢谢!
【问题讨论】:
标签: python nlp question-answering allennlp