bjascob / amrlib

A python library that makes AMR parsing, generation and visualization simple.
MIT License
216 stars 33 forks source link

Model Stog not found #22

Closed maurovit closed 3 years ago

maurovit commented 3 years ago

Hi, I want to use amrlib with spacy extension but I get this error: No such file or directory: '/usr/local/lib/python3.7/dist-packages/amrlib/data/model_stog' after this block:

import spacy
import amrlib
amrlib.setup_spacy_extension()
nlp = spacy.load('en_core_web_sm')
doc = nlp('This is a test of the spaCy extension. The test has multiple sentences.')
graphs = doc._.to_amr()

How can I solve? Help me

bjascob commented 3 years ago

Did you download the model? The error says it can't find it. See the the model Install on the Install page. You only need to download one. model_parse_t5-v0_1_0.tar.gz is the best performing of the two, but the other "parse" model is still good (and a little faster/smaller I think).

If you did download this check that you either renamed the directory or set a link to it from '/usr/local/lib/python3.7/dist-packages/amrlib/data/model_stog'. That's where it's trying to load from but it doesn't find anything there. If it's not clear from the documentation stog ==> sentence to graph and that's what the parse models do. (Generate == graph to sentence, which is the other diction).

maurovit commented 3 years ago

Thank you but it still not working. The error said that 'module 'torch' has no attribute '_six''

bjascob commented 3 years ago

You'll have to give me more info that that. Please post the stack trace that you get. The original error you posted said it couldn't find the model. Is this now a different behavior? What did you do to get the behavior to change?

bjascob commented 3 years ago

I don't know what this error is but here's the first item on a google search... https://stackoverflow.com/questions/56241856/attributeerror-module-torch-has-no-attribute-six-bert-model-in-pytorch Are you using a Jupyter notebook? Looks like it might be something with that. Try restarting it and if that doesn't work, try running this from a plain python3 interpreter.