File size: 1,002 Bytes
482c2e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194050b
482c2e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194050b
482c2e9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
tei_annotator.evaluation — Evaluate annotation quality against a gold standard.

Typical usage::

    from tei_annotator.evaluation import evaluate_file, MatchMode

    per_record, overall = evaluate_file(
        gold_xml_path="tests/fixtures/blbl-examples.tei.xml",
        schema=my_schema,
        endpoint=my_endpoint,
        match_mode=MatchMode.TEXT,
    )
    print(overall.report())
"""

from .evaluator import evaluate_element, evaluate_file
from .extractor import EvaluationSpan, extract_spans, spans_from_xml_string
from .metrics import (
    ElementMetrics,
    EvaluationResult,
    MatchMode,
    SpanMatch,
    aggregate,
    compute_metrics,
    match_spans,
)

__all__ = [
    # Extractor
    "EvaluationSpan",
    "extract_spans",
    "spans_from_xml_string",
    # Metrics
    "MatchMode",
    "SpanMatch",
    "ElementMetrics",
    "EvaluationResult",
    "match_spans",
    "compute_metrics",
    "aggregate",
    # Evaluator
    "evaluate_element",
    "evaluate_file",
]