Skip to content

WIP: Add eval command - #98

Draft
osma wants to merge 4 commits into
mainfrom
issue46-eval-functionality
Draft

WIP: Add eval command#98
osma wants to merge 4 commits into
mainfrom
issue46-eval-functionality

Conversation

@osma

@osma osma commented Aug 14, 2026

Copy link
Copy Markdown
Member

Reasons for creating this PR

See #46. WIP.

Link to relevant issue(s), if any

Description of the changes in this PR

Instructions how to test this PR

Known problems or uncertainties in this PR

Checklist

  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

Disclosure of AI Tool Usage

Please indicate AI use by choosing the most suitable TLP:AI category below and removing the irrelevant categories from the list. AI:ORANGE is the minimum level for merging.

  • ⚪ AI:WHITE Written independently, no significant AI involvement.
  • 🟢 AI:GREEN AI-assisted. Author drove the process, AI used as a tool (autocomplete, partial generation, refactoring help).
  • 🟡 AI:AMBER AI-generated, fully reviewed line by line. Author can explain every part.
  • 🟠 AI:ORANGE AI-generated at scale. Architecture and design actively co-developed and understood, hot spots reviewed, but not every line checked. Conscious risk of comprehension debt.
  • 🔴 AI:RED AI-generated, only checked for plausibility. Draft quality, probably not for production.

Describe the AI tool(s) you used:

osma added 4 commits August 14, 2026 11:39
…lementation)

Introduces a new `eval` command to the CLI, allowing users to evaluate metadata extraction results against provided ground truth JSONL files. The actual implementation of evaluation is still a non-functional stub.
Introduces fuzzy string comparison using Levenshtein distance and a configurable threshold (0.95) to improve robustness in evaluation.

Also refactors `bibra/cli.py` to use `aggregate_results` instead of raw JSON dumping, providing a cleaner output format for evaluation results.
Implements calculation and inclusion of an overall mean score in the TSV output of `aggregate_results`.

This change adds a summary row to the aggregated results, providing a global mean score across all fields and languages. Corresponding tests in `test_eval.py` have been updated to validate the new summary row and edge cases like empty results.
Adds a timeout mechanism to the extraction process to prevent indefinite blocking during evaluation.
Also refactors `run_evaluation` to wrap the extraction call in a try/except block, ensuring that evaluation continues for other fields even if a single URL extraction fails.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.50000% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.72%. Comparing base (91af4c6) to head (276f658).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
bibra/evaluator.py 91.72% 12 Missing ⚠️
bibra/cli.py 80.95% 4 Missing ⚠️
bibra/downloader.py 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   98.68%   96.72%   -1.97%     
==========================================
  Files          13       15       +2     
  Lines         533      733     +200     
==========================================
+ Hits          526      709     +183     
- Misses          7       24      +17     
Flag Coverage Δ
unittests 96.72% <91.50%> (-1.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluation functionality

2 participants