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 thenegatedextention of the spanqualifiers=["_.negated", "_.past"]will use thenegatedandpastextensions of the spanqualifiers={"_.negated": True, "_.past": "DATE"}will use thenegatedextension of any span, and thepastextension of spans with theDATElabel
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 TYPE: |
| 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 TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Callable[[Span]] | The qualifier setter |