sheffieldnlp/naacl2018-fever

Error in Data Preparation

Closed this issue · 2 comments

While executing the Data preparation step using the below-mentioned command, I got the following error:

PYTHONPATH=src python src/scripts/retrieval/document/batch_ir_ns.py --model data/index/fever-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz --count 1 --split train

File "src/scripts/retrieval/document/batch_ir_ns.py", line 24, in
ranker = retriever.get_class('tfidf')(tfidf_path=args.model)
File "/home/ahatua/anaconda3/envs/fever/lib/python3.6/site-packages/drqa/retriever/tfidf_doc_ranker.py", line 39, in init
matrix, metadata = utils.load_sparse_csr(tfidf_path)
File "/home/ahatua/anaconda3/envs/fever/lib/python3.6/site-packages/drqa/retriever/utils.py", line 36, in load_sparse_csr
return matrix, loader['metadata'].item(0) if 'metadata' in loader else None
File "/home/ahatua/anaconda3/envs/fever/lib/python3.6/_collections_abc.py", line 666, in contains
self[key]
File "/home/ahatua/anaconda3/envs/fever/lib/python3.6/site-packages/numpy/lib/npyio.py", line 255, in getitem
pickle_kwargs=self.pickle_kwargs)
File "/home/ahatua/anaconda3/envs/fever/lib/python3.6/site-packages/numpy/lib/format.py", line 727, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False

j6mes commented

Numpy has changed the interface for load_sparse_csr recently which breaks DrQA.

I've just updated the dependencies to fever-drqa which should fix that.

git pull 
pip install --upgrade -r requirements.txt

should fix