Description Usage Arguments Value See Also Examples
A wrapper for NLP,/openNLP's named date recognition annotation.
1 2 3 | date_entity(text.var, entity.annotator = "date_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: location_entity
,
money_entity
,
organization_entity
,
percent_entity
, person_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)
dates <- date_entity(presidential_debates_2012$dialogue)
unlist(dates)
library(dplyr)
presidential_debates_2012$dates <- date_entity(presidential_debates_2012$dialogue)
presidential_debates_2012 %>%
{.[!sapply(.$dates, is.null), ]} %>%
rowwise() %>%
mutate(dates = paste(dates, collapse=", ")) %>%
select(person, time, dates)
library(tidyr)
presidential_debates_2012 %>%
{.[!sapply(.$dates, is.null), ]} %>%
unnest() %>%
select(person, time, dates)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.