Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202004

Has the method annotations in R(NLP package) been deprecated or replaced?

$
0
0

I am following this article https://mylearnmachinelearning.com/category/linear-regression/ to create a Named Entity Extractor. Like required, I have installed all the openNLP, NLP, rJava, magrittr and openNLPmodels.en packages. All has gone to plan except when using this function annotations.:

 # Extract entities from an AnnotatedPlainTextDocument
     entities <- function(doc, kind) {
     s <- doc$content
     a <- annotations(doc)[[1]] #Point of error
     if(hasArg(kind)) {
         k <- sapply(a$features, `[[`, "kind")
         s[a[k == kind]]
     } else {
         s[a[a$type == "entity"]]
     }
 }

by using this:

entities(text_doc, kind = "person").

The thing is even the intellisense in RStudio does not seem to know any function annotations. It show annotation,annotate and annotations_in_spans and what not but there is no annotations.

There is even a YouTube video which demonstrates the same. Strangely he is able to use annotations there.

Package versions:

  1. openNLP: v0.2-6

  2. openNLPmodels.en: v1.5-1

  3. rJava - v0.9-9

  4. magrittr - v1.5

  5. NLP - v0.2-0


Viewing all articles
Browse latest Browse all 202004

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>