openai / deeptype

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

How can I find associated types of an entity ? #45

Open mailong25 opened 5 years ago

mailong25 commented 5 years ago

I want to extract the optimal entity from a list of candidates using Equation 6 from the paper:

image

But I don't how to find associated types of each candidate entity. Is there any easy way to get associated types from Wikipedia_anchor_text or Wikipedia_ID.

JonathanRaiman commented 2 years ago

It's a two-step process:

1) Use a lookup table in the TypeCollection class such as name2id (https://github.com/openai/deeptype/blob/master/extraction/classifiers/type_classifier.py#L17) to obtain a numerical id 2) load the projections (type, time, location, etc.) using code such as this one https://github.com/openai/deeptype/blob/11568183dd67a472cddbc286690a6153c07710b6/extraction/evaluate_type_system.py#L52 3) The classify method https://github.com/openai/deeptype/blob/11568183dd67a472cddbc286690a6153c07710b6/extraction/evaluate_type_system.py#L49 of the projections gives you the associated types (e.g. type = load_oracle_classification("/path/to/classifcation").classify(wkd("Human")))