Parse and return command-line arguments.
()
| 1182 | |
| 1183 | |
| 1184 | def _parse_args() -> argparse.Namespace: |
| 1185 | """Parse and return command-line arguments.""" |
| 1186 | parser = argparse.ArgumentParser( |
| 1187 | description="Schema-driven evaluation of document processing agents against ground truth" |
| 1188 | ) |
| 1189 | parser.add_argument( |
| 1190 | "--ground-truth", |
| 1191 | "-g", |
| 1192 | type=str, |
| 1193 | required=True, |
| 1194 | help='Directory containing ground truth case folders (e.g., "exemplary_data")', |
| 1195 | ) |
| 1196 | parser.add_argument( |
| 1197 | "--agent-output", |
| 1198 | "-a", |
| 1199 | type=str, |
| 1200 | required=True, |
| 1201 | help='Directory containing agent output case folders (e.g., "output")', |
| 1202 | ) |
| 1203 | parser.add_argument( |
| 1204 | "--master-data", |
| 1205 | "-m", |
| 1206 | type=str, |
| 1207 | default=None, |
| 1208 | help="Path to master_data.yaml or .json (auto-detected if not provided)", |
| 1209 | ) |
| 1210 | parser.add_argument( |
| 1211 | "--case", |
| 1212 | "-c", |
| 1213 | type=str, |
| 1214 | default=None, |
| 1215 | help="Evaluate a single case by folder name (e.g., case_001)", |
| 1216 | ) |
| 1217 | parser.add_argument( |
| 1218 | "--num-cases", |
| 1219 | "-n", |
| 1220 | type=int, |
| 1221 | default=0, |
| 1222 | help="Limit number of cases to evaluate (0 = all)", |
| 1223 | ) |
| 1224 | parser.add_argument( |
| 1225 | "--tolerance", |
| 1226 | "-t", |
| 1227 | type=float, |
| 1228 | default=DEFAULT_TOLERANCE, |
| 1229 | help=f"Financial amount tolerance in dollars (default: {DEFAULT_TOLERANCE})", |
| 1230 | ) |
| 1231 | parser.add_argument( |
| 1232 | "--output", |
| 1233 | "-o", |
| 1234 | type=str, |
| 1235 | default=None, |
| 1236 | help="Output file for evaluation results JSON", |
| 1237 | ) |
| 1238 | parser.add_argument( |
| 1239 | "--skip-llm", |
| 1240 | action="store_true", |
| 1241 | help="Skip LLM alignment evaluation (deterministic only, no cost)", |