openai / deeptype

Code for the paper "DeepType: Multilingual Entity Linking by Neural Type System Evolution"
https://arxiv.org/abs/1802.01021
Other
651 stars 147 forks source link

KeyError: 'category_link' #21

Closed ghost closed 6 years ago

ghost commented 6 years ago

I ran this:

python3 learning/evaluate_learnability.py --dataset sample_data.tsv --out report.json --wikidata ${DATA_DIR}wikidata/

and got KeyError message.

loading wikidata id -> index
done
/usr/local/lib/python3.5/dist-packages/wikidata_linker_utils/type_collection.py:367: UserWarning: Node 'Q21886162' under `bad_node_pair` is not a known wikidata id.
  oel
Traceback (most recent call last):
  File "learning/evaluate_learnability.py", line 297, in <module>
    main()
  File "learning/evaluate_learnability.py", line 251, in main
    proposal_sets = get_proposal_sets(collection, article_ids, args.seed)
  File "learning/evaluate_learnability.py", line 171, in get_proposal_sets
    relation = collection.relation("category_link")
  File "/usr/local/lib/python3.5/dist-packages/wikidata_linker_utils/type_collection.py", line 112, in relation
    print('load %r (%r)' % (name, self.wikidata_names2prop_names[name],))
KeyError: 'category_link'

Before I ran it, I excuted these commands:

export LANGUAGE=en
export DATA_DIR=data/
export CLASSIFICATION_DIR=data/type_classification
./extraction/full_preprocess.sh ${DATA_DIR} en
python3 extraction/project_graph.py ${DATA_DIR}wikidata/ extraction/classifiers/type_classifier.py  --export_classification ${CLASSIFICATION_DIR}
python3 extraction/evaluate_type_system.py extraction/configs/en_disambiguator_config_export_small.json --relative_to ${DATA_DIR}
python3 extraction/produce_wikidata_tsv.py extraction/configs/en_disambiguator_config_export_small.json --relative_to ${DATA_DIR} sample_data.tsv

How to run learning/evaluate_learnability.py correctly?

MurtyShikhar commented 6 years ago

https://github.com/openai/deeptype/pull/23 fixes this.