Update README.md
Browse files
README.md
CHANGED
@@ -27,11 +27,15 @@ Then you can use the model like this:
|
|
27 |
|
28 |
```python
|
29 |
from sentence_transformers import SentenceTransformer
|
30 |
-
sentences = ["
|
|
|
31 |
|
32 |
model = SentenceTransformer('nickprock/sentence-bert-base-italian-uncased-sts-matryoshka')
|
33 |
embeddings = model.encode(sentences)
|
34 |
-
|
|
|
|
|
|
|
35 |
```
|
36 |
|
37 |
|
|
|
27 |
|
28 |
```python
|
29 |
from sentence_transformers import SentenceTransformer
|
30 |
+
sentences = ["Una ragazza si acconcia i capelli.", "Una ragazza si sta spazzolando i capelli."]
|
31 |
+
matryoshka_dim = 64
|
32 |
|
33 |
model = SentenceTransformer('nickprock/sentence-bert-base-italian-uncased-sts-matryoshka')
|
34 |
embeddings = model.encode(sentences)
|
35 |
+
embeddings = embeddings[..., :matryoshka_dim] # Shrink the embedding dimensions
|
36 |
+
print(embeddings.shape)
|
37 |
+
# => (2, 64)
|
38 |
+
|
39 |
```
|
40 |
|
41 |
|