DFKI-NLP / TRE

[AKBC 19] Improving Relation Extraction by Pre-trained Language Representations
https://arxiv.org/abs/1906.03088
MIT License
108 stars 12 forks source link

evaluate the SemEval 2010 model with "None" masking #8

Open qiunlp opened 4 years ago

qiunlp commented 4 years ago

1) I have download the files:model.pt,text_encoder.pkl,label_encoder.pkl

2) python relation_extraction.py evaluate --dataset semeval_2010_task8 --test_file ./datasets/SemEval2010/test.jsonl --log_dir ./logs/ --save_dir ./logs/tre_semeval/ --masking_mode None

3) but Traceback (most recent call last): File "/home/qwh/桌面/TRE/relation_extraction.py", line 447, in 'evaluate': evaluate File "/home/qwh/.local/lib/python3.6/site-packages/fire/core.py", line 127, in Fire component_trace = _Fire(component, args, context, name) File "/home/qwh/.local/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire component, remaining_args) File "/home/qwh/.local/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable result = fn(*varargs, kwargs) File "/home/qwh/桌面/TRE/relation_extraction.py", line 374, in evaluate model, text_encoder, label_encoder = load_model(save_dir, model_file=model_file) File "/home/qwh/桌面/TRE/train_utils.py", line 97, in load_model text_encoder = pickle.load(f) File "tokenizer.pyx", line 62, in spacy.tokenizer.Tokenizer.init File "tokenizer.pyx", line 406, in spacy.tokenizer.Tokenizer._load_special_tokenization File "tokenizer.pyx", line 422, in spacy.tokenizer.Tokenizer.add_special_case File "vocab.pyx", line 256, in spacy.vocab.Vocab.make_fused_token File "morphology.pyx", line 283, in spacy.morphology.Morphology.assign_tag File "morphology.pyx", line 307, in spacy.morphology.Morphology.assign_tag_id File "morphology.pyx", line 241, in spacy.morphology.Morphology.lemmatize File "/home/qwh/.local/lib/python3.6/site-packages/spacy/lemmatizer.py", line 43, in call lookup_table = self.lookups.get_table("lemma_lookup", {}) AttributeError: 'Lemmatizer' object has no attribute 'lookups' sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='./logs/2020-05-16__08-44__586672/logs.jsonl' mode='w' encoding='UTF-8'>**

Thank you.