# spaCy Tasks
This module contains a collection of tasks for interacting with the spaCy library.
# SpacyNLP
class
prefect.tasks.spacy.spacy_tasks.SpacyNLP
(text="", nlp=None, spacy_model_name="en_core_web_sm", disable=None, component_cfg=None, exclude=None, **kwargs)[source]Task for processing text with a spaCy pipeline.
Args:
text (unicode, optional)
: string to be processed, can be provided during construction or when task is runnlp (spaCy text processing pipeline, optional)
: a custom spaCy text processing pipeline, if provided, this pipeline will be used instead of being created from spacy_model_namespacy_model_name (str, optional)
: name of the spaCy language model, default model is 'en_core_web_sm', will be ignored if nlp is provideddisable (List[str], optional)
: list of pipeline components to disable, only applicable to pipelines loaded from spacy_model_nameexclude (List[str], optional)
: Names of pipeline components to exclude. Excluded components won’t be loaded. (Only applicable in spacy >= 3.0)component_cfg (dict, optional)
: a dictionary with extra keyword arguments for specific components, only applicable to pipelines loaded from spacy_model_name**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.spacy.spacy_tasks.SpacyNLP.run (text="")[source] |
Task run method. Creates a spaCy document.
|
# SpacyTagger
Task for returning tagger from a spaCy pipeline.
Args:
nlp (spaCy text processing pipeline, optional)
: a custom spaCy text processing pipeline**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.spacy.spacy_tasks.SpacyTagger.run (nlp=None)[source] |
Task run method. Returns tagger component of spaCy pipeline.
|
# SpacyParser
Task for returning parser from a spaCy pipeline.
Args:
nlp (spaCy text processing pipeline, optional)
: a custom spaCy text processing pipeline**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.spacy.spacy_tasks.SpacyParser.run (nlp=None)[source] |
Task run method. Returns parser component of spaCy pipeline.
|
# SpacyNER
Task for returning named entity recognizer from a spaCy pipeline.
Args:
nlp (spaCy text processing pipeline, optional)
: a custom spaCy text processing pipeline**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.spacy.spacy_tasks.SpacyNER.run (nlp=None)[source] |
Task run method. Returns named entity recognition component of spaCy pipeline.
|
# SpacyComponent
Task for returning named component from a spaCy pipeline.
Args:
component_name (str, optional)
: name of spaCy pipeline component to return, must be provided during construction or run timenlp (spaCy text processing pipeline, optional)
: a custom spaCy text processing pipeline**kwargs (dict, optional)
: additional keyword arguments to pass to the Task constructor
methods: |
---|
prefect.tasks.spacy.spacy_tasks.SpacyComponent.run (component_name, nlp=None)[source] |
Task run method. Returns named component of spaCy pipeline.
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC