Allennlp 德国 elmo 模型
Allennlp german elmo model
我想用 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'])
经过更多研究,我发现 TensorFlow 提供了一个 multilingual sentence encoder 也可以用于问答。训练我自己的 Elmo 模型不是一种选择,因为它的计算成本太高。
我想用 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'])
经过更多研究,我发现 TensorFlow 提供了一个 multilingual sentence encoder 也可以用于问答。训练我自己的 Elmo 模型不是一种选择,因为它的计算成本太高。