edsnlp.metrics.doc_classif
DocClassificationMetric
Multi-head document classification metric.
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
label_attr | List of Doc._ attributes containing the labels for each head TYPE: |
micro_key | The key to use to store the micro-averaged results TYPE: |
macro_key | The key to use to store the macro-averaged results TYPE: |
filter_expr | The filter expression to use to filter the documents TYPE: |
doc_classification_metric [source]
Scores multi-head document-level classification (accuracy, precision, recall, F1) for each head.
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
examples | The examples to score, either a tuple of (golds, preds) or a list of spacy.training.Example objects TYPE: |
label_attr | The list of Doc._ attributes containing the labels for each head TYPE: |
micro_key | The key to use to store the micro-averaged results TYPE: |
macro_key | The key to use to store the macro-averaged results TYPE: |
filter_expr | The filter expression to use to filter the documents TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Dict[str, Any]] | Dictionary mapping head names to their respective metrics |