Closed GaiYu0 closed 4 years ago
Can you post a full traceback?
Sure. The traceback:
A script that triggers the error:
from allennlp.common import Params
from allennlp.data import DatasetReader
reader_params = Params({
"type": "aida_wiki_linking",
"entity_disambiguation_only": False,
"entity_indexer": {
"type": "characters_tokenizer",
"namespace": "entity_wiki",
"tokenizer": {
"type": "word",
"word_splitter": {
"type": "just_spaces"
}
}
},
"extra_candidate_generators": {
"wordnet": {
"type": "wordnet_mention_generator",
"entity_file": "s3://allennlp/knowbert/wordnet/entities.jsonl"
}
},
"should_remap_span_indices": True,
"token_indexers": {
"tokens": {
"type": "bert-pretrained",
"do_lowercase": True,
"max_pieces": 512,
"pretrained_model": "bert-base-uncased",
"use_starting_offsets": True,
}
}
})
reader = DatasetReader.from_params(Params(reader_params))
You need to import the aida_wiki_linking
reader so that allennlp can use the correct class.
Add from kb.include_all import LinkingReader
to the top of your script.
Issue solved. Thank you very much!
First, thank you for making your code available!
When running bin/evaluate_wiki_linking.py, I got the error
I passed the test
Did I miss anything? Thank you very much!