ansonb / RECON

This is the code for the paper 'RECON: Relation Extraction using Knowledge Graph Context in a Graph Neural Network'.
MIT License
38 stars 11 forks source link

Create a new dataset #4

Closed juanluis17 closed 2 years ago

juanluis17 commented 3 years ago

Hello, I would like to modify the NYT dataset, do you have a script to generate the files it uses?

ansonb commented 2 years ago

Hi,

Besides the standard nyt dataset we have used the wikidata query service to obtain the entity attributes(side information). https://query.wikidata.org/

Below are some sample queries corresponding to each attribute for the entity id: Q76 (In case of nyt we need to get a mapping between the freebase entities and wikidata which we obtain from the freebase data dump: https://developers.google.com/freebase; https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44818.pdf; https://github.com/google/freebase-wikidata-converter)

Description: SELECT DISTINCT ?smallDescription WHERE { wd:Q76 schema:description ?smallDescription FILTER (LANG(?smallDescription) = "en") }

Instance of: SELECT ?item ?itemLabel WHERE { wd:Q76 wdt:P31 ?item. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Alias: SELECT ?altLabel { VALUES (?wd) {(wd:Q76)} ?wd skos:altLabel ?altLabel . FILTER (lang(?altLabel) = "en") }

Surface Form: SELECT DISTINCT ?label WHERE { wd:Q76 rdfs:label ?label. FILTER (langMatches( lang(?label), "EN" ) ) }

Thanks