I'm using dbpedia spotlight to do NER. I would like to map each entity to wikipedia categories he's under. Is there an easy way to do this?
A simple example might be if I recognized the basketball player Michael Jordan
I would want to fetch the categories he's under, probably NBA Players
, Sports
, Chicago Bulls Past Players
, Etc...
In DBpedia, Wikipedia categories are represented using the
dcterms:subject
property. So, to retrieve the categories for Michael Jordan, you can use SPARQL like:Wikipedia also has an API to get categories of an article, using the
categories
module.