snorkel.slicing.sf.nlp.nlp_slicing_function

class snorkel.slicing.sf.nlp.nlp_slicing_function(name=None, resources=None, pre=None, fault_tolerant=False, text_field='text', doc_field='doc', language='en_core_web_sm', disable=None, memoize=True)[source]

Bases: snorkel.labeling.lf.nlp.base_nlp_labeling_function

Decorator to define a NLPSlicingFunction child object from a function.

TODO: Implement a common parent decorator for Snorkel operators

__init__(name=None, resources=None, pre=None, fault_tolerant=False, text_field='text', doc_field='doc', language='en_core_web_sm', disable=None, memoize=True)[source]

Initialize self. See help(type(self)) for accurate signature.

Return type

None

Methods

__init__([name, resources, pre, …])

Initialize self.

__call__(f)[source]

Wrap a function to create an BaseNLPLabelingFunction.

Parameters

f (Callable[…, int]) – Function that implements the core NLP LF logic

Returns

New BaseNLPLabelingFunction executing logic in wrapped function

Return type

BaseNLPLabelingFunction