Closed jind11 closed 4 years ago
There is an automatic download function in Line 147 of the code:
def download_scripts():
files = [('detokenizer.perl',
'https://raw.githubusercontent.com/moses-smt/mosesdecoder/master/scripts/tokenizer/detokenizer.perl'),
('multi-bleu-detok.perl',
'https://raw.githubusercontent.com/moses-smt/mosesdecoder/master/scripts/generic/multi-bleu-detok.perl'),
('multi-bleu.perl',
'https://raw.githubusercontent.com/moses-smt/mosesdecoder/master/scripts/generic/multi-bleu.perl'),
]
for fname, url in files:
if not os.path.isfile(fname):
os.system('curl -o {fname} {url}'.format(fname=fname, url=url))
Should you have any further questions, feel free to let me know.
in line 96 of "bleu.py", you did not consider the case where there is suffix in the filename, which is actually very common when people are doing experiments. You need to consider this situation.
Let me change it in a future version. Thanks for the suggestion!
function "download_scripts" is not automatically executed when there are no "multi-bleu-detok.perl" files, so readers will get confused and do not know where to find it.
This sounds very weird. I just cloned the package but no error shows up. Theoretically, download_scripts()
will be executed if any of the files in ["detokenizer.perl", "multi-bleu-detok.perl", "multi-bleu.perl"]
does not exist. (See Line156)
hi, I tried to run your code but got the error of "no file named multi-bleu-detok.perl", could you refer to the link for downloading this file? Thanks!