snorkelflow.studio.stanza_labeling_function
- class snorkelflow.studio.stanza_labeling_function(name=None, resources=None)
Bases:
resources_fn_labeling_functionConvenience decorator for stanza based labeling functions.
The decorated function must have an additional nlp argument which represents the stanza en model.
Parameters
Parameters
Name Type Default Info name Optional[str]NoneName of the LF. resources Optional[Mapping[str, Any]]NoneLabeling resources passed in to fviakwargsExamples
>>> from snorkelflow.studio import stanza_labeling_function
>>> @stanza_labeling_function(name="my_stanza_lf")
... def many_entities(x, nlp) -> int:
... return 0 if len(nlp(x.txt).ents) > 5 else -1- __init__(name=None, resources=None)
\_\_init\_\_
__init__
Methods
__init__([name, resources])