Skip to content

edsnlp.pipes.base

BaseComponent [source]

Bases: ABC

The BaseComponent adds a set_extensions method, called at the creation of the object.

It helps decouple the initialisation of the pipeline from the creation of extensions, and is particularly usefull when distributing EDSNLP on a cluster, since the serialisation mechanism imposes that the extensions be reset.

set_extensions [source]

Set Doc, Span and Token extensions.

get_spans [source]

Returns sorted spans of interest according to the possible value of on_ents_only. Includes doc.ents by default, and adds eventual SpanGroups.