hotpotqa / hotpot

Apache License 2.0
445 stars 75 forks source link

NameError: during preprocessing #26

Open akshay0411 opened 5 years ago

akshay0411 commented 5 years ago

when i want to give below command as per your manual at here.. Preprocess the training and dev sets in the distractor setting:

python main.py --mode prepro --data_file hotpot_train_v1.1.json --para_limit 2250 --data_split train python main.py --mode prepro --data_file hotpot_dev_distractor_v1.json --para_limit 2250 --data_split dev

Preprocess the dev set in the full wiki setting:

python main.py --mode prepro --data_file hotpot_dev_fullwiki_v1.json --data_split dev --fullwiki --para_limit ....... i got error in prepro.py at 96 97 def _process(sent, is_sup_fact, is_title=False): ---> 98 nonlocal [text_context, context_tokens, context_chars, offsets, start_end_facts, flat_offsets] text_context = undefined 99 N_chars = len(text_context)

NameError: global name 'nonlocal' is not defined

how may i solve it?

qipeng commented 4 years ago

nonlocal is part of Python 3. Are you using Python 3 to run our code (see also the README)?