5

I have an Ubuntu Quantal 12.10 Server 64-bit instance. I am using openNLP for POS Tagging of sentences.

I am using POS tagging using openNLP with “Parallel Lapply setup”. It is running fine in RStudio environment. But in Ubuntu environment it is showing the following error.

Error in do.call(c, clusterApply(cl, x = splitList(X, length(cl)), fun = lapply,   :
  second argument must be a list

Any suggestion for the problem I’m facing?

This is the code that I am using:

tagPOS <-  function(x, ...) {

    s <- as.String(x)

    word_token_annotator <- Maxent_Word_Token_Annotator()

    a2 <- Annotation(1L, "sentence", 1L, nchar(s))

    a2 <- annotate(s, word_token_annotator, a2)

    a3 <- annotate(s, PTA, a2)

    a3w <- a3[a3$type == "word"]

    POStags <- unlist(lapply(a3w$features, `[[`, "POS"))

    POStagged <- paste(sprintf("%s/%s", s[a3w], POStags), collapse = " ")

    list(POStagged = POStagged, POStags = POStags)

  }



  cl <- makeCluster(mc <- getOption("cl.cores", detectCores()/2))

  clusterEvalQ(cl, {

    library(openNLP)

    library(NLP)

    PTA <- Maxent_POS_Tag_Annotator()

  })

This is the setup I am using:

  • Created an cloud instance with "Ubuntu Quantal 12.10 Server 64-bit instance"

  • Installed LAMP server in the instance

  • After which I installed R. By default R version was 2.15.0

  • Upgraded the R version to R 3.0.1

IRTFM
  • 258,963
  • 21
  • 364
  • 487
Siddharth
  • 51
  • 2
  • You could edit your question if the results of traceback() are informative, since the error report appears to involve the invocation of the parallel call. – IRTFM Sep 03 '13 at 23:16
  • As of thus far you've taken the code you saw elsewhere that you don't understand and haven't tried to and plopped them into the command line and then without any sort of debugging you request a solution. Do some detective work and give us some information that's of use. Provide `sessionInfo()`. Also stop trying to wrap everything into one step to earn extra points with the one step king. Plus you never give use the code for this step. Do the `parLapply` and assign it to something you can look at and use `dput` on to provide us with the output.That would tell us (and you) a ton more info. – Tyler Rinker Sep 04 '13 at 12:53

0 Answers0