opendatalab/OmniDocBench / skills
omnidocbench-eval-helper
VerifiedHelp users deploy, validate, run, and parse OmniDocBench evaluations. Use this skill whenever the user mentions OmniDocBench, document parsing/OCR benchmark scoring, MinerU or other model evaluation on OmniDocBench, CDM formula metrics, end2end/md2md configs, Docker/conda deployment, remote SSH/H-cluster execution, result JSON parsing, or troubleshooting TeX Live/ImageMagick/Ghostscript/Docker/worker/OOM issues. Prefer Docker first, generate concrete commands from the user's paths, validate inputs before running, and report final Overall/Text/Formula/Table/Reading-order scores with result file paths.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.8 KB |
| scripts/generate_end2end_config.py | script | 2.3 KB |
| scripts/parse_results.py | script | 4.9 KB |
scripts/parse_results.py
View on GitHub#!/usr/bin/env python3
"""Parse OmniDocBench end2end result files and print a compact score report."""
import argparse
import json
from pathlib import Path
def get(data, path, default=None):
cur = data
for key in path:
if not isinstance(cur, dict) or key not in cur:
return default
cur = cur[key]
return cur
def fmt(value, scale=1.0):
if value is None:
return "N/A"
return f"{value * scale:.6f}"
def main():
parser = argparse.ArgumentParser(description="Parse OmniDocBench metric/run summary files.")
parser.add_argument("result_dir", help="Directory containing *_metric_result.json and related files")
parser.add_argument("--prefix", help="Result prefix, e.g. mineru_quick_match. Auto-detected if omitted")
parser.add_argument("--pred", help="Optional prediction markdown directory to count .md and empty .md files")
args = parser.parse_args()
result_dir = Path(args.result_dir)
if args.prefix:
prefix = args.prefix
else:
matches = sorted(result_dir.glob("*_metric_result.json"))
if not matches:
raise SystemExit(f"No *_metric_result.json found in {result_dir}")
prefix = matches[0].name.removesuffix("_metric_result.json")
metric_path = result_dir / f"{prefix}_metric_result.json"
summary_path = result_dir / f"{prefix}_run_summary.json"
stage_path = result_dir / f"{prefix}_stage_execution.json"
runtime_path = result_dir / f"{prefix}_runtime_environment.json"
with metric_path.open(encoding="utf-8") as f:
metric = json.load(f)
summary = json.load(summary_path.open(encoding="utf-8")) if summary_path.exists() else {}
stage = json.load(stage_path.open(encoding="utf-8")) if stage_path.exists() else {}
runtime = json.load(runtime_path.open(encoding="utf-8")) if runtime_path.exists() else {}
scores = {
"Overall": fmt(get(summary, ["notebook_metric_summary", "overall_notebook"])),
"Text Edit Distance ↓": fmt(get(metric, ["text_block", "all", "Edit_dist", "ALL_page_avg"])),
"Formula CDM ↑": fmt(get(metric, ["display_formula", "page", "CDM", "ALL"]), 100),
"Formula Edit Distance ↓": fmt(get(metric, ["display_formula", "all", "Edit_dist", "ALL_page_avg"])),
"Table TEDS ↑": fmt(get(metric, ["table", "page", "TEDS", "ALL"]), 100),
"Table TEDS Structure Only ↑": fmt(get(metric, ["table", "page", "TEDS_structure_only", "ALL"]), 100),
"Table Edit Distance ↓": fmt(get(metric, ["table", "all", "Edit_dist", "ALL_page_avg"])),
"Reading Order Edit Distance ↓": fmt(get(metric, ["reading_order", "all", "Edit_dist", "ALL_page_avg"])),
}
print("## Result paths")
print(f"- Output dir: `{result_dir}`")
print(f"- Metric JSON: `{metric_path}`")
if summary_path.exists():
print(f"- Run summary: `{summary_path}`")
print("\n## Scores")
print("| Metric | Score |")
print("|---|---:|")
for name, value in scores.items():
print(f"| {name} | **{value}** |")
page_count = get(stage, ["page_match", "page_count"])
quick_timeout = get(stage, ["page_match", "fallbacks", "quick_match_timeout", "count"])
cdm = get(stage, ["metrics", "display_formula", "CDM"], {}) or {}
teds = get(stage, ["metrics", "table", "TEDS"], {}) or {}
texlive = get(runtime, ["texlive", "cjk_sty", "status"])
magick = get(runtime, ["external_tools", "magick", "output"], "")
gs = get(runtime, ["external_tools", "ghostscript", "output"])
print("\n## Validation")
if args.pred:
pred_dir = Path(args.pred)
if pred_dir.is_dir():
md_files = list(pred_dir.glob("*.md"))
empty_files = [path for path in md_files if path.stat().st_size == 0]
print(f"- prediction md files: {len(md_files)}, empty: {len(empty_files)}")
if 0 < len(empty_files) <= 10:
print("- empty md files: " + ", ".join(path.name for path in sorted(empty_files)))
else:
print(f"- prediction md dir missing: {pred_dir}")
if page_count is not None:
print(f"- pages: {page_count}")
if quick_timeout is not None:
print(f"- quick_match_timeout_count: {quick_timeout}")
if cdm:
print("- CDM samples/timeouts/errors/exceptions: "
f"{cdm.get('sample_count')} / {cdm.get('timeout_case_count')} / "
f"{cdm.get('error_case_count')} / {cdm.get('exception_case_count')}")
if teds:
print("- TEDS samples/timeouts/errors/exceptions: "
f"{teds.get('sample_count')} / {teds.get('timeout_case_count')} / "
f"{teds.get('error_case_count')} / {teds.get('exception_case_count')}")
if runtime:
magick_version = magick.split(" | ")[0] if isinstance(magick, str) else magick
print(f"- runtime: ImageMagick={magick_version}; Ghostscript={gs}; CJK={texlive}")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |