davidgolub/QuestionGeneration

“answer_char_ranges” error in prepro.py

Closed this issue · 0 comments

python3 -m newsqa.prepro

Preprocessing data type dev
Reading data from source path newsqa/dev.csv
0it [00:00, ?it/s]
Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/site-packages/pandas/indexes/base.py", line 2175, in get_value
return tslib.get_value_box(s, key)
File "pandas/tslib.pyx", line 881, in pandas.tslib.get_value_box (pandas/tslib.c:18246)
File "pandas/tslib.pyx", line 890, in pandas.tslib.get_value_box (pandas/tslib.c:17880)
TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "/anaconda/envs/py35/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/adminye/QuestionGeneration/bidaf/newsqa/prepro.py", line 300, in
main()
File "/home/adminye/QuestionGeneration/bidaf/newsqa/prepro.py", line 18, in main
prepro(args)
File "/home/adminye/QuestionGeneration/bidaf/newsqa/prepro.py", line 62, in prepro
prepro_each(args, 'dev', out_name='dev')
File "/home/adminye/QuestionGeneration/bidaf/newsqa/prepro.py", line 156, in prepro_each
answer_char_ranges = question_info['answer_char_ranges']
File "/anaconda/envs/py35/lib/python3.5/site-packages/pandas/core/series.py", line 601, in getitem
result = self.index.get_value(self, key)
File "/anaconda/envs/py35/lib/python3.5/site-packages/pandas/indexes/base.py", line 2183, in get_value
raise e1
File "/anaconda/envs/py35/lib/python3.5/site-packages/pandas/indexes/base.py", line 2169, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas/index.pyx", line 105, in pandas.index.IndexEngine.get_value (pandas/index.c:3567)
File "pandas/index.pyx", line 113, in pandas.index.IndexEngine.get_value (pandas/index.c:3250)
File "pandas/index.pyx", line 161, in pandas.index.IndexEngine.get_loc (pandas/index.c:4289)
File "pandas/src/hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13733)
File "pandas/src/hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13687)
KeyError: 'answer_char_ranges'