我想用allennlp构建一个问答机器人。我已经找到了它的代码和一个英语模型-我想用德语使用机器人。我已经搜索过了,但我只找到了this模型,不幸的是,它与allennlp不兼容。你知道任何兼容的德国elmo型号吗,或者有没有比allennlp更常见的替代品,它有更多兼容的型号?
这是我找到的代码:
from allennlp.predictors.predictor import Predictor
import allennlp_models.rc
predictor = Predictor.from_path("https://storage.googleapis.com/allennlp-public-models/bidaf-elmo-model-2020.03.19.tar.gz")
result = predictor.predict(
passage="Steve Jobs died in 2011. He was born in 1955. He has multiple children.",
question="When did Steve Jobs die?"
)
print(result['best_span_str'])发布于 2021-01-09 21:48:29
经过进一步的研究,我发现TensorFlow提供了一个multilingual sentence encoder,也可以用来回答问题。训练我自己的Elmo模型不是一个选择,因为它的计算量太大了。
https://stackoverflow.com/questions/63195266
复制相似问题