Rename model
Browse files
README.md
CHANGED
@@ -9,12 +9,10 @@ tags:
|
|
9 |
|
10 |
---
|
11 |
|
12 |
-
# tomaarsen/mpnet-base-
|
13 |
|
14 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
15 |
|
16 |
-
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317233cc92fd6fee317e030/TRQAVBKtW6NyTnC5BnTu1.png)
|
17 |
-
|
18 |
<!--- Describe your model here -->
|
19 |
|
20 |
## Usage (Sentence-Transformers)
|
@@ -31,7 +29,7 @@ Then you can use the model like this:
|
|
31 |
from sentence_transformers import SentenceTransformer
|
32 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
33 |
|
34 |
-
model = SentenceTransformer('tomaarsen/mpnet-base-
|
35 |
embeddings = model.encode(sentences)
|
36 |
print(embeddings)
|
37 |
```
|
@@ -57,8 +55,8 @@ def mean_pooling(model_output, attention_mask):
|
|
57 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
58 |
|
59 |
# Load model from HuggingFace Hub
|
60 |
-
tokenizer = AutoTokenizer.from_pretrained('tomaarsen/mpnet-base-
|
61 |
-
model = AutoModel.from_pretrained('tomaarsen/mpnet-base-
|
62 |
|
63 |
# Tokenize sentences
|
64 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
@@ -80,15 +78,50 @@ print(sentence_embeddings)
|
|
80 |
|
81 |
<!--- Describe how your model was evaluated -->
|
82 |
|
83 |
-
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=tomaarsen/mpnet-base-
|
|
|
|
|
|
|
|
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
|
87 |
## Full Model Architecture
|
88 |
```
|
89 |
SentenceTransformer(
|
90 |
-
(0): Transformer({'max_seq_length':
|
91 |
-
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False})
|
92 |
)
|
93 |
```
|
94 |
|
|
|
9 |
|
10 |
---
|
11 |
|
12 |
+
# tomaarsen/mpnet-base-nli-matryoshka
|
13 |
|
14 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
15 |
|
|
|
|
|
16 |
<!--- Describe your model here -->
|
17 |
|
18 |
## Usage (Sentence-Transformers)
|
|
|
29 |
from sentence_transformers import SentenceTransformer
|
30 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
31 |
|
32 |
+
model = SentenceTransformer('tomaarsen/mpnet-base-nli-matryoshka')
|
33 |
embeddings = model.encode(sentences)
|
34 |
print(embeddings)
|
35 |
```
|
|
|
55 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
56 |
|
57 |
# Load model from HuggingFace Hub
|
58 |
+
tokenizer = AutoTokenizer.from_pretrained('tomaarsen/mpnet-base-nli-matryoshka')
|
59 |
+
model = AutoModel.from_pretrained('tomaarsen/mpnet-base-nli-matryoshka')
|
60 |
|
61 |
# Tokenize sentences
|
62 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
78 |
|
79 |
<!--- Describe how your model was evaluated -->
|
80 |
|
81 |
+
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=tomaarsen/mpnet-base-nli-matryoshka)
|
82 |
+
|
83 |
+
|
84 |
+
## Training
|
85 |
+
The model was trained with the parameters:
|
86 |
|
87 |
+
**DataLoader**:
|
88 |
+
|
89 |
+
`sentence_transformers.datasets.NoDuplicatesDataLoader.NoDuplicatesDataLoader` of length 8807 with parameters:
|
90 |
+
```
|
91 |
+
{'batch_size': 64}
|
92 |
+
```
|
93 |
+
|
94 |
+
**Loss**:
|
95 |
+
|
96 |
+
`sentence_transformers.losses.MatryoshkaLoss.MatryoshkaLoss` with parameters:
|
97 |
+
```
|
98 |
+
{'loss': 'MultipleNegativesRankingLoss', 'matryoshka_dims': [768, 512, 256, 128, 64], 'matryoshka_weights': [1, 1, 1, 1, 1]}
|
99 |
+
```
|
100 |
+
|
101 |
+
Parameters of the fit()-Method:
|
102 |
+
```
|
103 |
+
{
|
104 |
+
"epochs": 1,
|
105 |
+
"evaluation_steps": 880,
|
106 |
+
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
|
107 |
+
"max_grad_norm": 1,
|
108 |
+
"optimizer_class": "<class 'torch.optim.adamw.AdamW'>",
|
109 |
+
"optimizer_params": {
|
110 |
+
"lr": 2e-05
|
111 |
+
},
|
112 |
+
"scheduler": "WarmupLinear",
|
113 |
+
"steps_per_epoch": null,
|
114 |
+
"warmup_steps": 881,
|
115 |
+
"weight_decay": 0.01
|
116 |
+
}
|
117 |
+
```
|
118 |
|
119 |
|
120 |
## Full Model Architecture
|
121 |
```
|
122 |
SentenceTransformer(
|
123 |
+
(0): Transformer({'max_seq_length': 75, 'do_lower_case': False}) with Transformer model: MPNetModel
|
124 |
+
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
125 |
)
|
126 |
```
|
127 |
|