TMCRA-Agent-Memory / benchmarks /longmemeval /tests /test_score_breakdown.py
2009YU's picture
Release TMCRA Agent Memory v2026.07.18
490f3fe verified
Raw
History Blame Contribute Delete
948 Bytes
from __future__ import annotations
import importlib.util
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def load_script():
path = ROOT / "scripts" / "summarize_official_judge.py"
spec = importlib.util.spec_from_file_location(path.stem, path)
module = importlib.util.module_from_spec(spec)
assert spec and spec.loader
spec.loader.exec_module(module)
return module
def test_score_breakdown() -> None:
module = load_script()
dataset = [
{"question_id": "a", "question_type": "single-session-user"},
{"question_id": "b", "question_type": "knowledge-update"},
]
judged = [
{"question_id": "a", "autoeval_label": {"label": True}},
{"question_id": "b", "autoeval_label": {"label": False}},
]
result = module.summarize(dataset, judged)
assert result["correct"] == 1
assert result["total"] == 2
assert result["accuracy_percent"] == 50.0