Skip to content

edsnlp.utils.bindings

QualifiersArg

Valid values for the qualifiers argument of a component can be :

  • a (span) -> qualifier callable
  • a qualifier name ("_.negated")
  • a list of qualifier names ([".negated", ".event"])
  • a dict of qualifier name to True or list of labels, to filter the qualifiers

Examples

  • qualifiers="_.negated" will use the negated extention of the span
  • qualifiers=["_.negated", "_.past"] will use the negated and past extensions of the span
  • qualifiers={"_.negated": True, "_.past": "DATE"} will use the negated extension of any span, and the past extension of spans with the DATE label

make_binding_getter

Make a qualifier getter

Parameters

PARAMETER DESCRIPTION
qualifier

Either one of the following: - a path to a nested attributes of the span, such as "qualifier_" or "_.negated" - a tuple of (key, value) equality, such as ("_.date.mode", "PASSED")

TYPE: Union[str, Binding]

RETURNS DESCRIPTION
Callable[[Span], bool]

The qualifier getter

make_binding_setter

Make a qualifier setter

Parameters

PARAMETER DESCRIPTION
binding

A pair of - a path to a nested attributes of the span, such as qualifier_ or _.negated - a value assignment

TYPE: Binding

RETURNS DESCRIPTION
Callable[[Span]]

The qualifier setter