ematvey / hierarchical-attention-networks

Document classification with Hierarchical Attention Networks in TensorFlow. WARNING: project is currently unmaintained, issues will probably not be addressed.
MIT License
463 stars 148 forks source link

Error While Running yelp_prepare.py #14

Open wangtao1321 opened 6 years ago

wangtao1321 commented 6 years ago

Hellow,While Running yelp_prepare.py, I got error log as follow. The code has been ran with Yelp dataset round10 and tensorflow 1.1.0 and Python 3.5.2 in Linux.

0it [00:00, ?it/s] Traceback (most recent call last): File "yelp_prepare.py", line 98, in make_data() File "yelp_prepare.py", line 78, in make_data for sent in en(review['text']).sents: File "/home/wangtao/py35env/lib/python3.5/site-packages/spacy/language.py", line 330, in call for name, proc in self.pipeline: TypeError: 'Tagger' object is not iterable

gkaramanolakis commented 6 years ago

This is an issue of the 'spacy' module. If you downgrade to an older version of spacy (pip install -U spacy==1.9.0) you shouldn't get this error.

darwinlc commented 6 years ago

change spacy pipeline as

en.pipeline = [('tagger', en.tagger), ('parser', en.parser)]

HearyShen commented 6 years ago

Your solution works well for me. Thank you for solving it. (@darwinlc )

changing

en.pipeline = [en.tagger, en.parser]

to

en.pipeline = [('tagger', en.tagger), ('parser', en.parser)]

Environment: