Sentence Similarity
sentence-transformers
PyTorch
TensorFlow
ONNX
Safetensors
OpenVINO
English
bert
mteb
Sentence Transformers
Eval Results (legacy)
text-embeddings-inference
Instructions to use intfloat/e5-small-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use intfloat/e5-small-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("intfloat/e5-small-v2") 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] - Inference
- Notebooks
- Google Colab
- Kaggle
Michael Feil commited on
Commit ·
a68bac4
1
Parent(s): 0f45e29
add python example
Browse files
README.md
CHANGED
|
@@ -2677,7 +2677,7 @@ This model only works for English texts. Long texts will be truncated to at most
|
|
| 2677 |
|
| 2678 |
Below is an example for usage with sentence_transformers. `pip install sentence_transformers~=2.2.2`
|
| 2679 |
This is community contributed, and results may vary up to numerical precision.
|
| 2680 |
-
```
|
| 2681 |
from sentence_transformers import SentenceTransformer
|
| 2682 |
model = SentenceTransformer('intfloat/e5-small-v2')
|
| 2683 |
embeddings = model.encode(input_texts, normalize_embeddings=True)
|
|
|
|
| 2677 |
|
| 2678 |
Below is an example for usage with sentence_transformers. `pip install sentence_transformers~=2.2.2`
|
| 2679 |
This is community contributed, and results may vary up to numerical precision.
|
| 2680 |
+
```python
|
| 2681 |
from sentence_transformers import SentenceTransformer
|
| 2682 |
model = SentenceTransformer('intfloat/e5-small-v2')
|
| 2683 |
embeddings = model.encode(input_texts, normalize_embeddings=True)
|