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

Đang mở
#28 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
testing, tooling

Hướng nghiên cứu

Bắt đầu bằng cách đọc evaluator/utils.py, evaluator/evaluator.py và evaluator/scorer.py, sau đó so sánh các kiểu đó với sample_data/capability_1_bi_apis và dữ liệu capability_4_multiturn. Xác nhận với các maintainer về các ánh xạ Example/ExampleResult và EvalReport được đề xuất, sau đó xác thực đầu ra của adapter bằng validate_suite() và validate_result_set() của EvalPort; công việc được xem là hoàn tất khi phạm vi và vị trí đã được thống nhất và các bộ dữ liệu đại diện đã được xác thực.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
79
Fork
23
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IBM/vakra

Tất cả issue của IBM/vakra

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.