pythonelmoallennlp

Allennlp german elmo model


I want to build a Q&A bot with allennlp. I already found the code for it and an English model - I want to use the bot with german. I already searched for it, but I only found this model which is unfortunately not compatible with allennlp. Do you know about any compatible german elmo models, or is there a more common alternative to allennlp which has more compatible models?

This is the code I found:

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'])

Solution

  • After some more research, I found out that TensorFlow offers a multilingual sentence encoder which can be used for Questions Answering as well. Training my own Elmo model was not an option as it is too computationally expensive.