-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
55 lines (39 loc) · 1.41 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
output:
github_document:
html_preview: false
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
library(spotlight)
```
# spotlight
[](https://travis-ci.org/news-r/spotlight) [](https://ci.appveyor.com/project/JohnCoene/spotlight)
R wrapper to the [DBpedia Spotlight API](http://www.dbpedia-spotlight.org/). All [official documentation](https://github.com/dbpedia-spotlight/dbpedia-spotlight-model) 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`.
## Installation
You can install spotlight from github with:
```r
# install.packages("devtools")
devtools::install_github("news-r/spotlight")
```
## Examples
```{r example}
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)
```