Proposal: map vakra's Example/ExampleResult types to a portable eval schema (EvalPort)

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing, tooling

Direzione di ricerca

Inizia leggendo evaluator/utils.py, evaluator/evaluator.py e evaluator/scorer.py, quindi confronta questi tipi con sample_data/capability_1_bi_apis e i dati di capability_4_multiturn. Conferma con i maintainer le mappature proposte per Example/ExampleResult e EvalReport, quindi convalida l'output dell'adapter usando validate_suite() e validate_result_set() di EvalPort; il lavoro è completo quando l'ambito e la collocazione sono concordati e i dataset rappresentativi vengono convalidati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

I'm the maintainer of EvalPort, an open standard (JSON Schema + Python SDK, evalport-sdk) for portable LLM eval/benchmark data — a Suite/TestCase schema for eval inputs and a ResultSet/Result schema for run outputs, plus openeval.validate.validate_suite() / validate_result_set() to check any dataset against the schema.

I went through the vakra source (not just the README) before writing this — specifically evaluator/utils.py, evaluator/evaluator.py, evaluator/scorer.py, and the sample_data/ dialogues — because I wanted to open this only if there was a real, concrete mapping, not a generic "you should support format X" ask.

Why vakra looks like a good fit

evaluator/utils.py already has frozen dataclasses that map almost 1:1 onto a portable eval schema:

  • Example (id, capability, domain, turns, trajectory, final_answer) — this is a test case.
  • ToolCall (tool_name, arguments, output) — a grading input for tool-trajectory checks.
  • ExampleResult (example_id, answer_score, answer_label, trajectory_score, trajectory_details, meta) — this is a per-case result.
  • EvalSliceResult / EvalReport (benchmark_name, slices, aggregated, with a to_dict()) — this is a result set.

Separately, the actual runtime path in evaluate_domain() (evaluator/evaluator.py) and the sample_data/capability_1_bi_apis/input.json + output.json pair works over the raw dialogue JSON (uuid, domain, dialogue.turns[].query, output[].answer, output[].sequence[].tool_call) rather than through those dataclasses directly — so today there are two parallel representations of essentially the same thing. A portable schema could give both a single typed target: the dataclasses already describe the shape, and dialogues could validate against it, which also gets you a common form to compare across capability_bi_apis / capability_multihop_reasoning / capability_multiturn runs without writing bespoke sameness checks each time.

To be upfront: I have not built or tested an adapter for vakra yet. This is a proposal to build one together (I'd expect to do the initial pass and want your input on where it's wrong), not a claim that one exists.

Concrete sketch

Rough mapping from vakra's own types to EvalPort's Suite/TestCase and ResultSet/Result:

# vakra Example (evaluator/utils.py) -> EvalPort TestCase
from evaluator.utils import Example, ExampleResult, EvalReport

def example_to_testcase(ex: Example) -> dict:
    return {
        "id": ex.id,
        "input": {
            "query": ex.turns[-1].content if ex.turns else "",
            "capability": ex.capability,
            "domain": ex.domain,
        },
        "graders": [
            {"type": "exact_match", "target": ex.final_answer},
            {
                "type": "tool_trajectory",
                "expected_calls": [tc.tool_name for tc in ex.trajectory],
            },
        ],
    }

def build_suite(examples: list[Example], suite_id: str) -> dict:
    return {
        "version": "0.1.0",
        "id": suite_id,          # e.g. "vakra-capability_bi_apis-beer_factory"
        "test_cases": [example_to_testcase(e) for e in examples],
    }


# vakra ExampleResult / EvalReport -> EvalPort ResultSet
def example_result_to_result(r: ExampleResult) -> dict:
    return {
        "test_case_id": r.example_id,
        "passed": r.answer_score == 1.0,
        "grader_results": [
            {
                "type": "answer_score",
                "score": r.answer_score,
                "details": r.trajectory_details,
            }
        ],
    }

def build_result_set(report: EvalReport, run_id: str, started_at: str) -> dict:
    results = [r for s in report.slices for r in s.per_example]
    return {
        "version": "0.1.0",
        "suite_id": report.benchmark_name,
        "run_id": run_id,
        "started_at": started_at,
        "results": [example_result_to_result(r) for r in results],
    }

Both build_suite(...) and build_result_set(...) outputs would then run through openeval.validate.validate_suite() / validate_result_set() to confirm they're portable — i.e. loadable by any other tool that also speaks EvalPort, without vakra-specific glue.

What I'm asking

Not a PR yet — just: does this mapping look right to you, and is there appetite for a small vakra -> evalport adapter (probably living in examples/ or as a script, not touching the scoring pipeline)? If there's interest I'll put together a working version against sample_data/capability_1_bi_apis and capability_4_multiturn and open a PR for review, rather than guessing at the parts of the multiturn/policy-judge flow I haven't fully traced yet.

Repo: https://github.com/adhabnr-ux/evalport

Lingua principale
Python
Stelle
79
Fork
23
Merge medio
2g 7h
PR unite (30g)
3

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IBM/vakra

Tutte le issue di IBM/vakra

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.