-
Notifications
You must be signed in to change notification settings - Fork 200
Fastembed Colbert Reranker #2482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…, CHANGELOG, example
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
…rig_idx) Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
…ert-reranker Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in> # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
|
@anakin87 The “Check Integration Format” job is failing due to hyphens found in unrelated files in the repo. My FastEmbed changes don’t add any hyphenated directories under These existing files contain hyphens in their filenames:
|
The problem lies in this git submodule. Please remove it.
|
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
a302ad2 to
6d30a65
Compare
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
fcf4a21 to
b909590
Compare
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
770e875 to
7198b83
Compare
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
5663922 to
fdb1d9e
Compare
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
9b4e1bf to
3cf8a37
Compare
Signed-off-by: Arya Tayshete <avtayshete_b21@et.vjti.ac.in>
0d0e1e2 to
217d213
Compare
|
@anakin87 can you check once and LMK if you want changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially started reviewing this PR, but I noticed that it diverges significantly from other components in this package/repository.
Please take a look at other components and tests in the Fastembed-Haystack integration for inspiration and to align this implementation with the existing patterns.
I'll be away for a few days, but I can pick up the review again once I'm back if there are updates.
| ## [Unreleased] | ||
|
|
||
| ### 🚀 Features | ||
| - Add `FastembedColbertReranker`: ColBERT late-interaction (MaxSim) reranker for 1st-stage candidates (100–500). (#2482) | ||
|
|
||
| ### 📚 Documentation | ||
| - FastEmbed docs: “ColBERT Reranker” section with quickstart + pipeline example. (#2482) | ||
| - Integration README: add bullet for `FastembedColbertReranker` and links. (#2482) | ||
|
|
||
| ### 🧪 Testing | ||
| - Unit tests for MaxSim math, parameter validation, stable tie-break, and monkeypatched ranking (no model download). (#2482) | ||
|
|
||
| ### 🧹 Chores | ||
| - Parameter validation, robust warm-up for fastembed API drift, stable sorting on score ties. (#2482) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is automatically generated and not meant to be modified
| ## Components | ||
|
|
||
| - **FastembedTextEmbedder / FastembedDocumentEmbedder / Sparse embedders** – embedding components for dense and sparse retrieval (see docs). | ||
| - **FastembedRanker** – cross-encoder reranker (see docs). | ||
| - **FastembedColbertReranker** – *new* ColBERT late-interaction (MaxSim) reranker for reordering 100–500 candidates on CPU via ONNX. | ||
| → See the docs for installation and examples. | ||
|
|
||
| ### Documentation | ||
|
|
||
| - Integration page: https://haystack.deepset.ai/integrations/fastembed | ||
| - Component docs: | ||
| - Fastembed embedders: https://docs.haystack.deepset.ai/docs/fastembedtextembedder | ||
| - FastembedRanker (cross-encoder): https://docs.haystack.deepset.ai/docs/fastembedranker | ||
| - **FastembedColbertReranker (ColBERT)**: *[link to your new docs section]* | ||
|
|
||
| ### Install | ||
|
|
||
| ```bash | ||
| pip install fastembed-haystack | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Components | |
| - **FastembedTextEmbedder / FastembedDocumentEmbedder / Sparse embedders** – embedding components for dense and sparse retrieval (see docs). | |
| - **FastembedRanker** – cross-encoder reranker (see docs). | |
| - **FastembedColbertReranker** – *new* ColBERT late-interaction (MaxSim) reranker for reordering 100–500 candidates on CPU via ONNX. | |
| → See the docs for installation and examples. | |
| ### Documentation | |
| - Integration page: https://haystack.deepset.ai/integrations/fastembed | |
| - Component docs: | |
| - Fastembed embedders: https://docs.haystack.deepset.ai/docs/fastembedtextembedder | |
| - FastembedRanker (cross-encoder): https://docs.haystack.deepset.ai/docs/fastembedranker | |
| - **FastembedColbertReranker (ColBERT)**: *[link to your new docs section]* | |
| ### Install | |
| ```bash | |
| pip install fastembed-haystack |
README should be stay minimal. We'll add this information to docs.
| @@ -0,0 +1,4 @@ | |||
| from __future__ import annotations | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file
| @@ -1,3 +1,3 @@ | |||
| from .ranker import FastembedRanker | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the existing ranker should not be removed from here.
also, please not introduce new init files: integrations/fastembed/src/haystack_integrations/init.py, etc.
This package is a namespace package, so these init files should be avoided.

Related Issues
Proposed Changes:
Feature: Add
FastembedColbertReranker— a ColBERT late-interaction (MaxSim) reranker inside the FastEmbed integration.haystack_integrations.components.rankers.fastembed.FastembedColbertRerankerLateInteractionTextEmbeddingto encode query and documents (token-level).sum_q max_d (sim(q_i, d_j))with configurablesimilarity={"cosine","dot"}and optional L2 normalization.batch_size) and optional token limits (max_query_tokens,max_doc_tokens).examples/fastembed_colbert_reranker.py.Why: Cross-encoder rankers don’t cover late-interaction/bi-encoder models like ColBERT v2. This adds a first-class ColBERT reranker over ~100–500 retrieved candidates.
How did you test it?
Unit tests
similarity,batch_size,top_k).top_kvia monkeypatched encoders (no model download required).Manual verification
pip install -e integrations/fastembedpython examples/fastembed_colbert_reranker.pyNotes for the reviewer
integrations/fastembed/src/...(no changes to core Haystack).