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

python theory_label_generator.py KeyError: 'id' #27

Open
SumNeuron opened this issue Oct 22, 2021 · 0 comments
Open

python theory_label_generator.py KeyError: 'id' #27

SumNeuron opened this issue Oct 22, 2021 · 0 comments

Comments

@SumNeuron
Copy link

python theory_label_generator.py --input-file sample_input/sample_input.json --output-file grammars_and_config/output/ruletaker_theory_generator_output_theory1_label.jsonl --input-format current

where sample_input/sample_input.json is

# copy pasted from README.md
sample_input = {
  "json_class": "TheoryAssertionRepresentationWithLabel",
  "theory_statements": [
    "+ ( nice 'Harry' )",
    "[ + ( red X ) ] -> + ( red X )",
    "+ ( big 'Charlie' )",
    "+ ( white 'Erin' )",
    "+ ( green 'Bob' ), [ + ( white X ) , + ( red X ) ] -> + ( nice X )",
    "[ + ( red X ) ] -> + ( cold X )",
    "[ + ( rough X ) ] -> + ( nice X )",
    "[ + ( young X ) ] -> + ( kind X )",
    "[ + ( nice X ) ] -> + ( quiet X )",
    "+ ( blue 'Fiona' )",
    "[ + ( round X ) ] -> + ( young X )",
    "+ ( green 'Erin' )", "+ ( round 'Harry' )",
    "[ + ( nice X ) ] -> + ( green X )",
    "+ ( green 'Gary' )"
  ],
  "assertion_statement": "+ ( kind 'Fiona' )",
  "label": False,
  "exception": None 
}
with open('./sample_input/sample_input.json', 'w') as f:
    json.dump(sample_input, f)

and grammars_and_config/output/ruletaker_theory_generator_output_theory1_label.jsonl is

python theory_generator.py --grammar ./grammars_and_config/grammars/ruletaker_grammar_theory1.txt --config-json ./grammars_and_config/config/ruletaker_theory_generator_config_theory1.json --op-theory-jsonl ./grammars_and_config/output/ruletaker_theory_generator_output_theory1.jsonl

which gives me the error

Traceback (most recent call last):
  File "~/Downloads/ruletaker/theory_label_generator.py", line 640, in <module>
    main()
  File "~/Downloads/ruletaker/theory_label_generator.py", line 629, in main
    run_theorem_prover(
  File "~/Downloads/ruletaker/theory_label_generator.py", line 268, in run_theorem_prover
    instance = TheoryAssertionRepresentationWithLabel.from_json(instance_json)
  File "~/Downloads/ruletaker/common.py", line 681, in from_json
    json_dict["id"],
KeyError: 'id'
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