Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1 |
---
|
2 |
-
library_name: sentence-transformers
|
3 |
pipeline_tag: sentence-similarity
|
4 |
tags:
|
5 |
- sentence-transformers
|
6 |
- feature-extraction
|
7 |
- sentence-similarity
|
8 |
- transformers
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
# nickprock/sentence-bert-base-italian-xxl-uncased-sts-matryoshka
|
@@ -27,11 +31,16 @@ 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-
|
33 |
embeddings = model.encode(sentences)
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
```
|
36 |
|
37 |
|
@@ -52,7 +61,7 @@ def mean_pooling(model_output, attention_mask):
|
|
52 |
|
53 |
|
54 |
# Sentences we want sentence embeddings for
|
55 |
-
sentences = [
|
56 |
|
57 |
# Load model from HuggingFace Hub
|
58 |
tokenizer = AutoTokenizer.from_pretrained('nickprock/sentence-bert-base-italian-xxl-uncased-sts-matryoshka')
|
|
|
1 |
---
|
|
|
2 |
pipeline_tag: sentence-similarity
|
3 |
tags:
|
4 |
- sentence-transformers
|
5 |
- feature-extraction
|
6 |
- sentence-similarity
|
7 |
- transformers
|
8 |
+
license: mit
|
9 |
+
datasets:
|
10 |
+
- stsb_multi_mt
|
11 |
+
language:
|
12 |
+
- it
|
13 |
+
library_name: sentence-transformers
|
14 |
---
|
15 |
|
16 |
# nickprock/sentence-bert-base-italian-xxl-uncased-sts-matryoshka
|
|
|
31 |
|
32 |
```python
|
33 |
from sentence_transformers import SentenceTransformer
|
34 |
+
sentences = ["Una ragazza si acconcia i capelli.", "Una ragazza si sta spazzolando i capelli."]
|
35 |
+
matryoshka_dim = 64
|
36 |
|
37 |
+
model = SentenceTransformer('nickprock/sentence-bert-base-italian-uncased')
|
38 |
embeddings = model.encode(sentences)
|
39 |
+
embeddings = embeddings[..., :matryoshka_dim] # Shrink the embedding dimensions
|
40 |
+
print(embeddings.shape)
|
41 |
+
# => (2, 64)
|
42 |
+
|
43 |
+
|
44 |
```
|
45 |
|
46 |
|
|
|
61 |
|
62 |
|
63 |
# Sentences we want sentence embeddings for
|
64 |
+
sentences = ["Una ragazza si acconcia i capelli.", "Una ragazza si sta spazzolando i capelli."]
|
65 |
|
66 |
# Load model from HuggingFace Hub
|
67 |
tokenizer = AutoTokenizer.from_pretrained('nickprock/sentence-bert-base-italian-xxl-uncased-sts-matryoshka')
|