opennlp - R: annotate() gives error in R -


I'm new to R. I have to use POSTagger in my code. I am using OpenNLP when attempting the following sample code (in the sample r file):

  Library ("NLP") library ("OpenNLP") S & lt; - "Cache Witchhen, 61 year old, one on board", "Unqualified Director will be included as Nov. 29, \ N", "President of Mr. Vernon Elsevier NV", "Dutch Publishing Group"), Fall = "") S & lt; - as.String (s) sent_token_annotator & lt; - Maxent_Sent_Token_Annotator () a1 & lt; - The interpretation (s, sent_token_annotator) is [a1]   

and run this code from the R console (using the source ("sample .r")) I get the following error:

  error in as.data.frame.default (x [[i]], alternate = TRUE: can not force a data.frame class "c" ("Simple_POS_Tag_Annotator", "interpreter" ) "  

after the output of traceback () is in order:

  14: stop (gettexf (" "data" Can not force "% s \", Dippers (Class (X)), d Omen = NA) 13: as.data.frame.default (x [[I]], alternate = TRUE 12: as.data.frame (x [[i]], alternate = true) 11: Data.frame (x = Function (s, a = annotation ()) {s & lt;-as.String (s) y & lt; -f (s) n & lt; - length (y) id & lt; - .seq_id (Next_id (A $ id), n) type & lt; - rep.int ("sentence", n) if (is. Annotation (y) {y $ id & lt; - id y $ type & lt; - type } And if (span (y)) {y and lieutenant; - like.notation (y, id = id, type = type)} and stop ("invalid result from underlying sentence tokonizer") if (length (i & Lt; - which (a $ type == "paragraph"))) {& lt; - A [i] features a $ l & lt; - lapply (annotations_in_spans (y, one), function (e) list (component = e $ id)) y & lt; - eval (expr, environment, enclos) 9: eval (as.call (c (data.frame), x, x, Check.names = alternative, stringsAsFactors = stringsAsFactors) 8: as.data.frame.list (x [[i]], optional = true, stringsAsFactors = stringsAsFactors 7: as.data.frame (x [[i] ], Eval (expr, atmosphere, enclos) 3: Eval (ei, envir), optionally 2: with eval (eval (ei, envir)) 1: source ("sample.R")   

What could possibly be wrong? I am using RX 64 3.1.1 on Windows 7. Any help would be greatly appreciated. thank you in advanced.

I have the same problem and I decided to remove / separate the ggplot2 package. Gagplot 2 has functions called annotated and it has the same name in both packages. I suggest that you make sure that this is seeing the correct function in the library ... in my case it was viewing the annotated function of ggplot2 and not the NLP package.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -