Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when predicting from NLI #11

Open
filemon11 opened this issue Feb 28, 2024 · 0 comments
Open

Error when predicting from NLI #11

filemon11 opened this issue Feb 28, 2024 · 0 comments

Comments

@filemon11
Copy link

I get the following error, when parsing the multiNLI development split:

Traceback (most recent call last):
  File "/home/lukas/diora/diora/pytorch/diora/scripts/parse.py", line 241, in <module>
    run(options)
  File "/home/lukas/diora/diora/pytorch/diora/scripts/parse.py", line 231, in run
    file_writer.update(batch_map, trees)
  File "/home/lukas/diora/diora/pytorch/diora/scripts/parse.py", line 156, in update
    file_order = batch_map['file_order'][ii]
KeyError: 'file_order'

I am using the following command:

python pytorch/diora/scripts/parse.py \
    --retain_file_order \
    --batch_size 10 \
    --data_type nli \
    --elmo_cache_dir ./cache \
    --load_model_path ./diora-checkpoints/mlp-softmax/model.pt \
    --model_flags ./diora-checkpoints/mlp-softmax/flags.json \
    --experiment_path ./log/redone/model_periodic.pt \
    --validation_path ./data/multinli_1.0/multinli_1.0_dev_matched.jsonl \
    --validation_filter_length -1

It works without errors when omitting the --retain_file_order flag. But then I get the following error when running EVALB:

Traceback (most recent call last):
  File "/home/lukas/diora/diora/pytorch/diora/scripts/evalb.py", line 177, in <module>
    main(args)
  File "/home/lukas/diora/diora/pytorch/diora/scripts/evalb.py", line 110, in main
    nltk_tree = nltk.Tree.fromstring(line)
  File "/home/lukas/diora/venv/lib/python3.10/site-packages/nltk/tree/tree.py", line 680, in fromstring
    cls._parse_error(s, match, open_b)
  File "/home/lukas/diora/venv/lib/python3.10/site-packages/nltk/tree/tree.py", line 731, in _parse_error
    raise ValueError(msg)
ValueError: Tree.read(): expected '(' but got 'gold_label'
            at index 0.
                "gold_label..."
                 ^

with command

 python pytorch/diora/scripts/evalb.py     
    --evalb ./EVALB
    --evalb_config ./EVALB/diora.prm
    --out ./log/redone
    --pred ./log/redone/parse.jsonl
    --gold ./data/multinli_1.0/multinli_1.0_dev_matched.txt

How do I recreate the results from table 2 in the paper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant