deeptype
deeptype copied to clipboard
How can I find associated types of an entity ?
I want to extract the optimal entity from a list of candidates using Equation 6 from the paper:
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.
It's a two-step process:
- 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
- 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
- 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"))
)