Hironsan / anago

Bidirectional LSTM-CRF and ELMo for Named-Entity Recognition, Part-of-Speech Tagging and so on.

Home Page:https://anago.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ELMo Model not defined

nikhiljsk opened this issue · comments

System information

  • MacOS Mojave 10.14.5
  • TensorFlow/Keras version: 1.14.0
  • Python version - 3.6.7:
  • Anago version - 1.0.8

Describe the problem

I've downloaded the latest anago version using (pip install anago). Once I've installed, I tried using elmo_example.py. When I try to run this statement

from anago.models import ELModel
from anago.preprocessing import ELMoTransformer

It gives me this error

<ipython-input-1-bded6a8204c3> in <module>
      8 
      9 from anago.utils import load_data_and_labels, load_glove, filter_embeddings
---> 10 from anago.models import ELModel
     11 from anago.preprocessing import ELMoTransformer
     12 from anago.trainer import Trainer

ImportError: cannot import name 'ELModel'

I've tried to inspect the models.py file which is installed and found that 'ELModel' was missing. Although I see it in the repo, i did not find the code in the installed version of anago, I tried re-installing, but stuck with the same issue. I've used this code to inspect:
print(inspect.getsource(anago.models))

I've tried installing the same on online jupyter. Found the same issue, the ELModel class was not implemented.

It seems like the latest version of anago on pip is from July 2018, while support for ELMo was added around September 2018. You should install the library from source.

Try pip install git+https://github.com/Hironsan/anago.git.

Yes, the issue was with the version. That worked.
Thanks.