initCoreNLP {coreNLP} | R Documentation |
Initialize the CoreNLP java object
Description
This must be run prior to calling any other CoreNLP functions. It may be called multiple times in order to specify a different parameter set, but note that if you use a different configuration during the same R session it must have a unique name.
Usage
initCoreNLP(libLoc, type = c("english", "english_all", "english_fast",
"arabic", "chinese", "french", "german", "spanish"), parameterFile = NULL,
mem = "4g")
Arguments
libLoc |
a string giving the location of the CoreNLP java files. This should point to a directory which contains, for example the file "stanford-corenlp-*.jar", where "*" is the version number. If missing, the function will try to find the library in the environment variable CORENLP_HOME, and otherwise will fail. |
type |
type of model to load. Ignored if parameterFile is set. |
parameterFile |
the path to a parameter file. See the CoreNLP documentation for an extensive list of options. If missing, the package will simply specify a list of standard annotators and otherwise only use default values. |
mem |
a string giving the amount of memory to be assigned to the rJava
engine. For example, "6g" assigned 6 gigabytes of memory. At least
2 gigabytes are recommended at a minimum for running the CoreNLP
package. On a 32bit machine, where this is not possible, setting
"1800m" may also work. This option will only have an effect the first
time |
Examples
## Not run:
initCoreNLP()
sIn <- "Mother died today. Or, maybe, yesterday; I can't be sure."
annoObj <- annotateString(sIn)
## End(Not run)