import Box from '@mui/material/Box'; import Chip from '@mui/material/Chip'; import Alert from '@mui/material/Alert'; import Table from '@mui/material/Table'; import TableBody from '@mui/material/TableBody'; import TableCell from '@mui/material/TableCell'; import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; import type { ClassMetrics, QualityMetrics, ScenarioMetrics } from '../../types/labeleval'; import { SectionCard, MetricCard, fmtPct, fmtInt } from './shared'; import { ExplainTip, HeadCell } from '../help/InfoTip'; import { glossaryKeyForStatus } from '../../content/glossary'; function PrTable({ title, rows }: { title: string; rows: Array }) { return ( {title} {rows.length === 0 ? ( No data yet. ) : ( {'class_name' in (rows[0] ?? {}) ? 'Class' : 'Scenario'} {rows.map((r) => { const name = 'class_name' in r ? r.class_name : r.scenario; return ( {name.replace(/_/g, ' ')} {fmtPct(r.precision)} {fmtPct(r.recall)} {fmtPct(r.f1)} {fmtInt(r.support)} ); })}
)}
); } export default function GroundTruthComparison({ metrics }: { metrics: QualityMetrics | null }) { const gtType = metrics?.gt_type ?? null; return ( {!metrics ? ( No quality metrics yet — run the evaluation pipeline. ) : ( <> {gtType ? ( ) : null} {gtType === 'PSEUDO_GROUND_TRUTH' ? ( Pseudo-GT comparison, not gold-standard evaluation — reference labels were themselves machine-generated. Treat precision/recall below as directional signals, not certified quality figures. ) : null} )} ); }