MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / eval

Function eval

paperflow/cli.py:418–453  ·  view source on GitHub ↗

Run the public PaperFlow-Bench evaluator on a predictions file.

(
    benchmark_dir: Path = typer.Option(
        Path("data/PaperFlow-Bench"),
        "--benchmark-dir",
        "-b",
        help="Benchmark root containing data/, reference_outputs/, evaluation/.",
    ),
    predictions: Path = typer.Option(
        ...,
        "--predictions",
        "-p",
        help="Top-20 predictions JSONL file (one row per episode).",
    ),
    output: Path = typer.Option(
        Path("paperflow_eval.json"),
        "--output",
        "-o",
        help="Where to write the metrics JSON.",
    ),
)

Source from the content-addressed store, hash-verified

416 "Reinforcement learning from human feedback.",
417 ]
418 vectors = embed.embed_batch(sample_texts)
419 typer.echo(f"\n[embed:{embed.name}:{embed.model}] dim={embed.dimensions} batch={len(vectors)}")
420 for text, vector in zip(sample_texts, vectors):
421 preview = ", ".join(f"{value:+.3f}" for value in vector[:5])
422 typer.echo(f" - {text[:60]:<60} -> [{preview}, ...]")
423
424
425@app.command()
426def eval(
427 benchmark_dir: Path = typer.Option(
428 Path("data/PaperFlow-Bench"),
429 "--benchmark-dir",
430 "-b",
431 help="Benchmark root containing data/, reference_outputs/, evaluation/.",
432 ),
433 predictions: Path = typer.Option(
434 ...,
435 "--predictions",
436 "-p",
437 help="Top-20 predictions JSONL file (one row per episode).",
438 ),
439 output: Path = typer.Option(
440 Path("paperflow_eval.json"),
441 "--output",
442 "-o",
443 help="Where to write the metrics JSON.",
444 ),
445) -> None:
446 """Run the public PaperFlow-Bench evaluator on a predictions file."""
447 script = PROJECT_ROOT / "experiments" / "benchmark" / "evaluate_benchmark_predictions.py"
448 if not script.exists():
449 typer.echo(f"[error] evaluator not found: {script}", err=True)
450 raise typer.Exit(code=1)
451 raise typer.Exit(
452 code=_run_python(
453 script,
454 "--benchmark-dir",
455 str(benchmark_dir),
456 "--predictions",

Callers

nothing calls this directly

Calls 1

_run_pythonFunction · 0.85

Tested by

no test coverage detected