|
| 1 | +#' SparkNLP ResourceDownloader functions |
| 2 | +#' |
| 3 | +#' ResourceDownloader provides functions to easily look for pretrained models & pipelines |
| 4 | +#' inside Spark NLP. You can filter models or pipelines via language, version, |
| 5 | +#' or the name of the annotator |
| 6 | +#' |
| 7 | +#' @param sc a spark_connect object |
| 8 | +#' @param lang language to restrict the results to |
| 9 | +#' @param version Spark NLP version to restrict results to |
| 10 | +#' |
| 11 | +#' @return a markdown table containing the models or pipelines filtered by the provided arguments |
| 12 | +#' |
| 13 | +#' @name nlp_resource_downloader |
| 14 | +#' @aliases ResourceDownloader |
| 15 | +NULL |
| 16 | + |
| 17 | +#' @rdname nlp_resource_downloader |
| 18 | +#' @export |
| 19 | +nlp_show_public_pipelines <- function(sc, lang = NULL, version = NULL) { |
| 20 | + result <- sparklyr::invoke_static(sc, "com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader", "showPublicPipelines", lang, version) |
| 21 | + return(result) |
| 22 | +} |
| 23 | + |
| 24 | +#' @param annotator name of annotator to restrict results |
| 25 | +#' @rdname nlp_resource_downloader |
| 26 | +#' @export |
| 27 | +nlp_show_public_models <- function(sc, annotator = NULL, lang = NULL, version = NULL) { |
| 28 | + result <- sparklyr::invoke_static(sc, "com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader", "showPublicModels", annotator, lang, version) |
| 29 | + return(result) |
| 30 | +} |
| 31 | + |
| 32 | +#' @param name name of object to clear |
| 33 | +#' @param language language to clear |
| 34 | +#' @param remote_loc remote_loc of models to clear |
| 35 | +#' @rdname nlp_resource_downloader |
| 36 | +#' @export |
| 37 | +nlp_clear_cache <- function(sc, name = NULL, language = NULL, remote_loc = NULL) { |
| 38 | + result <- sparklyr::invoke_static(sc, "com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader", "clearCache", name, language, remote_loc) |
| 39 | + return(result) |
| 40 | +} |
| 41 | + |
| 42 | +#' @rdname nlp_resource_downloader |
| 43 | +#' @export |
| 44 | +nlp_show_available_annotators <- function(sc) { |
| 45 | + result <- sparklyr::invoke_static(sc, "com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader", "showAvailableAnnotators") |
| 46 | + return(result) |
| 47 | +} |
0 commit comments