nlp_lemmatizer: Spark NLP Lemmatizer

View source: R/lemmatizer.R

nlp_lemmatizerR Documentation

Spark NLP Lemmatizer

Description

Spark ML estimator that retrieves lemmas out of words with the objective of returning a base dictionary word See https://nlp.johnsnowlabs.com/docs/en/annotators#lemmatizer

Usage

nlp_lemmatizer(
  x,
  input_cols,
  output_col,
  dictionary_path = NULL,
  dictionary_key_delimiter = "->",
  dictionary_value_delimiter = "\t",
  dictionary_read_as = "TEXT",
  dictionary_options = list(format = "text"),
  uid = random_string("lemmatizer_")
)

Arguments

x

A spark_connection, ml_pipeline, or a tbl_spark.

input_cols

Input columns. String array.

output_col

Output column. String.

dictionary_path

Path to lemma dictionary, in lemma vs possible words format.

dictionary_key_delimiter

key delimiter in the dictionary file

dictionary_value_delimiter

value delimiter in the dictionary file

dictionary_read_as

readAs TEXT or SPARK_DATASET

dictionary_options

options passed to the spark reader if read_as is SPARK_DATASET

uid

A character string used to uniquely identify the ML estimator.

Value

The object returned depends on the class of x.

  • spark_connection: When x is a spark_connection, the function returns an instance of a ml_estimator object. The object contains a pointer to a Spark Estimator object and can be used to compose Pipeline objects.

  • ml_pipeline: When x is a ml_pipeline, the function returns a ml_pipeline with a default pretrained NLP model appended to the pipeline.

  • tbl_spark: When x is a tbl_spark, an estimator is constructed then immediately fit with the input tbl_spark, returning an NLP model.


r-spark/sparknlp documentation built on Oct. 15, 2022, 10:50 a.m.