Description Usage Arguments Examples
Generate Annotation class from tokenized data (tabular format).
1 |
x |
A |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
library(polmineR)
p_attrs <- c("word", "pos")
x <- data.frame(lapply(
setNames(p_attrs, p_attrs),
function(p_attr) corpus("GERMAPARLMINI") %>%
subset(speaker = "Angela Dorothea Merkel") %>%
get_token_stream(p_attribute = p_attr)
))
a <- as.Annotation(x)
json_outputter <- .jnew("edu.stanford.nlp.pipeline.JSONOutputter")
cat(.jcall(json_outputter, "Ljava/lang/String;", "print", a))
pl <- .jnew("edu.stanford.nlp.pipeline.AnnotationPipeline")
pl$addAnnotator(.jnew("edu.stanford.nlp.pipeline.WordsToSentencesAnnotator", FALSE))
pl$annotate(a)
cat(.jcall(conll_outputter, "Ljava/lang/String;", "print", a))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.