hierarchical-attention-networks icon indicating copy to clipboard operation
hierarchical-attention-networks copied to clipboard

Error While Running yelp_prepare.py

Open wangtao1321 opened this issue 7 years ago • 3 comments

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

wangtao1321 avatar Jan 18 '18 01:01 wangtao1321

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.

gkaramanolakis avatar Feb 08 '18 17:02 gkaramanolakis

change spacy pipeline as

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

darwinlc avatar Mar 08 '18 03:03 darwinlc

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:

  • spacy(2.0.9),
  • Python3.6.4

HearyShen avatar Mar 09 '18 15:03 HearyShen