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: docs/Getting Started.ipynb
+10-10
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
"\n",
12
12
"## Quick Start\n",
13
13
"\n",
14
-
"The fastembed package is designed to be easy to use. We'll be using `TextEmbedding` class. It takes a list of strings as input and returns an generator of vectors. If you're seeing generators for the first time, don't worry, you can convert it to a list using `list()`.\n",
14
+
"The fastembed package is designed to be easy to use. We'll be using `TextEmbedding` class. It takes a list of strings as input and returns a generator of vectors.\n",
15
15
"\n",
16
16
"> 💡 You can learn more about generators from [Python Wiki](https://wiki.python.org/moin/Generators)"
17
17
]
@@ -23,7 +23,7 @@
23
23
"metadata": {},
24
24
"outputs": [],
25
25
"source": [
26
-
"!pip install -Uqq fastembed # Install fastembed"
26
+
"!pip install -Uqq fastembed"
27
27
]
28
28
},
29
29
{
@@ -65,9 +65,12 @@
65
65
}
66
66
],
67
67
"source": [
68
+
"from typing import List\n",
69
+
"\n",
68
70
"import numpy as np\n",
71
+
"\n",
69
72
"from fastembed import TextEmbedding\n",
70
-
"from typing import List\n",
73
+
"\n",
71
74
"\n",
72
75
"# Example list of documents\n",
73
76
"documents: List[str] = [\n",
@@ -79,9 +82,8 @@
79
82
"embedding_model = TextEmbedding()\n",
80
83
"print(\"The model BAAI/bge-small-en-v1.5 is ready to use.\")\n",
81
84
"\n",
82
-
"embeddings_generator = embedding_model.embed(documents) # reminder this is a generator\n",
Copy file name to clipboardexpand all lines: docs/index.md
+11-12
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
FastEmbed is a lightweight, fast, Python library built for embedding generation. We [support popular text models](https://qdrant.github.io/fastembed/examples/Supported_Models/). Please [open a Github issue](https://github.com/qdrant/fastembed/issues/new) if you want us to add a new model.
4
4
5
-
The default embedding supports "query" and "passage" prefixes for the input text. The default model is Flag Embedding, which is top of the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard. Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/examples/Retrieval%20with%20FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/examples/Usage_With_Qdrant/).
6
-
7
5
1. Light & Fast
8
6
- Quantized model weights
9
-
- ONNX Runtime for inference via [Optimum](https://github.com/huggingface/optimum)
7
+
- ONNX Runtime for inference
10
8
11
9
2. Accuracy/Recall
12
10
- Better than OpenAI Ada-002
13
-
- Default is Flag Embedding, which is top of the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard
11
+
- Default is Flag Embedding, which has shown good results on the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard
14
12
- List of [supported models](https://qdrant.github.io/fastembed/examples/Supported_Models/) - including multilingual models
15
13
14
+
Here is an example for [Retrieval Embedding Generation](https://qdrant.github.io/fastembed/examples/Retrieval%20with%20FastEmbed/) and how to use [FastEmbed with Qdrant](https://qdrant.github.io/fastembed/examples/Usage_With_Qdrant/).
15
+
16
16
## 🚀 Installation
17
17
18
18
To install the FastEmbed library, pip works:
@@ -24,16 +24,16 @@ pip install fastembed
24
24
## 📖 Usage
25
25
26
26
```python
27
-
from fastembed.embeddingimportFlagEmbedding as Embedding
27
+
from fastembed importTextEmbedding
28
28
29
29
documents: List[str] = [
30
30
"passage: Hello, World!",
31
-
"query: Hello, World!",# these are two different embedding
31
+
"query: Hello, World!",
32
32
"passage: This is an example passage.",
33
-
"fastembed is supported by and maintained by Qdrant."# You can leave out the prefix but it's recommended
33
+
"fastembed is supported by and maintained by Qdrant."
0 commit comments