awasthiabhijeet / PIE

Fast + Non-Autoregressive Grammatical Error Correction using BERT. Code and Pre-trained models for paper "Parallel Iterative Edit Models for Local Sequence Transduction": www.aclweb.org/anthology/D19-1435.pdf (EMNLP-IJCNLP 2019)
MIT License
228 stars 40 forks source link

Trying to use the pretrained model #5

Closed MrRobot2211 closed 4 years ago

MrRobot2211 commented 4 years ago

Hi thank you for contributing this model. I am currently trying to use it with your pretrained PIE. Is it correct to download the pretrained PIE into the directory which then I will pass to the "output_dir" argument? Thank you in advance.

awasthiabhijeet commented 4 years ago

Hi, I have updated the README with instructions for using the pre-trained PIE for inference. See https://github.com/awasthiabhijeet/PIE#pretrained-models

MrRobot2211 commented 4 years ago

HI thank you a lot, I tried it but it returns an error, FileNotFoundError: [Errno 2] No such file or directory: 'scratch/pickles/common_deletes.p'

scraaatch/pickles is no in the repo and I believe gets created during train...I erased it in order not to conflict with inference

awasthiabhijeet commented 4 years ago

Did you use scripts provided in the PIE_ckpt directory? Those are the scripts that can be directly used for inference. These scripts point to "pickles/conll/" instead of "scratch/pickles/". Pickle files in "pickles/conll" were used in our model.

scripts within the example_scripts directory are only for demonstrating the entire process (extracting pickle files for creating edit dictionary, converting the original parallel corpus to the form of incorrect sentences and edits and training the model). The pickle files created here are dumped to "scratch/pickles/".

So, in order to use the pre-trained model, you need to use the pickle files in "pickles/conll" directory. Which is what scripts inside PIE_ckpt directory do.

MrRobot2211 commented 4 years ago

HI I apologize, I did not see the change in the repo and copied the files from another directory. Thanlk you.