Learn R Programming

spacyr (version 1.2.1)

spacy_initialize: Initialize spaCy

Description

Initialize spaCy to call from R.

Usage

spacy_initialize(
  model = "en_core_web_sm",
  python_executable = NULL,
  virtualenv = NULL,
  condaenv = NULL,
  ask = FALSE,
  refresh_settings = FALSE,
  save_profile = FALSE,
  check_env = TRUE,
  entity = TRUE
)

Arguments

model

Language package for loading spaCy. Example: en_core_web_sm (English) and de_core_web_sm (German). Default is en_core_web_sm.

python_executable

the full path to the Python executable, for which spaCy is installed

virtualenv

set a path to the Python virtual environment with spaCy installed Example: virtualenv = "~/myenv"

condaenv

set a path to the anaconda virtual environment with spaCy installed Example: condalenv = "myenv"

ask

logical; if FALSE, use the first spaCy installation found; if TRUE, list available spaCy installations and prompt the user for which to use. If another (e.g. python_executable) is set, then this value will always be treated as FALSE.

refresh_settings

logical; if TRUE, spacyr will ignore the saved settings in the profile and initiate a search of new settings.

save_profile

logical; if TRUE, the current spaCy setting will be saved for the future use.

check_env

logical; check whether conda/virtual environment generated by spacyr_istall() exists

entity

logical; if FALSE is selected, named entity recognition is turned off in spaCy. This will speed up the parsing as it will exclude ner from the pipeline. For details of spaCy pipeline, see https://spacy.io/usage/processing-pipelines. The option FALSE is available only for spaCy version 2.0.0 or higher.

Author

Akitaka Matsuo