skillner.conflict_resolvers.SpanProcessor#

class skillner.conflict_resolvers.SpanProcessor(dict_filters: Dict[str, Callable[[Span], Any]])[source]#

Span processor class that runs functions on all words of document.

SpanProcessor class acts on individual spans of document. It runs independently functions and stores the result on the metadata dictionary of span.

Parameters:
dict_filters: Dict[str, Callable[[Span], str]]

A dictionary of functions that take Span as input.

__init__(dict_filters: Dict[str, Callable[[Span], Any]]) None[source]#

Methods

__init__(dict_filters)

enrich_doc(doc)

Enrich every span of doc.

enrich_doc(doc: Document) None[source]#

Enrich every span of doc.

Parameters:
doc: Document

The document with spans to be enriched.