Sentence Similarity
sentence-transformers
PyTorch
Safetensors
English
bert
Sentence Transformers
text-embeddings-inference
Instructions to use intfloat/e5-small-unsupervised with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use intfloat/e5-small-unsupervised with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("intfloat/e5-small-unsupervised") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
update README.md
Browse files
README.md
CHANGED
|
@@ -83,16 +83,16 @@ Contributors: [michaelfeil](https://huggingface.co/michaelfeil)
|
|
| 83 |
|
| 84 |
## FAQ
|
| 85 |
|
| 86 |
-
**1. Do I need to add the prefix
|
| 87 |
|
| 88 |
Yes, this is how the model is trained, otherwise you will see a performance degradation.
|
| 89 |
|
| 90 |
Here are some rules of thumb:
|
| 91 |
-
- Use
|
| 92 |
|
| 93 |
-
- Use
|
| 94 |
|
| 95 |
-
- Use
|
| 96 |
|
| 97 |
**2. Why are my reproduced results slightly different from reported in the model card?**
|
| 98 |
|
|
|
|
| 83 |
|
| 84 |
## FAQ
|
| 85 |
|
| 86 |
+
**1. Do I need to add the prefix "query: " and "passage: " to input texts?**
|
| 87 |
|
| 88 |
Yes, this is how the model is trained, otherwise you will see a performance degradation.
|
| 89 |
|
| 90 |
Here are some rules of thumb:
|
| 91 |
+
- Use "query: " and "passage: " correspondingly for asymmetric tasks such as passage retrieval in open QA, ad-hoc information retrieval.
|
| 92 |
|
| 93 |
+
- Use "query: " prefix for symmetric tasks such as semantic similarity, paraphrase retrieval.
|
| 94 |
|
| 95 |
+
- Use "query: " prefix if you want to use embeddings as features, such as linear probing classification, clustering.
|
| 96 |
|
| 97 |
**2. Why are my reproduced results slightly different from reported in the model card?**
|
| 98 |
|