Skip to content

evaluation_report

evaluation_report

Classes:

Name Description
EvaluationReport

Container for a completed evaluation -- dataset, components, and scores.

EvaluationReport pydantic-model

Bases: BaseModel

Container for a completed evaluation -- dataset, components, and scores.

Subclassed by MultimodalReport to add report-specific rendering logic. Provides serialization helpers and a Jinja2 context property consumed by the HTML report template.

Fields:

evaluation_dataset pydantic-field

The paired reference/output data used for evaluation.

components = list() pydantic-field

Ordered list of evaluation components with their scores.

jinja_context cached property

Jinja2 template context mapping snake-cased component names to their contexts.

get_dict()

Return component scores as a {name: score_dict} mapping.

Source code in src/nemo_safe_synthesizer/evaluation/data_model/evaluation_report.py
def get_dict(self) -> dict:
    """Return component scores as a ``{name: score_dict}`` mapping."""
    return {c.name: c.score.model_dump(mode="json") for c in self.components if c.score.score is not None}

get_json()

Return component scores as a JSON string.

Source code in src/nemo_safe_synthesizer/evaluation/data_model/evaluation_report.py
def get_json(self) -> str:
    """Return component scores as a JSON string."""
    return json.dumps(self.get_dict())

get_score_by_name(name)

Look up a component's numeric score by display name.

Source code in src/nemo_safe_synthesizer/evaluation/data_model/evaluation_report.py
def get_score_by_name(self, name: str) -> float | None:
    """Look up a component's numeric score by display name."""
    for c in self.components:
        if c.name == name:
            return c.score.score
    return None