AIPHES / emnlp19-moverscore

MoverScore: Text Generation Evaluating with Contextualized Embeddings and Earth Mover Distance
MIT License
192 stars 31 forks source link

installation failure #3

Closed xyyimian closed 4 years ago

xyyimian commented 4 years ago

Hi,

I am using python 3.6.3 and I used

pip install moverscore
pip install -r requirements.txt

to install necessary prerequisite.

however in python console I used

from moverscore import get_idf_dict, word_mover_score

it shows

Model name '/home/yuxing/.moverscore' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese). We assumed '/home/yuxing/.moverscore/vocab.txt' was a path or url but couldn't find any file associated to this path or url.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/home/yuxing/.conda/envs/moverscore/lib/python3.6/site-packages/moverscore-0.7-py3.6.egg/moverscore.py", line 79, in <module>
  File "/home/yuxing/.conda/envs/moverscore/lib/python3.6/site-packages/pytorch_pretrained_bert/modeling.py", line 597, in from_pretrained
    config = BertConfig.from_json_file(config_file)
  File "/home/yuxing/.conda/envs/moverscore/lib/python3.6/site-packages/pytorch_pretrained_bert/modeling.py", line 206, in from_e_file
    with open(json_file, "r", encoding='utf-8') as reader:
FileNotFoundError: [Errno 2] No such file or directory: '/home/yuxing/.moverscore/bert_config.json'

I checked /home/yuxing/.moverscore, there is a MNLI_BERT.zip file there. It seems that the zip file have not been unzipped. Since I got another error message somewhere else

Downloading https://github.com/AIPHES/emnlp19-moverscore/releases/download/0.6/MNLI_BERT.zip to /home/yuxing/.moverscore/MNLI_BERT.zip

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yuxing/emnlp19-moverscore/moverscore.py", line 56, in <module>
    z = zipfile.ZipFile(tarball, 'r')
  File "/home/yuxing/.conda/envs/moverscore/lib/python3.6/zipfile.py", line 1108, in __init__
    self._RealGetContents()
  File "/home/yuxing/.conda/envs/moverscore/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

I suppose that maybe the zip file has been damaged that it can not be normally unzipped.

andyweizhao commented 4 years ago

Hi,

You are right, since the url to download the BERT-NLI model is obsoleted. We have fixed this bug, please try to reinstall moverscore one more time.