knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) library(spotlight)
R wrapper to the DBpedia Spotlight API. All official documentation is online.
It is a tool for automatically annotating mentions of DBpedia resources in text, providing a solution for linking unstructured information sources to the Linked Open Data cloud through DBpedia. - DBpedia Spotlight
Global options are set with spot_set_opts
.
You can install spotlight from github with:
# install.packages("devtools") devtools::install_github("news-r/spotlight")
library(spotlight) # Data to extract entities from text = c( "Donald Trump is probably in Washington DC.", "szzza dasdazsd azzsd daawq", # garbage "" # empty document ) # remove empty documents text <- spot_filter(text) # Annotate places <- spot_annotate(text, types = "DBpedia:Place") knitr::kable(places)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.