Description Usage Arguments Value See Also Examples
A wrapper for NLP,/openNLP's named person recognition annotation.
1 2 3 | person_entity(text.var, entity.annotator = "person_annotator",
word.annotator = word_annotator(), element.chunks = floor(2000 *
(23.5/mean(sapply(text.var, nchar), na.rm = TRUE))))
|
text.var |
The text string variable. |
entity.annotator |
A character vector identifying an entity recognition
annotator ( |
word.annotator |
A word annotator. |
element.chunks |
The number of elements to include in a chunk. Chunks are
passed through an |
Returns a data.frame of named entities and frequencies.
Other variable functions: date_entity
,
location_entity
,
money_entity
,
organization_entity
,
percent_entity
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
data(presidential_debates_2012)
peoples <- person_entity(presidential_debates_2012$dialogue)
unlist(peoples)
library(dplyr)
presidential_debates_2012$persons <- person_entity(presidential_debates_2012$dialogue)
presidential_debates_2012 %>%
{.[!sapply(.$persons, is.null), ]} %>%
rowwise() %>%
mutate(persons = paste(persons, collapse=", ")) %>%
select(person, time, persons)
library(tidyr)
presidential_debates_2012 %>%
{.[!sapply(.$persons, is.null), ]} %>%
unnest() %>%
select(person, time, persons)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.