sparknlp.base.recursive_pipeline#

Contains classes for the RecursivePipeline.

Module Contents#

Classes#

RecursivePipeline

Recursive pipelines are Spark NLP specific pipelines that allow a Spark

RecursivePipelineModel

Fitted RecursivePipeline.

class RecursivePipeline(*args, **kwargs)[source]#

Recursive pipelines are Spark NLP specific pipelines that allow a Spark ML Pipeline to know about itself on every Pipeline Stage task.

This allows annotators to utilize this same pipeline against external resources to process them in the same way the user decides.

Only some of the annotators take advantage of this. RecursivePipeline behaves exactly the same as normal Spark ML pipelines, so they can be used with the same intention.

Examples

>>> from sparknlp.annotator import *
>>> from sparknlp.base import *
>>> recursivePipeline = RecursivePipeline(stages=[
...     documentAssembler,
...     sentenceDetector,
...     tokenizer,
...     lemmatizer,
...     finisher
... ])
class RecursivePipelineModel(pipeline_model)[source]#

Fitted RecursivePipeline.

Behaves the same as a Spark PipelineModel does. Not intended to be initialized by itself. To create a RecursivePipelineModel please fit data to a RecursivePipeline.