kpu / kenlm

KenLM: Faster and Smaller Language Model Queries
http://kheafield.com/code/kenlm/
Other
2.5k stars 512 forks source link

Kenlm error while running machine translation code #383

Open sabahahmed1 opened 2 years ago

sabahahmed1 commented 2 years ago

I am trying to reproduce the findings from a machine translation paper: https://github.com/pmichel31415/mtnt using Google Colab

After installing packages including Kenlm, when I type:

bash scripts/prepare_model.sh config/data.en.config

I keep getting the following error:

Traceback (most recent call last): File "kenlm.pyx", line 139, in kenlm.Model.init RuntimeError: util/file.cc:76 in int util::OpenReadOrThrow(const char*) threw ErrnoException because `-1 == (ret = open(name, 00))'. No such file or directory while opening /content/mtnt/models/corpus.en.1000.bpe.lm.5.bin

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "scripts/eval_kenlm.py", line 14, in model = kenlm.Model(model_file) File "kenlm.pyx", line 142, in kenlm.Model.init OSError: Cannot read model 'models/corpus.en.1000.bpe.lm.5.bin' (util/file.cc:76 in int util::OpenReadOrThrow(const char*) threw ErrnoException because `-1 == (ret = open(name, 00))'. No such file or directory while opening /content/mtnt/models/corpus.en.1000.bpe.lm.5.bin)

Please advise!

kpu commented 2 years ago

Would you mind repeating the last 8 words of the error message?

sabahahmed1 commented 2 years ago

Sorry, is this what you wanted?

No such file or directory while opening /content/mtnt/models/corpus.en.1000.bpe.lm.5.bin)

kpu commented 2 years ago

The file /content/mtnt/models/corpus.en.1000.bpe.lm.5.bin does not exist. As to why it doesn't exist, that's really a question for the author of scripts/prepare_model.sh.

sabahahmed1 commented 2 years ago

Oh I see. I am just starting out so I don't know a lot of things. Thanks for your input.