DFKI-NLP / DISTRE

[ACL 19] Fine-tuning Pre-Trained Transformer Language Models to Distantly Supervised Relation Extraction
https://www.aclweb.org/anthology/P19-1134
Apache License 2.0
85 stars 13 forks source link

KeyErrors if using other dataset #7

Open bug-orz opened 3 years ago

bug-orz commented 3 years ago

I'm trying to test this method on my own dataset, and I met KeyErrors. Do you please kown how to solve this problem? Thanks a lot!

Traceback (most recent call last): File "/data/anaconda3/envs/allennlp/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/data/anaconda3/envs/allennlp/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/run.py", line 18, in main(prog="allennlp") File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/init.py", line 72, in main args.func(args) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/train.py", line 111, in train_model_from_args args.force) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/train.py", line 142, in train_model_from_file return train_model(params, serialization_dir, file_friendly_logging, recover, force) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/commands/train.py", line 298, in train_model model = Model.from_params(vocab=vocab, params=params.pop('model')) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/common/from_params.py", line 274, in from_params return subclass.from_params(params=params, extras) File "/data/anaconda3/envs/allennlp/lib/python3.6/site-packages/allennlp/common/from_params.py", line 287, in from_params return cls(kwargs) # type: ignore File "/data/DISTRE/tre/model.py", line 235, in init self.na_idx = self.vocab.get_token_to_index_vocabulary('labels')['NA'] KeyError: 'NA'