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 thenegated
extention of the spanqualifiers=["_.negated", "_.past"]
will use thenegated
andpast
extensions of the spanqualifiers={"_.negated": True, "_.past": "DATE"}
will use thenegated
extension of any span, and thepast
extension of spans with theDATE
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 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 |