bjascob / amrlib

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

Loading stog_model #25

Closed thomashacker closed 3 years ago

thomashacker commented 3 years ago

Hello 👋 When trying to load the stog_model with load_stog_model I get a FileNotFoundError because the path "amrlib/data/stog_model" does not exist.

Looking at the docs I think stog_model was renamed to parse_t5, correct? There's also no data folder. Is there a function that downloads the stog_model and creates the data folder?

Thanks for the help! ✨

bjascob commented 3 years ago

Where did you download the model to? As per the install instructions, you either need to rename the downloaded model or set a link to it. The system looks for the default model at xxx/amrlib/data/model_stog.

bjascob commented 3 years ago

ToDo: Add verbiage to the error message(s) to indicate that the user must install these separately; that they are not installed by pip.

thomashacker commented 3 years ago

Thanks! Sorry, somehow I missed the install instructions... It works perfectly now

bjascob commented 3 years ago

Added https://github.com/bjascob/amrlib/commit/1e70741b4ea07ad1b470ff6a241792d49d927d84 to make this clearer in the main README page.

BehroozMansouri commented 2 years ago

I have a question regarding loading SPRING model. How can I load this model instead of the default model?

bjascob commented 2 years ago

https://amrlib.readthedocs.io/en/latest/api_model/

ARQMath commented 2 years ago

I have the following meta file: { "model_type":"stog", "version":"0.1.0", "date":"2021-11-25", "inference_module":".parse_spring.inference", "inference_class":"Inference", "model_fn":"model.pt", "kwargs":{} }

And have downloaded the spring model from "https://github.com/bjascob/amrlib-models" and extracted in ./amrlib/data/model_stog.

I am getting the error: "ModuleNotFoundError: No module named 'amrlib.models.parse_spring'".

Could you please help me with this?

bjascob commented 2 years ago

There was a missing "resources" directory for that model and I pushed a quick update to the pypi package (0.7.1) that has this fixed. Try updating to the latest code and see if that fixes it. Everything loads fine for me after updating (note that this only impacts the pip installed version. There are no changes if you just downloaded the code and ran it in place).

On my system I was getting a different error so if you still get the error after updating you'll have to give more details on your specific setup. The error looks like a path issue that is specific to your system.

If you need additional help, please don't post in a closed issue. Open a new issue with your specifics.