Learn R Programming

stanza (version 1.0-3)

stanza_download: Download Models

Description

Download pretrained NLP models. For more information about the parameters see https://stanfordnlp.github.io/stanza/download_models.html.

Usage

stanza_download(
  language = "en",
  model_dir = stanza_options("model_dir"),
  package = "default",
  processors = list(),
  logging_level = "INFO",
  resources_url = stanza_options("resources_url"),
  resources_version = stanza_options("resources_version"),
  model_url = stanza_options("model_url")
)

Value

NULL

Arguments

language

a character string giving the language (default is "en").

model_dir

path to the directory for storing the for Stanza models (default is "~/stanza_resources").

package

a character string giving the package to be used (default is "default". In this context package refers to a language specific set of models packaged together to a single ".zip" file.

processors

a character string or named list giving the processors to download models for. If a string is provided it should provide the names of the desired processers as comma seperated string, e.g., "tokenize,pos". If a named list is provided, the name should be the processor name and the values the package name, e.g., list(tokenize = "ewt", pos = "ewt").

logging_level

a character string giving the logging level (default is "INFO"), available levels are c('DEBUG', 'INFO', 'WARNING', 'WARN', 'ERROR', 'CRITICAL', 'FATAL').

resources_url

a character string giving the url to the Stanza model resources. The default value is obtained from Python during the initiatlization and can be obtained and changed by using stanza_options.

resources_version

a character string giving the version of the resources. The default value is obtained from Python during the initiatlization and can be obtained and changed by using stanza_options.

model_url

a character string giving the model url. The default value is obtained from Python during the initiatlization and can be obtained and changed by using stanza_options.

Examples

Run this code
if (stanza_options("testing_level") >= 3L) {
stanza_initialize()
stanza_download("en")
}

Run the code above in your browser using DataLab