Spaces:
Sleeping
Sleeping
Download src/captioning/evaluation/__init__.py from apoorvrajdev/image-captioning-api: direct link, hf CLI and curl.
- Browser
- Download file 2.59 kB
-
https://huggingface.co/spaces/apoorvrajdev/image-captioning-api/resolve/main/src/captioning/evaluation/__init__.py
- Command line
-
hf download hf://spaces/apoorvrajdev/image-captioning-api/src/captioning/evaluation/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/apoorvrajdev/image-captioning-api/resolve/main/src/captioning/evaluation/__init__.py
2.59 kB
| """Evaluation — caption-quality metrics + per-sample diagnostics. | |
| Available metrics (all corpus-level, 0-100 scale where applicable): | |
| * BLEU-1..4 — :mod:`bleu` | |
| * ROUGE-L — :mod:`rouge` | |
| * METEOR — :mod:`meteor` (requires a JRE on PATH) | |
| * CIDEr — :mod:`cider` (requires >= 2 examples) | |
| :func:`compute_all_metrics` in :mod:`runner` is the single entry point used | |
| by the CLI and by future Phase 3 benchmark comparisons; per-sample | |
| diagnostics live in :mod:`inspection`. Phase 3 latency timing lives in | |
| :mod:`latency`, and the dashboard data export in :mod:`dashboard`. | |
| """ | |
| from captioning.evaluation.benchmark import RunMeta, write_run_artifacts | |
| from captioning.evaluation.bleu import ( | |
| BleuBreakdown, | |
| corpus_bleu_breakdown, | |
| corpus_bleu_score, | |
| ) | |
| from captioning.evaluation.cider import MIN_SAMPLES_FOR_CIDER, corpus_cider_score | |
| from captioning.evaluation.comparison import ( | |
| ComparisonError, | |
| RunRecord, | |
| build_summary, | |
| load_run, | |
| render_markdown, | |
| ) | |
| from captioning.evaluation.dashboard import ( | |
| DashboardExportError, | |
| build_dashboard_data, | |
| render_dashboard_json, | |
| ) | |
| from captioning.evaluation.inspection import ( | |
| SampleDiagnostics, | |
| diagnose_many, | |
| diagnose_sample, | |
| format_diagnostic_row, | |
| write_diagnostics_jsonl, | |
| ) | |
| from captioning.evaluation.latency import ( | |
| BatchLatency, | |
| LatencyBenchmarkError, | |
| LatencySettings, | |
| measure_latency, | |
| runtime_info, | |
| summarize, | |
| time_load, | |
| ) | |
| from captioning.evaluation.meteor import corpus_meteor_score | |
| from captioning.evaluation.rouge import corpus_rouge_l_score | |
| from captioning.evaluation.runner import MetricsReport, compute_all_metrics | |
| from captioning.evaluation.slice import EvalSlice, load_eval_slice, slice_fingerprint | |
| __all__ = [ | |
| "MIN_SAMPLES_FOR_CIDER", | |
| "BatchLatency", | |
| "BleuBreakdown", | |
| "ComparisonError", | |
| "DashboardExportError", | |
| "EvalSlice", | |
| "LatencyBenchmarkError", | |
| "LatencySettings", | |
| "MetricsReport", | |
| "RunMeta", | |
| "RunRecord", | |
| "SampleDiagnostics", | |
| "build_dashboard_data", | |
| "build_summary", | |
| "compute_all_metrics", | |
| "corpus_bleu_breakdown", | |
| "corpus_bleu_score", | |
| "corpus_cider_score", | |
| "corpus_meteor_score", | |
| "corpus_rouge_l_score", | |
| "diagnose_many", | |
| "diagnose_sample", | |
| "format_diagnostic_row", | |
| "load_eval_slice", | |
| "load_run", | |
| "measure_latency", | |
| "render_dashboard_json", | |
| "render_markdown", | |
| "runtime_info", | |
| "slice_fingerprint", | |
| "summarize", | |
| "time_load", | |
| "write_diagnostics_jsonl", | |
| "write_run_artifacts", | |
| ] | |