amazon-science / wqa_tanda

This repo provides code and data used in our TANDA paper.
Other
108 stars 26 forks source link

unexpected EOF while parsing #5

Closed desilollo closed 3 years ago

desilollo commented 4 years ago

I used the following script:

C:\Users\loren\Desktop\transformers\examples>python run_glue.py --model_type bert --model_name_or_path bert-base-uncased --task_name ASNQ --do_train --do_eval --do_lower_case --data_dir C:\Users\loren\Desktop\transformers --per_gpu_train_batch_size 150 --learning_rate 2e-5 --num_train_epochs 2.0 --overwrite_output_dir --output_dir C:\Users\loren\Desktop\transformers\output

but it gives error:

`Traceback (most recent call last): File "run_glue.py", line 561, in main() File "run_glue.py", line 511, in main train_dataset = load_and_cache_examples(args, args.task_name, tokenizer, evaluate=False) File "run_glue.py", line 300, in load_and_cache_examples examples = processor.get_dev_examples(args.data_dir) if evaluate else processor.get_train_examples(args.data_dir) File "C:\Users\loren\AppData\Local\Programs\Python\Python38\lib\site-packages\transformers\data\processors\glue.py", line 529, in get_train_examples return self._create_examples( File "C:\Users\loren\AppData\Local\Programs\Python\Python38\lib\site-packages\transformers\data\processors\glue.py", line 548, in _create_examples if eval(line[-1].strip()) == 4: File "", line 1

2 String

        ^

SyntaxError: unexpected EOF while parsing`

If anyone could help me thank in advance

sid7954 commented 3 years ago

The above error indicates that the data file is not in the correct format. For our code patch to work, the data file should be formatted similar to ASNQ where in a single .tsv file contains the <Question> <TAB> <Candidate> <TAB> <Label> per line of the file.

The command snippet pasted by you shows that you provided C:\Users\loren\Desktop\transformers as the data directory which does not contain train.tsv / dev.tsv / test.tsv files