nlp-uoregon / trankit

Trankit is a Light-Weight Transformer-based Python Toolkit for Multilingual Natural Language Processing
Apache License 2.0
734 stars 101 forks source link

Can't load customized pipeline #26

Closed olexandryermilov closed 12 months ago

olexandryermilov commented 3 years ago

Hi! I trained a customized pipeline for customized-mwt using my data, and I get this message during verifying it:

Training done
Customized pipeline is ready to use!
It can be initialized as follows:
-----------------------------------
from trankit import Pipeline
p = Pipeline(lang='customized-mwt', cache_dir='./save_dir')

However, when I try to use it, I receive next error:

  File "aug_trankit.py", line 70, in <module>
    p = Pipeline(lang='customized-mwt', cache_dir='./save_dir')
  File "/home/uaparsers/trankit/trankit/pipeline.py", line 78, in __init__
    self._load_vocabs()
  File "/home/uaparsers/trankit/trankit/pipeline.py", line 276, in _load_vocabs
    '{}/{}.vocabs.json'.format(lang, lang))) as f:
FileNotFoundError: [Errno 2] No such file or directory: './save_dir/xlm-roberta-base/customized-mwt/customized-mwt.vocabs.json'

Why do I get this error if pipeline is verified? this is my code:https://pastebin.com/2BRmrHYL

minhhdvn commented 3 years ago

Hi @olexandryermilov, Thanks for reporting the error. We have fixed this in the new version v1.1.0 of trankit. The new version can be installed via pip with the command:

pip install trankit==1.1.0

Please try it and let us know. Thanks.