Update README.md
Browse files
README.md
CHANGED
|
@@ -2667,9 +2667,16 @@ Training data to train the models is released in its entirety. For more details,
|
|
| 2667 |
|
| 2668 |
## Usage
|
| 2669 |
|
| 2670 |
-
Note `nomic-embed-text` requires prefixes! We support the prefixes `[search_query, search_document, classification, clustering]`.
|
| 2671 |
For retrieval applications, you should prepend `search_document` for all your documents and `search_query` for your queries.
|
| 2672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2673 |
### Sentence Transformers
|
| 2674 |
```python
|
| 2675 |
import torch.nn.functional as F
|
|
|
|
| 2667 |
|
| 2668 |
## Usage
|
| 2669 |
|
| 2670 |
+
Note `nomic-embed-text` *requires* prefixes! We support the prefixes `[search_query, search_document, classification, clustering]`.
|
| 2671 |
For retrieval applications, you should prepend `search_document` for all your documents and `search_query` for your queries.
|
| 2672 |
|
| 2673 |
+
For example, you are building a RAG application over the top of Wikipedia. You would embed all Wikipedia articles with the prefix `search_document`
|
| 2674 |
+
and any questions you ask with `search_query`. For example:
|
| 2675 |
+
```python
|
| 2676 |
+
queries = ["search_query: who is the first president of the united states?", "search_query: when was babe ruth born?"]
|
| 2677 |
+
documents = ["search_document: <article about US Presidents>", "search_document: <article about Babe Ruth>"]
|
| 2678 |
+
```
|
| 2679 |
+
|
| 2680 |
### Sentence Transformers
|
| 2681 |
```python
|
| 2682 |
import torch.nn.functional as F
|