R/download.R

Defines functions cnlp_download_spacy

Documented in cnlp_download_spacy

#' Download model files needed for spacy
#'
#' The cleanNLP package does not supply the model files required
#' for using the spacy backend. These files can be downloaded
#' with this function. If you need more control, download directly from
#' Python.
#'
#' @param model_name   string giving the model namel.
#'                     Defaults to "en_core_web_sm".
#'
#'@examples
#'\dontrun{
#'cnlp_download_spacy(model_name="en_core_web_sm")
#'}
#' @export
cnlp_download_spacy <- function(model_name="en_core_web_sm") {
  spacy <- reticulate::import("spacy")
  spacy$cli$download(model_name)
}
statsmaths/cleanNLP documentation built on May 21, 2024, 6:47 a.m.