I wanted to use the Open Information Extraction tool (https://demo.allennlp.org/open-information-extraction) as it gives me spatial labels when I use it in the demo mode, e.g. “He walks along the river” labels “along the river” as LOCATION.
However, when I use the tool in python these precise labels are missing and everything is just labeled as ARG0, ARG1, etc.
Here the code I use in Google Colab:
!pip install allennlp==0.9
!pip install spacy==2.2.0
from allennlp.predictors.predictor import Predictor
predictor = Predictor.from_path(“https://s3-us-west-2.amazonaws.com/allennlp/models/openie-model.2018-08-20.tar.gz”)
predictor.predict(sentence=“He was walking along the river”)
Also note that I have to use version 0.9 and 2.2.0 of allennlp and spacy as using the versions given in the Usage tab of the demo lead to error messages.