简体   繁体   中英

R package installation issue for R version 3.1.1

I have been trying to install the "OpenNLP" packages instructed by link of. However, I got the error messages shown as following 在此输入图像描述

R packages for openNLP

Provided that you want to the install pre-trained models for English in openNLP.models.en package and not the openNLP itself (they come separate), you need to provide the full path to the file as the first argument and then repos=NULL. The version below worked for me:

install.packages("http://datacube.wu.ac.at/src/contrib/openNLPmodels.en_1.5-1.tar.gz",
                  repos=NULL, type="source")

openNLP.models.en is needed for openNLP to run annotators. You can download separate models and point to them in the functions itself, like below:

Maxent_Sent_Token_Annotator(language = "en", probs = FALSE, model = "models/en-sent.bin")

You have to have them in your working directory under "models"

However entity annotator never worked for me this way:

Maxent_Entity_Annotator(language = "en", kind = "person", 
                        probs = FALSE,model = model = "models/en-ner-person.bin")

I got a java error saying that the model was not found.

I had to install the openNLP.models.en package.

These steps worked for me (running R version 3.3.1 on RStudio 1.0.136 for Windows 10):

1) install.packages("openNLP")

2) install.packages("openNLPmodels.en", repos = " http://datacube.wu.ac.at ")

At this point three warnings were displayed in the console saying "Unable to access index for repository" but eventually the package was downloaded and installed.

3) Select both packages on the package list

它可以直接从CRAN获得(至少对于Mac):

install.packages("openNLP")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM