Skip to content

[SYSTEMDS-3944] paired retrieval - #2644

Open
b-enedict wants to merge 7 commits into
apache:mainfrom
b-enedict:feat/scuro-paired-retrieval
Open

b-enedict wants to merge 7 commits into
apache:mainfrom
b-enedict:feat/scuro-paired-retrieval

Conversation

@b-enedict

Copy link
Copy Markdown
Contributor

Changes

  • OCR Loader
    • Allows reading text from image input files and stores ocr detected text as modality data
  • Paired Modality
    • Allows applying the same representations and operations on multiple modalities of the same modality type, to realize downstream tasks like embedding based retrieval, where one modality contains the corpus samples and the other contains queries
    • Introduce helper function apply_aggregated_representation(modality, aggregated_representation) for operation_allowlist to remain functional
    • Make padding operation filterable
  • Alignment Graph
    • Adds an extra step to multimodal optimizer to evaluate all potential alignment structures
    • Added Comments where it would integrate into existing optimizers
    • not yet testes on a real dataset
  • Minor
    • Add gpu support for transcript loader
    • Rewrite Alignment Operator loading to lazy loading change
    • Added file path to metadata for every modalitiy type (helpful for matching the ground truth to the individual transcript snippets)
    • Adding a max negative learning pairs parameter to contrastive learning operator and changed variable names to clearer names

Tests were created for alignment graph, contrastive learning operator, paired modality and ocr loader

Assisted-by: AI

b-enedict and others added 7 commits December 1, 2026 14:34
Register alignment operators per modality combination and load them
lazily like the other builtin operators. Rename " orb_alignment.py"
(leading space) to orb_alignment.py and fix its constructor, matcher and
descriptor handling. Alignment.apply_matching now tags matched metadata
with the matching index and fills unmatched instances with a placeholder.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every loader now records the file an instance was read from under the
"file" metadata key (JSON instances additionally keep their "file_idx").
For lazily loaded images and videos the path is attached when the cached
metadata is copied, so existing stats caches stay valid. VideoLoader gets
an optional ext parameter.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
OCRLoader extracts the text of images with Tesseract and exposes it as a
TEXT modality. It is exported lazily, so pytesseract is only required
when the loader is used.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ling

- UnimodalModality.apply_representation(s) take an apply_padding flag
- TranscriptLoader runs Whisper on the detected GPU and falls back to CPU
- TransformedModality.context keeps the data when a context operator
  only annotates metadata and returns None
- Contrastive learning names anchor/augmentation modalities and can cap
  the number of negatives per positive
- Modality errors in the unimodal optimizer are printed to stderr

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PairedModality wraps two or more modalities of the same type (e.g. a
retrieval corpus and its queries) and applies every operation to each of
them, with a per-modality allow list of operations. Representations with
an unsupervised fit requirement are fitted once on the corpus side and
applied to all sides via transform_fitted, so the pair stays in one
feature space. AggregatedRepresentation is dispatched through the
modality so that a pair can fan it out.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AlignmentGraph models groups of implicitly aligned modalities as nodes
and computed alignments as edges. For a set of representations it finds
every combination of shortest alignment paths to a common target group
(plus the unaligned variant) as MatchingPlans. AlignedRepresentation
composes a plan into one matching and reorders a modality accordingly.

The optimizers do not use the graph yet; the places where it would hook
into the unimodal, multimodal and GA optimizers and into DAG execution
are marked with comments.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cover the source file metadata of the loaders (eager, chunked and JSON),
the OCR loader with a mocked Tesseract, PairedModality (validation,
shared fitted vocabulary, allowed operations, data distribution), the
negative sampling cap of contrastive learning and disabling padding in
UnimodalModality.apply_representation.

Assisted-by: AI
Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant