Skip to content

models

This module defines the lightweight dataclasses returned by the evaluation pipeline.

ConfusionCounts

Fields:

  • true_positive_count
  • false_positive_count
  • true_negative_count
  • false_negative_count

Used internally by the metric helpers.

ResultBundle

Fields:

  • per_feature_metrics_data_frame
  • total_metrics_data_frame
  • row_accuracy_value
  • entity_detection_summary=None
  • matched_pairs_data_frame=None

Notes:

  • returned by evaluate()
  • entity_detection_summary is normally populated only for MULTI_ENTITY
  • matched_pairs_data_frame currently contains pair indices and similarity scores for multi-entity runs

RunContext

Fields:

  • run_identifier
  • started_at_timestamp
  • configuration_hash

Used mainly for logging and run traceability.

Generated API details

ConfusionCounts dataclass

Container of basic confusion counts.

Source code in src/extraction_testing/models.py
21
22
23
24
25
26
27
@dataclass
class ConfusionCounts:
    """Container of basic confusion counts."""
    true_positive_count: int
    false_positive_count: int
    true_negative_count: int
    false_negative_count: int

ResultBundle dataclass

Container for test results and artifacts.

Source code in src/extraction_testing/models.py
30
31
32
33
34
35
36
37
@dataclass
class ResultBundle:
    """Container for test results and artifacts."""
    per_feature_metrics_data_frame: pd.DataFrame
    total_metrics_data_frame: pd.DataFrame
    row_accuracy_value: float
    entity_detection_summary: Optional[Dict[str, Any]] = None
    matched_pairs_data_frame: Optional[pd.DataFrame] = None

RunContext dataclass

Contextual information for a single run.

Source code in src/extraction_testing/models.py
40
41
42
43
44
45
@dataclass
class RunContext:
    """Contextual information for a single run."""
    run_identifier: str
    started_at_timestamp: str
    configuration_hash: str