Skip to content

edsnlp.scorers.span_attributes

span_attribute_scorer

Scores the attributes predictions between a list of gold and predicted spans.

Parameters

PARAMETER DESCRIPTION
args

The examples to score, either a tuple of (golds, preds) or a list of spacy.training.Example objects

TYPE: Examples

span_getter

The span getter to use to extract the spans from the document

TYPE: SpanGetterArg

attributes

The attributes to use to score the spans

TYPE: Sequence[str]

default_values

Values to dismiss when computing the micro-average per label. This is useful to compute precision and recall for certain attributes that have imbalanced value repartitions, such as "negation", "family related" or "certainty" attributes.

TYPE: Dict DEFAULT: {}

include_falsy

Whether to count predicted or gold occurrences of falsy values when computing the metrics. If False, only the non-falsy values will be counted and matched together.

TYPE: bool DEFAULT: False

micro_key

The key to use to store the micro-averaged results for spans of all types

TYPE: str DEFAULT: 'micro'

filter_expr

The filter expression to use to filter the documents

TYPE: Optional[str] DEFAULT: None

RETURNS DESCRIPTION
Dict[str, float]