Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +470 -0
- config.json +24 -0
- config_sentence_transformers.json +9 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +51 -0
- tokenizer.json +0 -0
- tokenizer_config.json +65 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 768,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
5 |
+
"pooling_mode_max_tokens": false,
|
6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
7 |
+
"pooling_mode_weightedmean_tokens": false,
|
8 |
+
"pooling_mode_lasttoken": false,
|
9 |
+
"include_prompt": true
|
10 |
+
}
|
README.md
ADDED
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
library_name: sentence-transformers
|
5 |
+
tags:
|
6 |
+
- sentence-transformers
|
7 |
+
- sentence-similarity
|
8 |
+
- feature-extraction
|
9 |
+
- generated
|
10 |
+
base_model: microsoft/mpnet-base
|
11 |
+
metrics:
|
12 |
+
- accuracy
|
13 |
+
widget:
|
14 |
+
- source_sentence: Many youth are lazy.
|
15 |
+
sentences:
|
16 |
+
- Lincoln took his hat off.
|
17 |
+
- At the end of the fourth century was when baked goods flourished.
|
18 |
+
- DOD's common practice for managing this environment has been to create aggressive
|
19 |
+
risk reduction efforts in its programs.
|
20 |
+
- source_sentence: a guy on a bike
|
21 |
+
sentences:
|
22 |
+
- A man is on a bike.
|
23 |
+
- two men sit in a train car
|
24 |
+
- She is the boy's aunt.
|
25 |
+
- source_sentence: The dog is wet.
|
26 |
+
sentences:
|
27 |
+
- A child and small dog running.
|
28 |
+
- The man is riding a sheep.
|
29 |
+
- The man is doing a bike trick.
|
30 |
+
- source_sentence: yeah really no kidding
|
31 |
+
sentences:
|
32 |
+
- 'Really? No kidding! '
|
33 |
+
- yeah i mean just when uh the they military paid for her education
|
34 |
+
- Changes were made to the Grant Renewal Application to provide extra information
|
35 |
+
to the LSC.
|
36 |
+
- source_sentence: 'Harlem did a great job '
|
37 |
+
sentences:
|
38 |
+
- 'Missouri was happy to continue it''s planning efforts. '
|
39 |
+
- yeah i mean just when uh the they military paid for her education
|
40 |
+
- I know exactly.
|
41 |
+
pipeline_tag: sentence-similarity
|
42 |
+
co2_eq_emissions:
|
43 |
+
emissions: 18.165192544667764
|
44 |
+
source: codecarbon
|
45 |
+
training_type: fine-tuning
|
46 |
+
on_cloud: false
|
47 |
+
cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
|
48 |
+
ram_total_size: 31.777088165283203
|
49 |
+
hours_used: 0.141
|
50 |
+
hardware_used: 1 x NVIDIA GeForce RTX 3090
|
51 |
+
---
|
52 |
+
|
53 |
+
# SentenceTransformer
|
54 |
+
|
55 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) on the [multi_nli](https://huggingface.co/datasets/nyu-mll/multi_nli), [snli](https://huggingface.co/datasets/stanfordnlp/snli) and [stsb](https://huggingface.co/datasets/mteb/stsbenchmark-sts) datasets. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
56 |
+
|
57 |
+
## Model Details
|
58 |
+
|
59 |
+
### Model Description
|
60 |
+
- **Model Type:** Sentence Transformer
|
61 |
+
- **Base model:** [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base)
|
62 |
+
- **Maximum Sequence Length:** 384 tokens
|
63 |
+
- **Output Dimensionality:** 768 tokens
|
64 |
+
- **Training Datasets:**
|
65 |
+
- [multi_nli](https://huggingface.co/datasets/nyu-mll/multi_nli)
|
66 |
+
- [snli](https://huggingface.co/datasets/stanfordnlp/snli)
|
67 |
+
- [stsb](https://huggingface.co/datasets/mteb/stsbenchmark-sts)
|
68 |
+
- **Language:** en
|
69 |
+
<!-- - **License:** Unknown -->
|
70 |
+
|
71 |
+
### Model Sources
|
72 |
+
|
73 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
74 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
75 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
76 |
+
|
77 |
+
### Full Model Architecture
|
78 |
+
|
79 |
+
```
|
80 |
+
SentenceTransformer(
|
81 |
+
(0): Transformer({'max_seq_length': 384, 'do_lower_case': False}) with Transformer model: MPNetModel
|
82 |
+
(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})
|
83 |
+
)
|
84 |
+
```
|
85 |
+
|
86 |
+
## Usage
|
87 |
+
|
88 |
+
### Direct Usage (Sentence Transformers)
|
89 |
+
|
90 |
+
First install the Sentence Transformers library:
|
91 |
+
|
92 |
+
```bash
|
93 |
+
pip install -U sentence-transformers
|
94 |
+
```
|
95 |
+
|
96 |
+
Then you can load this model and run inference.
|
97 |
+
```python
|
98 |
+
from sentence_transformers import SentenceTransformer
|
99 |
+
|
100 |
+
# Download from the 🤗 Hub
|
101 |
+
model = SentenceTransformer("tomaarsen/st-v3-test-mpnet-base-allnli-stsb")
|
102 |
+
# Run inference
|
103 |
+
sentences = [
|
104 |
+
"Harlem did a great job ",
|
105 |
+
"Missouri was happy to continue it's planning efforts. ",
|
106 |
+
"yeah i mean just when uh the they military paid for her education",
|
107 |
+
]
|
108 |
+
embeddings = model.encode(sentences)
|
109 |
+
print(embeddings.shape)
|
110 |
+
# [3, 768]
|
111 |
+
```
|
112 |
+
|
113 |
+
<!--
|
114 |
+
### Direct Usage (Transformers)
|
115 |
+
|
116 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
117 |
+
|
118 |
+
</details>
|
119 |
+
-->
|
120 |
+
|
121 |
+
<!--
|
122 |
+
### Downstream Usage (Sentence Transformers)
|
123 |
+
|
124 |
+
You can finetune this model on your own dataset.
|
125 |
+
|
126 |
+
<details><summary>Click to expand</summary>
|
127 |
+
|
128 |
+
</details>
|
129 |
+
-->
|
130 |
+
|
131 |
+
<!--
|
132 |
+
### Out-of-Scope Use
|
133 |
+
|
134 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
135 |
+
-->
|
136 |
+
|
137 |
+
<!--
|
138 |
+
## Bias, Risks and Limitations
|
139 |
+
|
140 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
141 |
+
-->
|
142 |
+
|
143 |
+
<!--
|
144 |
+
### Recommendations
|
145 |
+
|
146 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
147 |
+
-->
|
148 |
+
|
149 |
+
## Training Details
|
150 |
+
|
151 |
+
### Training Datasets
|
152 |
+
|
153 |
+
#### multi_nli
|
154 |
+
|
155 |
+
* Dataset: [multi_nli](https://huggingface.co/datasets/nyu-mll/multi_nli) at [da70db2](https://huggingface.co/datasets/nyu-mll/multi_nli/tree/da70db2af9d09693783c3320c4249840212ee221)
|
156 |
+
* Size: 10,000 training samples
|
157 |
+
* Columns: <code>premise</code>, <code>hypothesis</code>, and <code>label</code>
|
158 |
+
* Approximate statistics based on the first 1000 samples:
|
159 |
+
| | premise | hypothesis | label |
|
160 |
+
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
|
161 |
+
| type | string | string | int |
|
162 |
+
| details | <ul><li>min: 4 tokens</li><li>mean: 26.95 tokens</li><li>max: 189 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 14.11 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>0: ~34.30%</li><li>1: ~28.20%</li><li>2: ~37.50%</li></ul> |
|
163 |
+
* Samples:
|
164 |
+
| premise | hypothesis | label |
|
165 |
+
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------|
|
166 |
+
| <code>Conceptually cream skimming has two basic dimensions - product and geography.</code> | <code>Product and geography are what make cream skimming work. </code> | <code>1</code> |
|
167 |
+
| <code>you know during the season and i guess at at your level uh you lose them to the next level if if they decide to recall the the parent team the Braves decide to call to recall a guy from triple A then a double A guy goes up to replace him and a single A guy goes up to replace him</code> | <code>You lose the things to the following level if the people recall.</code> | <code>0</code> |
|
168 |
+
| <code>One of our number will carry out your instructions minutely.</code> | <code>A member of my team will execute your orders with immense precision.</code> | <code>0</code> |
|
169 |
+
* Loss: [<code>sentence_transformers.losses.SoftmaxLoss.SoftmaxLoss</code>](https://sbert.net/docs/package_reference/losses.html#softmaxloss)
|
170 |
+
|
171 |
+
#### snli
|
172 |
+
|
173 |
+
* Dataset: [snli](https://huggingface.co/datasets/stanfordnlp/snli) at [cdb5c3d](https://huggingface.co/datasets/stanfordnlp/snli/tree/cdb5c3d5eed6ead6e5a341c8e56e669bb666725b)
|
174 |
+
* Size: 10,000 training samples
|
175 |
+
* Columns: <code>snli_premise</code>, <code>hypothesis</code>, and <code>label</code>
|
176 |
+
* Approximate statistics based on the first 1000 samples:
|
177 |
+
| | snli_premise | hypothesis | label |
|
178 |
+
|:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-------------------------------------------------------------------|
|
179 |
+
| type | string | string | int |
|
180 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 17.38 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 10.7 tokens</li><li>max: 31 tokens</li></ul> | <ul><li>0: ~33.40%</li><li>1: ~33.30%</li><li>2: ~33.30%</li></ul> |
|
181 |
+
* Samples:
|
182 |
+
| snli_premise | hypothesis | label |
|
183 |
+
|:--------------------------------------------------------------------|:---------------------------------------------------------------|:---------------|
|
184 |
+
| <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is training his horse for a competition.</code> | <code>1</code> |
|
185 |
+
| <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is at a diner, ordering an omelette.</code> | <code>2</code> |
|
186 |
+
| <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is outdoors, on a horse.</code> | <code>0</code> |
|
187 |
+
* Loss: [<code>sentence_transformers.losses.SoftmaxLoss.SoftmaxLoss</code>](https://sbert.net/docs/package_reference/losses.html#softmaxloss)
|
188 |
+
|
189 |
+
#### stsb
|
190 |
+
|
191 |
+
* Dataset: [stsb](https://huggingface.co/datasets/mteb/stsbenchmark-sts) at [8913289](https://huggingface.co/datasets/mteb/stsbenchmark-sts/tree/8913289635987208e6e7c72789e4be2fe94b6abd)
|
192 |
+
* Size: 5,749 training samples
|
193 |
+
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
194 |
+
* Approximate statistics based on the first 1000 samples:
|
195 |
+
| | sentence1 | sentence2 | label |
|
196 |
+
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
197 |
+
| type | string | string | float |
|
198 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 10.0 tokens</li><li>max: 28 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 9.95 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.54</li><li>max: 1.0</li></ul> |
|
199 |
+
* Samples:
|
200 |
+
| sentence1 | sentence2 | label |
|
201 |
+
|:-----------------------------------------------------------|:----------------------------------------------------------------------|:------------------|
|
202 |
+
| <code>A plane is taking off.</code> | <code>An air plane is taking off.</code> | <code>1.0</code> |
|
203 |
+
| <code>A man is playing a large flute.</code> | <code>A man is playing a flute.</code> | <code>0.76</code> |
|
204 |
+
| <code>A man is spreading shreded cheese on a pizza.</code> | <code>A man is spreading shredded cheese on an uncooked pizza.</code> | <code>0.76</code> |
|
205 |
+
* Loss: [<code>sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/losses.html#cosinesimilarityloss) with these parameters:
|
206 |
+
```json
|
207 |
+
{
|
208 |
+
"loss_fct": "torch.nn.modules.loss.MSELoss"
|
209 |
+
}
|
210 |
+
```
|
211 |
+
|
212 |
+
### Evaluation Datasets
|
213 |
+
|
214 |
+
#### multi_nli
|
215 |
+
|
216 |
+
* Dataset: [multi_nli](https://huggingface.co/datasets/nyu-mll/multi_nli) at [da70db2](https://huggingface.co/datasets/nyu-mll/multi_nli/tree/da70db2af9d09693783c3320c4249840212ee221)
|
217 |
+
* Size: 100 evaluation samples
|
218 |
+
* Columns: <code>premise</code>, <code>hypothesis</code>, and <code>label</code>
|
219 |
+
* Approximate statistics based on the first 1000 samples:
|
220 |
+
| | premise | hypothesis | label |
|
221 |
+
|:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
|
222 |
+
| type | string | string | int |
|
223 |
+
| details | <ul><li>min: 5 tokens</li><li>mean: 27.67 tokens</li><li>max: 138 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.48 tokens</li><li>max: 27 tokens</li></ul> | <ul><li>0: ~35.00%</li><li>1: ~31.00%</li><li>2: ~34.00%</li></ul> |
|
224 |
+
* Samples:
|
225 |
+
| premise | hypothesis | label |
|
226 |
+
|:---------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------|:---------------|
|
227 |
+
| <code>The new rights are nice enough</code> | <code>Everyone really likes the newest benefits </code> | <code>1</code> |
|
228 |
+
| <code>This site includes a list of all award winners and a searchable database of Government Executive articles.</code> | <code>The Government Executive articles housed on the website are not able to be searched.</code> | <code>2</code> |
|
229 |
+
| <code>uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him</code> | <code>I like him for the most part, but would still enjoy seeing someone beat him.</code> | <code>0</code> |
|
230 |
+
* Loss: [<code>sentence_transformers.losses.SoftmaxLoss.SoftmaxLoss</code>](https://sbert.net/docs/package_reference/losses.html#softmaxloss)
|
231 |
+
|
232 |
+
#### snli
|
233 |
+
|
234 |
+
* Dataset: [snli](https://huggingface.co/datasets/stanfordnlp/snli) at [cdb5c3d](https://huggingface.co/datasets/stanfordnlp/snli/tree/cdb5c3d5eed6ead6e5a341c8e56e669bb666725b)
|
235 |
+
* Size: 9,842 evaluation samples
|
236 |
+
* Columns: <code>snli_premise</code>, <code>hypothesis</code>, and <code>label</code>
|
237 |
+
* Approximate statistics based on the first 1000 samples:
|
238 |
+
| | snli_premise | hypothesis | label |
|
239 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------|
|
240 |
+
| type | string | string | int |
|
241 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 18.44 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 10.57 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>0: ~33.10%</li><li>1: ~33.30%</li><li>2: ~33.60%</li></ul> |
|
242 |
+
* Samples:
|
243 |
+
| snli_premise | hypothesis | label |
|
244 |
+
|:-------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------|:---------------|
|
245 |
+
| <code>Two women are embracing while holding to go packages.</code> | <code>The sisters are hugging goodbye while holding to go packages after just eating lunch.</code> | <code>1</code> |
|
246 |
+
| <code>Two women are embracing while holding to go packages.</code> | <code>Two woman are holding packages.</code> | <code>0</code> |
|
247 |
+
| <code>Two women are embracing while holding to go packages.</code> | <code>The men are fighting outside a deli.</code> | <code>2</code> |
|
248 |
+
* Loss: [<code>sentence_transformers.losses.SoftmaxLoss.SoftmaxLoss</code>](https://sbert.net/docs/package_reference/losses.html#softmaxloss)
|
249 |
+
|
250 |
+
#### stsb
|
251 |
+
|
252 |
+
* Dataset: [stsb](https://huggingface.co/datasets/mteb/stsbenchmark-sts) at [8913289](https://huggingface.co/datasets/mteb/stsbenchmark-sts/tree/8913289635987208e6e7c72789e4be2fe94b6abd)
|
253 |
+
* Size: 1,500 evaluation samples
|
254 |
+
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
255 |
+
* Approximate statistics based on the first 1000 samples:
|
256 |
+
| | sentence1 | sentence2 | label |
|
257 |
+
|:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
|
258 |
+
| type | string | string | float |
|
259 |
+
| details | <ul><li>min: 5 tokens</li><li>mean: 15.1 tokens</li><li>max: 45 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 15.11 tokens</li><li>max: 53 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.47</li><li>max: 1.0</li></ul> |
|
260 |
+
* Samples:
|
261 |
+
| sentence1 | sentence2 | label |
|
262 |
+
|:--------------------------------------------------|:------------------------------------------------------|:------------------|
|
263 |
+
| <code>A man with a hard hat is dancing.</code> | <code>A man wearing a hard hat is dancing.</code> | <code>1.0</code> |
|
264 |
+
| <code>A young child is riding a horse.</code> | <code>A child is riding a horse.</code> | <code>0.95</code> |
|
265 |
+
| <code>A man is feeding a mouse to a snake.</code> | <code>The man is feeding a mouse to the snake.</code> | <code>1.0</code> |
|
266 |
+
* Loss: [<code>sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/losses.html#cosinesimilarityloss) with these parameters:
|
267 |
+
```json
|
268 |
+
{
|
269 |
+
"loss_fct": "torch.nn.modules.loss.MSELoss"
|
270 |
+
}
|
271 |
+
```
|
272 |
+
|
273 |
+
### Training Hyperparameters
|
274 |
+
#### Non-Default Hyperparameters
|
275 |
+
|
276 |
+
- per_device_train_batch_size: 128
|
277 |
+
- per_device_eval_batch_size: 128
|
278 |
+
- learning_rate: 2e-05
|
279 |
+
- num_train_epochs: 1
|
280 |
+
- warmup_ratio: 0.1
|
281 |
+
- seed: 33
|
282 |
+
- bf16: True
|
283 |
+
|
284 |
+
#### All Hyperparameters
|
285 |
+
<details><summary>Click to expand</summary>
|
286 |
+
|
287 |
+
- overwrite_output_dir: False
|
288 |
+
- do_predict: False
|
289 |
+
- prediction_loss_only: False
|
290 |
+
- per_device_train_batch_size: 128
|
291 |
+
- per_device_eval_batch_size: 128
|
292 |
+
- per_gpu_train_batch_size: None
|
293 |
+
- per_gpu_eval_batch_size: None
|
294 |
+
- gradient_accumulation_steps: 1
|
295 |
+
- eval_accumulation_steps: None
|
296 |
+
- learning_rate: 2e-05
|
297 |
+
- weight_decay: 0.0
|
298 |
+
- adam_beta1: 0.9
|
299 |
+
- adam_beta2: 0.999
|
300 |
+
- adam_epsilon: 1e-08
|
301 |
+
- max_grad_norm: 1.0
|
302 |
+
- num_train_epochs: 1
|
303 |
+
- max_steps: -1
|
304 |
+
- lr_scheduler_type: linear
|
305 |
+
- lr_scheduler_kwargs: {}
|
306 |
+
- warmup_ratio: 0.1
|
307 |
+
- warmup_steps: 0
|
308 |
+
- log_level: passive
|
309 |
+
- log_level_replica: warning
|
310 |
+
- log_on_each_node: True
|
311 |
+
- logging_nan_inf_filter: True
|
312 |
+
- save_safetensors: True
|
313 |
+
- save_on_each_node: False
|
314 |
+
- save_only_model: False
|
315 |
+
- no_cuda: False
|
316 |
+
- use_cpu: False
|
317 |
+
- use_mps_device: False
|
318 |
+
- seed: 33
|
319 |
+
- data_seed: None
|
320 |
+
- jit_mode_eval: False
|
321 |
+
- use_ipex: False
|
322 |
+
- bf16: True
|
323 |
+
- fp16: False
|
324 |
+
- fp16_opt_level: O1
|
325 |
+
- half_precision_backend: auto
|
326 |
+
- bf16_full_eval: False
|
327 |
+
- fp16_full_eval: False
|
328 |
+
- tf32: None
|
329 |
+
- local_rank: 0
|
330 |
+
- ddp_backend: None
|
331 |
+
- tpu_num_cores: None
|
332 |
+
- tpu_metrics_debug: False
|
333 |
+
- debug: []
|
334 |
+
- dataloader_drop_last: False
|
335 |
+
- dataloader_num_workers: 0
|
336 |
+
- dataloader_prefetch_factor: None
|
337 |
+
- past_index: -1
|
338 |
+
- disable_tqdm: False
|
339 |
+
- remove_unused_columns: True
|
340 |
+
- label_names: None
|
341 |
+
- load_best_model_at_end: False
|
342 |
+
- ignore_data_skip: False
|
343 |
+
- fsdp: []
|
344 |
+
- fsdp_min_num_params: 0
|
345 |
+
- fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
346 |
+
- fsdp_transformer_layer_cls_to_wrap: None
|
347 |
+
- accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True}
|
348 |
+
- deepspeed: None
|
349 |
+
- label_smoothing_factor: 0.0
|
350 |
+
- optim: adamw_torch
|
351 |
+
- optim_args: None
|
352 |
+
- adafactor: False
|
353 |
+
- group_by_length: False
|
354 |
+
- length_column_name: length
|
355 |
+
- ddp_find_unused_parameters: None
|
356 |
+
- ddp_bucket_cap_mb: None
|
357 |
+
- ddp_broadcast_buffers: None
|
358 |
+
- dataloader_pin_memory: True
|
359 |
+
- dataloader_persistent_workers: False
|
360 |
+
- skip_memory_metrics: True
|
361 |
+
- use_legacy_prediction_loop: False
|
362 |
+
- push_to_hub: False
|
363 |
+
- resume_from_checkpoint: None
|
364 |
+
- hub_model_id: None
|
365 |
+
- hub_strategy: every_save
|
366 |
+
- hub_private_repo: False
|
367 |
+
- hub_always_push: False
|
368 |
+
- gradient_checkpointing: False
|
369 |
+
- gradient_checkpointing_kwargs: None
|
370 |
+
- include_inputs_for_metrics: False
|
371 |
+
- fp16_backend: auto
|
372 |
+
- push_to_hub_model_id: None
|
373 |
+
- push_to_hub_organization: None
|
374 |
+
- mp_parameters:
|
375 |
+
- auto_find_batch_size: False
|
376 |
+
- full_determinism: False
|
377 |
+
- torchdynamo: None
|
378 |
+
- ray_scope: last
|
379 |
+
- ddp_timeout: 1800
|
380 |
+
- torch_compile: False
|
381 |
+
- torch_compile_backend: None
|
382 |
+
- torch_compile_mode: None
|
383 |
+
- dispatch_batches: None
|
384 |
+
- split_batches: None
|
385 |
+
- include_tokens_per_second: False
|
386 |
+
- include_num_input_tokens_seen: False
|
387 |
+
- neftune_noise_alpha: None
|
388 |
+
- optim_target_modules: None
|
389 |
+
- round_robin_sampler: False
|
390 |
+
|
391 |
+
</details>
|
392 |
+
|
393 |
+
### Training Logs
|
394 |
+
| Epoch | Step | Training Loss | multi_nli | snli | stsb |
|
395 |
+
|:------:|:----:|:-------------:|:---------:|:------:|:------:|
|
396 |
+
| 0.0493 | 10 | 0.9204 | 1.0998 | 1.1022 | 0.2997 |
|
397 |
+
| 0.0985 | 20 | 1.0074 | 1.0983 | 1.0971 | 0.2499 |
|
398 |
+
| 0.1478 | 30 | 1.0037 | 1.0994 | 1.0939 | 0.1667 |
|
399 |
+
| 0.1970 | 40 | 0.7961 | 1.0945 | 1.0877 | 0.0814 |
|
400 |
+
| 0.2463 | 50 | 0.9882 | 1.0950 | 1.0806 | 0.0840 |
|
401 |
+
| 0.2956 | 60 | 0.7814 | 1.0873 | 1.0711 | 0.0681 |
|
402 |
+
| 0.3448 | 70 | 0.6678 | 1.0829 | 1.0673 | 0.0504 |
|
403 |
+
| 0.3941 | 80 | 0.7669 | 1.0771 | 1.0638 | 0.0501 |
|
404 |
+
| 0.4433 | 90 | 0.9718 | 1.0704 | 1.0517 | 0.0482 |
|
405 |
+
| 0.4926 | 100 | 0.8494 | 1.0609 | 1.0388 | 0.0526 |
|
406 |
+
| 0.5419 | 110 | 0.745 | 1.0631 | 1.0285 | 0.0527 |
|
407 |
+
| 0.5911 | 120 | 0.6416 | 1.0564 | 1.0148 | 0.0588 |
|
408 |
+
| 0.6404 | 130 | 1.0331 | 1.0504 | 1.0026 | 0.0627 |
|
409 |
+
| 0.6897 | 140 | 0.8305 | 1.0417 | 1.0023 | 0.0664 |
|
410 |
+
| 0.7389 | 150 | 0.7362 | 1.0282 | 0.9937 | 0.0672 |
|
411 |
+
| 0.7882 | 160 | 0.7164 | 1.0288 | 0.9930 | 0.0688 |
|
412 |
+
| 0.8374 | 170 | 0.8217 | 1.0264 | 0.9819 | 0.0677 |
|
413 |
+
| 0.8867 | 180 | 0.9046 | 1.0200 | 0.9734 | 0.0742 |
|
414 |
+
| 0.9360 | 190 | 0.5327 | 1.0221 | 0.9764 | 0.0698 |
|
415 |
+
| 0.9852 | 200 | 0.8974 | 1.0233 | 0.9776 | 0.0691 |
|
416 |
+
|
417 |
+
|
418 |
+
### Environmental Impact
|
419 |
+
Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
|
420 |
+
- **Carbon Emitted**: 0.018 kg of CO2
|
421 |
+
- **Hours Used**: 0.141 hours
|
422 |
+
|
423 |
+
### Training Hardware
|
424 |
+
- **On Cloud**: No
|
425 |
+
- **GPU Model**: 1 x NVIDIA GeForce RTX 3090
|
426 |
+
- **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K
|
427 |
+
- **RAM Size**: 31.78 GB
|
428 |
+
|
429 |
+
### Framework Versions
|
430 |
+
- Python: 3.11.6
|
431 |
+
- Sentence Transformers: 2.7.0.dev0
|
432 |
+
- Transformers: 4.39.3
|
433 |
+
- PyTorch: 2.1.0+cu121
|
434 |
+
- Accelerate: 0.26.1
|
435 |
+
- Datasets: 2.18.0
|
436 |
+
- Tokenizers: 0.15.2
|
437 |
+
|
438 |
+
## Citation
|
439 |
+
|
440 |
+
### BibTeX
|
441 |
+
#### Sentence Transformers
|
442 |
+
```bibtex
|
443 |
+
@inproceedings{reimers-2019-sentence-bert,
|
444 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
445 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
446 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
447 |
+
month = "11",
|
448 |
+
year = "2019",
|
449 |
+
publisher = "Association for Computational Linguistics",
|
450 |
+
url = "https://arxiv.org/abs/1908.10084",
|
451 |
+
}
|
452 |
+
```
|
453 |
+
|
454 |
+
<!--
|
455 |
+
## Glossary
|
456 |
+
|
457 |
+
*Clearly define terms in order to be accessible across audiences.*
|
458 |
+
-->
|
459 |
+
|
460 |
+
<!--
|
461 |
+
## Model Card Authors
|
462 |
+
|
463 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
464 |
+
-->
|
465 |
+
|
466 |
+
<!--
|
467 |
+
## Model Card Contact
|
468 |
+
|
469 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
470 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/mpnet-base",
|
3 |
+
"architectures": [
|
4 |
+
"MPNetModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-05,
|
15 |
+
"max_position_embeddings": 514,
|
16 |
+
"model_type": "mpnet",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 12,
|
19 |
+
"pad_token_id": 1,
|
20 |
+
"relative_attention_num_buckets": 32,
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.39.3",
|
23 |
+
"vocab_size": 30527
|
24 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "2.7.0.dev0",
|
4 |
+
"transformers": "4.39.3",
|
5 |
+
"pytorch": "2.1.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null
|
9 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3cb8b37cb903e8fff0694a014f7a025675929a40ee90b9d5f887df4530a281e
|
3 |
+
size 437967672
|
modules.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"idx": 0,
|
4 |
+
"name": "0",
|
5 |
+
"path": "",
|
6 |
+
"type": "sentence_transformers.models.Transformer"
|
7 |
+
},
|
8 |
+
{
|
9 |
+
"idx": 1,
|
10 |
+
"name": "1",
|
11 |
+
"path": "1_Pooling",
|
12 |
+
"type": "sentence_transformers.models.Pooling"
|
13 |
+
}
|
14 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 384,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"cls_token": {
|
10 |
+
"content": "<s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"eos_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"mask_token": {
|
24 |
+
"content": "<mask>",
|
25 |
+
"lstrip": true,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"pad_token": {
|
31 |
+
"content": "<pad>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
},
|
37 |
+
"sep_token": {
|
38 |
+
"content": "</s>",
|
39 |
+
"lstrip": false,
|
40 |
+
"normalized": true,
|
41 |
+
"rstrip": false,
|
42 |
+
"single_word": false
|
43 |
+
},
|
44 |
+
"unk_token": {
|
45 |
+
"content": "[UNK]",
|
46 |
+
"lstrip": false,
|
47 |
+
"normalized": false,
|
48 |
+
"rstrip": false,
|
49 |
+
"single_word": false
|
50 |
+
}
|
51 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<s>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<pad>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<unk>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": true,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"104": {
|
36 |
+
"content": "[UNK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"30526": {
|
44 |
+
"content": "<mask>",
|
45 |
+
"lstrip": true,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"bos_token": "<s>",
|
53 |
+
"clean_up_tokenization_spaces": true,
|
54 |
+
"cls_token": "<s>",
|
55 |
+
"do_lower_case": true,
|
56 |
+
"eos_token": "</s>",
|
57 |
+
"mask_token": "<mask>",
|
58 |
+
"model_max_length": 384,
|
59 |
+
"pad_token": "<pad>",
|
60 |
+
"sep_token": "</s>",
|
61 |
+
"strip_accents": null,
|
62 |
+
"tokenize_chinese_chars": true,
|
63 |
+
"tokenizer_class": "MPNetTokenizer",
|
64 |
+
"unk_token": "[UNK]"
|
65 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|