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'
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'