Skip to content

feat!: switch the QC embedding stage to the Babel-fine-tuned SapBERT - #214

Merged
SkyeAv merged 1 commit into
mainfrom
feat/qc-babel-sapbert
Oct 14, 2026
Merged

SkyeAv merged 1 commit into
mainfrom
feat/qc-babel-sapbert

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Swaps the QC cascade's Stage 4 checkpoint from cambridgeltl/SapBERT-from-PubMedBERT-fulltext to RenaissanceComputing/SapBERT-PubMedBERT-BabelSynonyms-v2025-01-23, RENCI's fine-tune of that same base model on synonym pairs sampled from NCATS Translator Babel identifier cliques (release 2025-01-23). The fine-tuning signal matches the stage's audit task (whether two names denote the same concept) on exactly the equivalence data Translator normalizes against.

Model swap

  • Checkpoint: get_sapbert() in src/tablassert/qc.py now downloads RenaissanceComputing/SapBERT-PubMedBERT-BabelSynonyms-v2025-01-23; drop-in for sentence-transformers (same PubMedBERT architecture, 768-dim embeddings, documented drop-in replacement on the model card).
  • Cache dir: qc.MODEL moves .tablassert/sapbert/ -> .tablassert/sapbert-babel/, matching the BioBERT-to-SapBERT swap precedent, so installs holding the base checkpoint re-download instead of silently serving it as the new model. Stale .tablassert/sapbert/ directories can be deleted.
  • Threshold: qc.SIMILARITY_THRESHOLD stays at 0.5, carried over and un-tuned, same caveat as the previous swap; reject rates may shift with the new score distribution.
  • Tests: tests/test_cover_qc.py pins the new repo id in HF_REPO.

Docs

  • docs/api/qc.md: new model name, fine-tune provenance, and cache location with the staleness note.

Testing

  • make check: exit 0 (ruff, ruff format, pyright, pytest 1726 passed, 52 skipped, cargo test, clippy).

Deferred

  • Re-tuning qc.SIMILARITY_THRESHOLD against real reject logs; already flagged in the code comment.

Stage 4 of the QC cascade now scores residual pairs with
RenaissanceComputing/SapBERT-PubMedBERT-BabelSynonyms-v2025-01-23,
RENCI's fine-tune of cambridgeltl/SapBERT-from-PubMedBERT-fulltext on
synonym pairs sampled from NCATS Translator Babel identifier cliques
(release 2025-01-23), instead of the base checkpoint. Drop-in for
sentence-transformers: same PubMedBERT architecture, 768-dim embeddings.

The model cache moves from .tablassert/sapbert/ to
.tablassert/sapbert-babel/ so installs holding the base checkpoint
re-download rather than silently serving it as the new model; stale
.tablassert/sapbert/ directories can be deleted. The 0.5 pass threshold
is unchanged and remains un-tuned for the new score distribution.

docs/api/qc.md tracks the new checkpoint, provenance, and cache
location; tests/test_cover_qc.py pins the new HF repo id.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1437a2e-897e-494a-8380-3cc299b0f6ea
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SkyeAv
SkyeAv merged commit a82f4ea into main Oct 14, 2026
5 checks passed
SkyeAv added a commit that referenced this pull request Oct 14, 2026
Cut 20.0.0 and bump the package version in pyproject.toml, CITATION.cff,
and uv.lock.

Major: two breaking changes and one feature ship since 19.7.0. The
experimental agent pipeline, the GEPA prompt-optimization surface, and
the distillation dataset export/weigh surface are removed, including
the `tablassert agent` / `distill-export` / `distill-weigh` commands,
the `--optimize` flag family, the `[agent]`/`[optimize]`/`[distill]`
extras, and the agent-only error codes (#215). The QC embedding stage
now runs RenaissanceComputing's Babel-fine-tuned SapBERT checkpoint
with its own `.tablassert/sapbert-babel/` cache dir (#214). `build-kg`
gains the opt-in `--linkouts`/`-lo` flag for EdgeLinkouts edge deep
links (#216).

Changelog:
- Versioned the 20.0.0 section with Breaking Changes and Added entries,
  PR links, and a migration note for the removed surfaces.

Docs: CHANGELOG.md, CITATION.cff, and pyproject.toml only; the merged
PRs carried their own docs updates.

Testing:
- make check -> exit 0 (ruff check, ruff format --check, pyright,
  cargo fmt, cargo test, clippy -D warnings)
- uv run pytest -> 1209 passed, 1 skipped in 21.28s
- uv lock --check -> resolved, in sync
- docs guards -> 192 passed
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.

1 participant