View source: R/ner-converter.R
nlp_ner_converter | R Documentation |
Spark ML transformer that converts IOB or IOB2 representation of NER to user-friendly.
nlp_ner_converter( x, input_cols, output_col, white_list = NULL, preserve_position = NULL, lazy_annotator = NULL, uid = random_string("ner_converter_") )
x |
A |
input_cols |
Input columns. String array. |
output_col |
Output column. String. |
white_list |
If defined, list of entities to process. The rest will be ignored. Do not include IOB prefix on labels" |
preserve_position |
Whether to preserve the original position of the tokens in the original document or use the modified tokens |
lazy_annotator |
allows annotators to stand idle in the Pipeline and do nothing. Can be called by other Annotators in a RecursivePipeline |
uid |
A character string used to uniquely identify the ML transformer. |
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_transformer
object. The object contains a pointer to
a Spark Transformer
object and can be used to compose
Pipeline
objects.
ml_pipeline
: When x
is a ml_pipeline
, the function returns a ml_pipeline
with
the NLP transformer/annotator appended to the pipeline.
tbl_spark
: When x
is a tbl_spark
, a transformer is constructed then
immediately fit with the input tbl_spark
, returning the transformed data frame.
When x
is a spark_connection
the function returns a NerConverter transformer.
When x
is a ml_pipeline
the pipeline with the NerConverter added. When x
is a tbl_spark
a transformed tbl_spark
(note that the Dataframe passed in must have the input_cols specified).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.