score.d.ts 820 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Scoring functions for the QMD benchmark harness.
  3. *
  4. * Computes precision@k, recall, MRR, and F1 for search results
  5. * against ground-truth expected files.
  6. */
  7. /**
  8. * Normalize a file path for comparison.
  9. * Strips qmd:// prefix, lowercases, removes leading/trailing slashes.
  10. */
  11. export declare function normalizePath(p: string): string;
  12. /**
  13. * Check if two paths refer to the same file.
  14. * Handles different path formats by comparing normalized suffixes.
  15. */
  16. export declare function pathsMatch(result: string, expected: string): boolean;
  17. /**
  18. * Score a set of search results against expected files.
  19. */
  20. export declare function scoreResults(resultFiles: string[], expectedFiles: string[], topK: number): {
  21. precision_at_k: number;
  22. recall: number;
  23. mrr: number;
  24. f1: number;
  25. hits_at_k: number;
  26. };