JohnGiorgi / seq2rel

The corresponding code for our paper: A sequence-to-sequence approach for document-level relation extraction.
https://share.streamlit.io/johngiorgi/seq2rel/main/demo.py
Apache License 2.0
60 stars 8 forks source link

Training the model #386

Open REEMALIK94 opened 1 year ago

REEMALIK94 commented 1 year ago

Hey,

I am trying to train model on my dataset, everything goes well, but at the end I am getting this error everytime. Not able to figure out what's wrong. Any help would be great. Screenshot from 2023-03-24 15-00-41(1)

JohnGiorgi commented 1 year ago

Hi @REEMALIK94,

Just reading the error, seems AllenNLP expected a folder /content/drive/MyDrive/DOCRED/model to exist, and it didn't. Could you manually create this directory, and then try re-training?

If that doesn't work, it would be helpful to know

REEMALIK94 commented 1 year ago

Hey, I tried this. It didn't work. But since the training was done, I created tar.gz file by myself. The issue at present is,I am trying to use load_archive method to load the saved model. But it is giving me this error. I have tried using the docred.tar.gz, still getting the same error. Screenshot from 2023-03-28 15-14-29

JohnGiorgi commented 1 year ago

This is likely because seq2rel is an AllenNLP 'module' you must import like this:

https://github.com/JohnGiorgi/seq2rel/blob/6bcffb47da157e4139f3537372f6845a8b35d1a6/seq2rel/seq2rel.py#L79

I recommend checking out that script to see how to load trained models^