deeptype icon indicating copy to clipboard operation
deeptype copied to clipboard

How can I find associated types of an entity ?

Open mailong25 opened this issue 6 years ago • 1 comments

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.

mailong25 avatar Oct 15 '18 09:10 mailong25

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")))

JonathanRaiman avatar Jun 23 '22 22:06 JonathanRaiman