How to use reranking models (e.g., jina-reranker-v2) with Hugot? #75
-
|
Hi everyone! First of all, thank you for this wonderful project! I'm currently considering integrating it into one of my pet projects (a simple RAG service) and I have some questions about how to use certain models from Hugging Face. For example, how could I use a reranking model like jinaai/jina-reranker-v2-base-multilingual? I've run some tests but the results don't seem correct. Could anyone provide some guidance or pointers? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
|
Hi there! Thank you for your interest. Short answer is this is currently not (yet) supported in that the FeatureExtractionPipeline is designed for (sentence) embedding, e.g. like all-miniLM from sentence transformers, not reranking (i.e. cross encoder) models like the Jina one (which rerank rather than producing embeddings). Implementing cross encoders for hugot should not be hard however, it amounts to basically converting the logic of the We had the request to use CrossEncoder models before in the past so it might be something I can take a look at, can't provide timelines though - might have some time this weekend |
Beta Was this translation helpful? Give feedback.
Hi there! Thank you for your interest.
Short answer is this is currently not (yet) supported in that the FeatureExtractionPipeline is designed for (sentence) embedding, e.g. like all-miniLM from sentence transformers, not reranking (i.e. cross encoder) models like the Jina one (which rerank rather than producing embeddings).
Implementing cross encoders for hugot should not be hard however, it amounts to basically converting the logic of the
AutoModelForSequenceClassificationhuggingface AutoModel to replicate what they do e.g. here https://huggingface.co/jinaai/jina-reranker-v1-tiny-en in the huggingface transformers approach, creating a new pipelineType like e.g.CrossEncoderPipeline.We…