You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrations/fastembed.md
+45-5
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,12 @@ toc: true
27
27
-[License](#license)
28
28
29
29
## Overview
30
-
[FastEmbed](https://qdrant.github.io/fastembed/) is a lightweight, fast, Python library built for embedding generation.
30
+
[FastEmbed](https://qdrant.github.io/fastembed/) is a lightweight, fast, Python library built for embedding generation and document ranking.
31
31
32
32
- Light and fast: quantized model weights; ONNX Runtime for inference via Optimum.
33
33
- Performant embedding models: list of [supported models](https://qdrant.github.io/fastembed/examples/Supported_Models/) - including multilingual models.
34
34
- Support for sparse embedding models.
35
+
- Good integration with Qdrant document store and retrievers.
The `fastembed-haystack` integrations provides the following components:
46
-
-`FastembedTextEmbedder`: creates a dense embedding for text (used in query/RAG pipelines).
47
-
-`FastembedDocumentEmbedder`: enriches documents with dense embeddings (used in indexing pipelines).
48
-
-`FastembedSparseTextEmbedder`: creates a sparse embedding for text (used in query/RAG pipelines).
49
-
-`FastembedSparseDocumentEmbedder`: enriches documents with sparse embeddings (used in indexing pipelines).
47
+
- Embedders:
48
+
- `FastembedTextEmbedder`: creates a dense embedding for text (used in query/RAG pipelines).
49
+
- `FastembedDocumentEmbedder`: enriches documents with dense embeddings (used in indexing pipelines).
50
+
- `FastembedSparseTextEmbedder`: creates a sparse embedding for text (used in query/RAG pipelines).
51
+
- `FastembedSparseDocumentEmbedder`: enriches documents with sparse embeddings (used in indexing pipelines).
52
+
- Ranker:
53
+
- `FastembedRanker`: ranks documents based on a query (used in query/RAG pipelines after the retrieval).
50
54
51
55
### Example with dense embeddings
52
56
@@ -125,6 +129,42 @@ result = query_pipeline.run({"sparse_text_embedder": {"text": query}})
125
129
126
130
For a more detailed example, see this [notebook](https://github.com/deepset-ai/haystack-cookbook/blob/main/notebooks/sparse_embedding_retrieval.ipynb).
127
131
132
+
### Example with ranker
133
+
134
+
```python
135
+
from haystack import Document, Pipeline
136
+
from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
137
+
from haystack.document_stores.in_memory import InMemoryDocumentStore
138
+
from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder, FastembedTextEmbedder
139
+
from haystack_integrations.components.rankers.fastembed import FastembedRanker
0 commit comments