Add caption composer for refined annotations#61
Draft
KarlDeck wants to merge 2 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add caption composer for refined annotations
♻️ Current situation & Problem
This PR adds a composition step on top of the existing annotation pipeline.
Right now, the pipeline can generate multiple extracted annotations for a recording, but there was no built-in way to turn those into more natural-sounding refined annotations for quick inspection. The initial implementation also needed to preserve local window information rather than collapsing all annotations into one global summary.
No linked issue yet.
⚙️ Release Notes
Composerthat distills existing annotations into more coherentrefinedannotations.Captionizerto optionally append or replace source annotations with composedrefinedannotations.Example usage:
Local test script:
📚 Documentation
This PR introduces:
composer.pywith the newComposerclassCaptionizer(..., composer=Composer(model))replace_annotations_with_refinedinCaptionizer.run(...)scripts/test_composer_local.pyfor local manual validationThe composition prompt now explicitly performs two internal steps in a single model call:
Windowed annotations are grouped by their exact
window, so composed local annotations retain their temporal localization.✅ Testing
Test coverage added for the new composition behavior:
tests/test_composer.pyValidated with:
conda run -n AML python -m pytest tests/test_composer.pypy_compileon:composer.pycaptionizer.pyscripts/test_composer_local.pytests/test_composer.pyThe local smoke-test script is intended for manual model-backed inspection on sampled records and is not exercised in automated tests because it depends on a locally available model runtime.
Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: