GigaProjects

← Back to rag-assistant

evaluation.py

"""Evaluation helpers."""

from __future__ import annotations

import json
from pathlib import Path


def load_eval_questions(path: Path) -> list[dict]:
    questions = []

    for line in path.read_text(encoding="utf-8").splitlines():
        if not line.strip():
            continue
        questions.append(json.loads(line))

    return questions

Run this code