Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +593 -0
- config.json +26 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +64 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 384,
|
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,593 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
3 |
+
datasets: []
|
4 |
+
language: []
|
5 |
+
library_name: sentence-transformers
|
6 |
+
metrics:
|
7 |
+
- cosine_accuracy
|
8 |
+
- cosine_accuracy_threshold
|
9 |
+
- cosine_f1
|
10 |
+
- cosine_f1_threshold
|
11 |
+
- cosine_precision
|
12 |
+
- cosine_recall
|
13 |
+
- cosine_ap
|
14 |
+
- dot_accuracy
|
15 |
+
- dot_accuracy_threshold
|
16 |
+
- dot_f1
|
17 |
+
- dot_f1_threshold
|
18 |
+
- dot_precision
|
19 |
+
- dot_recall
|
20 |
+
- dot_ap
|
21 |
+
- manhattan_accuracy
|
22 |
+
- manhattan_accuracy_threshold
|
23 |
+
- manhattan_f1
|
24 |
+
- manhattan_f1_threshold
|
25 |
+
- manhattan_precision
|
26 |
+
- manhattan_recall
|
27 |
+
- manhattan_ap
|
28 |
+
- euclidean_accuracy
|
29 |
+
- euclidean_accuracy_threshold
|
30 |
+
- euclidean_f1
|
31 |
+
- euclidean_f1_threshold
|
32 |
+
- euclidean_precision
|
33 |
+
- euclidean_recall
|
34 |
+
- euclidean_ap
|
35 |
+
- max_accuracy
|
36 |
+
- max_accuracy_threshold
|
37 |
+
- max_f1
|
38 |
+
- max_f1_threshold
|
39 |
+
- max_precision
|
40 |
+
- max_recall
|
41 |
+
- max_ap
|
42 |
+
pipeline_tag: sentence-similarity
|
43 |
+
tags:
|
44 |
+
- sentence-transformers
|
45 |
+
- sentence-similarity
|
46 |
+
- feature-extraction
|
47 |
+
- generated_from_trainer
|
48 |
+
- dataset_size:216
|
49 |
+
- loss:MultipleNegativesRankingLoss
|
50 |
+
widget:
|
51 |
+
- source_sentence: Sophie why are you pressured?
|
52 |
+
sentences:
|
53 |
+
- Sophie Are you pressured?
|
54 |
+
- Did you place the scarf in the fireplace?
|
55 |
+
- A marked Globe.
|
56 |
+
- source_sentence: Because of the red stain from the dish
|
57 |
+
sentences:
|
58 |
+
- Are you using my slippers?
|
59 |
+
- Do you know this book?
|
60 |
+
- There was a red stain on the dish
|
61 |
+
- source_sentence: Outside
|
62 |
+
sentences:
|
63 |
+
- To grant the wish of having adventure
|
64 |
+
- Let's look inside
|
65 |
+
- Let's go outside
|
66 |
+
- source_sentence: Actually I want a candle
|
67 |
+
sentences:
|
68 |
+
- Is that a cloth on the tree?
|
69 |
+
- Did you have a beef stew for dinner?
|
70 |
+
- Give me a candle
|
71 |
+
- source_sentence: I found a flower pot.
|
72 |
+
sentences:
|
73 |
+
- Last night?
|
74 |
+
- I found flowers.
|
75 |
+
- Do you know this picture?
|
76 |
+
model-index:
|
77 |
+
- name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
|
78 |
+
results:
|
79 |
+
- task:
|
80 |
+
type: binary-classification
|
81 |
+
name: Binary Classification
|
82 |
+
dataset:
|
83 |
+
name: custom arc semantics data
|
84 |
+
type: custom-arc-semantics-data
|
85 |
+
metrics:
|
86 |
+
- type: cosine_accuracy
|
87 |
+
value: 0.9818181818181818
|
88 |
+
name: Cosine Accuracy
|
89 |
+
- type: cosine_accuracy_threshold
|
90 |
+
value: 0.26917901635169983
|
91 |
+
name: Cosine Accuracy Threshold
|
92 |
+
- type: cosine_f1
|
93 |
+
value: 0.9908256880733944
|
94 |
+
name: Cosine F1
|
95 |
+
- type: cosine_f1_threshold
|
96 |
+
value: 0.26917901635169983
|
97 |
+
name: Cosine F1 Threshold
|
98 |
+
- type: cosine_precision
|
99 |
+
value: 1.0
|
100 |
+
name: Cosine Precision
|
101 |
+
- type: cosine_recall
|
102 |
+
value: 0.9818181818181818
|
103 |
+
name: Cosine Recall
|
104 |
+
- type: cosine_ap
|
105 |
+
value: 1.0
|
106 |
+
name: Cosine Ap
|
107 |
+
- type: dot_accuracy
|
108 |
+
value: 0.9818181818181818
|
109 |
+
name: Dot Accuracy
|
110 |
+
- type: dot_accuracy_threshold
|
111 |
+
value: 0.2691790461540222
|
112 |
+
name: Dot Accuracy Threshold
|
113 |
+
- type: dot_f1
|
114 |
+
value: 0.9908256880733944
|
115 |
+
name: Dot F1
|
116 |
+
- type: dot_f1_threshold
|
117 |
+
value: 0.2691790461540222
|
118 |
+
name: Dot F1 Threshold
|
119 |
+
- type: dot_precision
|
120 |
+
value: 1.0
|
121 |
+
name: Dot Precision
|
122 |
+
- type: dot_recall
|
123 |
+
value: 0.9818181818181818
|
124 |
+
name: Dot Recall
|
125 |
+
- type: dot_ap
|
126 |
+
value: 1.0
|
127 |
+
name: Dot Ap
|
128 |
+
- type: manhattan_accuracy
|
129 |
+
value: 0.9818181818181818
|
130 |
+
name: Manhattan Accuracy
|
131 |
+
- type: manhattan_accuracy_threshold
|
132 |
+
value: 18.48493194580078
|
133 |
+
name: Manhattan Accuracy Threshold
|
134 |
+
- type: manhattan_f1
|
135 |
+
value: 0.9908256880733944
|
136 |
+
name: Manhattan F1
|
137 |
+
- type: manhattan_f1_threshold
|
138 |
+
value: 18.48493194580078
|
139 |
+
name: Manhattan F1 Threshold
|
140 |
+
- type: manhattan_precision
|
141 |
+
value: 1.0
|
142 |
+
name: Manhattan Precision
|
143 |
+
- type: manhattan_recall
|
144 |
+
value: 0.9818181818181818
|
145 |
+
name: Manhattan Recall
|
146 |
+
- type: manhattan_ap
|
147 |
+
value: 1.0
|
148 |
+
name: Manhattan Ap
|
149 |
+
- type: euclidean_accuracy
|
150 |
+
value: 0.9818181818181818
|
151 |
+
name: Euclidean Accuracy
|
152 |
+
- type: euclidean_accuracy_threshold
|
153 |
+
value: 1.2088721990585327
|
154 |
+
name: Euclidean Accuracy Threshold
|
155 |
+
- type: euclidean_f1
|
156 |
+
value: 0.9908256880733944
|
157 |
+
name: Euclidean F1
|
158 |
+
- type: euclidean_f1_threshold
|
159 |
+
value: 1.2088721990585327
|
160 |
+
name: Euclidean F1 Threshold
|
161 |
+
- type: euclidean_precision
|
162 |
+
value: 1.0
|
163 |
+
name: Euclidean Precision
|
164 |
+
- type: euclidean_recall
|
165 |
+
value: 0.9818181818181818
|
166 |
+
name: Euclidean Recall
|
167 |
+
- type: euclidean_ap
|
168 |
+
value: 1.0
|
169 |
+
name: Euclidean Ap
|
170 |
+
- type: max_accuracy
|
171 |
+
value: 0.9818181818181818
|
172 |
+
name: Max Accuracy
|
173 |
+
- type: max_accuracy_threshold
|
174 |
+
value: 18.48493194580078
|
175 |
+
name: Max Accuracy Threshold
|
176 |
+
- type: max_f1
|
177 |
+
value: 0.9908256880733944
|
178 |
+
name: Max F1
|
179 |
+
- type: max_f1_threshold
|
180 |
+
value: 18.48493194580078
|
181 |
+
name: Max F1 Threshold
|
182 |
+
- type: max_precision
|
183 |
+
value: 1.0
|
184 |
+
name: Max Precision
|
185 |
+
- type: max_recall
|
186 |
+
value: 0.9818181818181818
|
187 |
+
name: Max Recall
|
188 |
+
- type: max_ap
|
189 |
+
value: 1.0
|
190 |
+
name: Max Ap
|
191 |
+
---
|
192 |
+
|
193 |
+
# SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
|
194 |
+
|
195 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
196 |
+
|
197 |
+
## Model Details
|
198 |
+
|
199 |
+
### Model Description
|
200 |
+
- **Model Type:** Sentence Transformer
|
201 |
+
- **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision 8b3219a92973c328a8e22fadcfa821b5dc75636a -->
|
202 |
+
- **Maximum Sequence Length:** 256 tokens
|
203 |
+
- **Output Dimensionality:** 384 tokens
|
204 |
+
- **Similarity Function:** Cosine Similarity
|
205 |
+
<!-- - **Training Dataset:** Unknown -->
|
206 |
+
<!-- - **Language:** Unknown -->
|
207 |
+
<!-- - **License:** Unknown -->
|
208 |
+
|
209 |
+
### Model Sources
|
210 |
+
|
211 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
212 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
213 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
214 |
+
|
215 |
+
### Full Model Architecture
|
216 |
+
|
217 |
+
```
|
218 |
+
SentenceTransformer(
|
219 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
220 |
+
(1): Pooling({'word_embedding_dimension': 384, '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})
|
221 |
+
(2): Normalize()
|
222 |
+
)
|
223 |
+
```
|
224 |
+
|
225 |
+
## Usage
|
226 |
+
|
227 |
+
### Direct Usage (Sentence Transformers)
|
228 |
+
|
229 |
+
First install the Sentence Transformers library:
|
230 |
+
|
231 |
+
```bash
|
232 |
+
pip install -U sentence-transformers
|
233 |
+
```
|
234 |
+
|
235 |
+
Then you can load this model and run inference.
|
236 |
+
```python
|
237 |
+
from sentence_transformers import SentenceTransformer
|
238 |
+
|
239 |
+
# Download from the 🤗 Hub
|
240 |
+
model = SentenceTransformer("LeoChiuu/all-MiniLM-L6-v2")
|
241 |
+
# Run inference
|
242 |
+
sentences = [
|
243 |
+
'I found a flower pot.',
|
244 |
+
'I found flowers.',
|
245 |
+
'Do you know this picture?',
|
246 |
+
]
|
247 |
+
embeddings = model.encode(sentences)
|
248 |
+
print(embeddings.shape)
|
249 |
+
# [3, 384]
|
250 |
+
|
251 |
+
# Get the similarity scores for the embeddings
|
252 |
+
similarities = model.similarity(embeddings, embeddings)
|
253 |
+
print(similarities.shape)
|
254 |
+
# [3, 3]
|
255 |
+
```
|
256 |
+
|
257 |
+
<!--
|
258 |
+
### Direct Usage (Transformers)
|
259 |
+
|
260 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
261 |
+
|
262 |
+
</details>
|
263 |
+
-->
|
264 |
+
|
265 |
+
<!--
|
266 |
+
### Downstream Usage (Sentence Transformers)
|
267 |
+
|
268 |
+
You can finetune this model on your own dataset.
|
269 |
+
|
270 |
+
<details><summary>Click to expand</summary>
|
271 |
+
|
272 |
+
</details>
|
273 |
+
-->
|
274 |
+
|
275 |
+
<!--
|
276 |
+
### Out-of-Scope Use
|
277 |
+
|
278 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
279 |
+
-->
|
280 |
+
|
281 |
+
## Evaluation
|
282 |
+
|
283 |
+
### Metrics
|
284 |
+
|
285 |
+
#### Binary Classification
|
286 |
+
* Dataset: `custom-arc-semantics-data`
|
287 |
+
* Evaluated with [<code>BinaryClassificationEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
|
288 |
+
|
289 |
+
| Metric | Value |
|
290 |
+
|:-----------------------------|:--------|
|
291 |
+
| cosine_accuracy | 0.9818 |
|
292 |
+
| cosine_accuracy_threshold | 0.2692 |
|
293 |
+
| cosine_f1 | 0.9908 |
|
294 |
+
| cosine_f1_threshold | 0.2692 |
|
295 |
+
| cosine_precision | 1.0 |
|
296 |
+
| cosine_recall | 0.9818 |
|
297 |
+
| cosine_ap | 1.0 |
|
298 |
+
| dot_accuracy | 0.9818 |
|
299 |
+
| dot_accuracy_threshold | 0.2692 |
|
300 |
+
| dot_f1 | 0.9908 |
|
301 |
+
| dot_f1_threshold | 0.2692 |
|
302 |
+
| dot_precision | 1.0 |
|
303 |
+
| dot_recall | 0.9818 |
|
304 |
+
| dot_ap | 1.0 |
|
305 |
+
| manhattan_accuracy | 0.9818 |
|
306 |
+
| manhattan_accuracy_threshold | 18.4849 |
|
307 |
+
| manhattan_f1 | 0.9908 |
|
308 |
+
| manhattan_f1_threshold | 18.4849 |
|
309 |
+
| manhattan_precision | 1.0 |
|
310 |
+
| manhattan_recall | 0.9818 |
|
311 |
+
| manhattan_ap | 1.0 |
|
312 |
+
| euclidean_accuracy | 0.9818 |
|
313 |
+
| euclidean_accuracy_threshold | 1.2089 |
|
314 |
+
| euclidean_f1 | 0.9908 |
|
315 |
+
| euclidean_f1_threshold | 1.2089 |
|
316 |
+
| euclidean_precision | 1.0 |
|
317 |
+
| euclidean_recall | 0.9818 |
|
318 |
+
| euclidean_ap | 1.0 |
|
319 |
+
| max_accuracy | 0.9818 |
|
320 |
+
| max_accuracy_threshold | 18.4849 |
|
321 |
+
| max_f1 | 0.9908 |
|
322 |
+
| max_f1_threshold | 18.4849 |
|
323 |
+
| max_precision | 1.0 |
|
324 |
+
| max_recall | 0.9818 |
|
325 |
+
| **max_ap** | **1.0** |
|
326 |
+
|
327 |
+
<!--
|
328 |
+
## Bias, Risks and Limitations
|
329 |
+
|
330 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
331 |
+
-->
|
332 |
+
|
333 |
+
<!--
|
334 |
+
### Recommendations
|
335 |
+
|
336 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
337 |
+
-->
|
338 |
+
|
339 |
+
## Training Details
|
340 |
+
|
341 |
+
### Training Dataset
|
342 |
+
|
343 |
+
#### Unnamed Dataset
|
344 |
+
|
345 |
+
|
346 |
+
* Size: 216 training samples
|
347 |
+
* Columns: <code>text1</code>, <code>text2</code>, and <code>label</code>
|
348 |
+
* Approximate statistics based on the first 1000 samples:
|
349 |
+
| | text1 | text2 | label |
|
350 |
+
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-----------------------------|
|
351 |
+
| type | string | string | int |
|
352 |
+
| details | <ul><li>min: 3 tokens</li><li>mean: 7.19 tokens</li><li>max: 13 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 7.49 tokens</li><li>max: 13 tokens</li></ul> | <ul><li>1: 100.00%</li></ul> |
|
353 |
+
* Samples:
|
354 |
+
| text1 | text2 | label |
|
355 |
+
|:-------------------------------------------------|:---------------------------------------------------|:---------------|
|
356 |
+
| <code>Let's search inside</code> | <code>Let's look inside</code> | <code>1</code> |
|
357 |
+
| <code>Do you see your scarf in the wagon?</code> | <code>Is your scarf in the wagon?</code> | <code>1</code> |
|
358 |
+
| <code>Scarf on the tree.</code> | <code>Is that a scarf, the one on the tree?</code> | <code>1</code> |
|
359 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
360 |
+
```json
|
361 |
+
{
|
362 |
+
"scale": 20.0,
|
363 |
+
"similarity_fct": "cos_sim"
|
364 |
+
}
|
365 |
+
```
|
366 |
+
|
367 |
+
### Evaluation Dataset
|
368 |
+
|
369 |
+
#### Unnamed Dataset
|
370 |
+
|
371 |
+
|
372 |
+
* Size: 55 evaluation samples
|
373 |
+
* Columns: <code>text1</code>, <code>text2</code>, and <code>label</code>
|
374 |
+
* Approximate statistics based on the first 1000 samples:
|
375 |
+
| | text1 | text2 | label |
|
376 |
+
|:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:-----------------------------|
|
377 |
+
| type | string | string | int |
|
378 |
+
| details | <ul><li>min: 3 tokens</li><li>mean: 7.04 tokens</li><li>max: 12 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 7.55 tokens</li><li>max: 13 tokens</li></ul> | <ul><li>1: 100.00%</li></ul> |
|
379 |
+
* Samples:
|
380 |
+
| text1 | text2 | label |
|
381 |
+
|:---------------------------------|:-----------------------------------|:---------------|
|
382 |
+
| <code>A candle</code> | <code>I want a candle</code> | <code>1</code> |
|
383 |
+
| <code>I did </code> | <code>I did it</code> | <code>1</code> |
|
384 |
+
| <code>When you had dinner</code> | <code>Before cooking dinner</code> | <code>1</code> |
|
385 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
386 |
+
```json
|
387 |
+
{
|
388 |
+
"scale": 20.0,
|
389 |
+
"similarity_fct": "cos_sim"
|
390 |
+
}
|
391 |
+
```
|
392 |
+
|
393 |
+
### Training Hyperparameters
|
394 |
+
#### Non-Default Hyperparameters
|
395 |
+
|
396 |
+
- `eval_strategy`: epoch
|
397 |
+
- `learning_rate`: 2e-05
|
398 |
+
- `num_train_epochs`: 13
|
399 |
+
- `warmup_ratio`: 0.1
|
400 |
+
- `fp16`: True
|
401 |
+
- `batch_sampler`: no_duplicates
|
402 |
+
|
403 |
+
#### All Hyperparameters
|
404 |
+
<details><summary>Click to expand</summary>
|
405 |
+
|
406 |
+
- `overwrite_output_dir`: False
|
407 |
+
- `do_predict`: False
|
408 |
+
- `eval_strategy`: epoch
|
409 |
+
- `prediction_loss_only`: True
|
410 |
+
- `per_device_train_batch_size`: 8
|
411 |
+
- `per_device_eval_batch_size`: 8
|
412 |
+
- `per_gpu_train_batch_size`: None
|
413 |
+
- `per_gpu_eval_batch_size`: None
|
414 |
+
- `gradient_accumulation_steps`: 1
|
415 |
+
- `eval_accumulation_steps`: None
|
416 |
+
- `torch_empty_cache_steps`: None
|
417 |
+
- `learning_rate`: 2e-05
|
418 |
+
- `weight_decay`: 0.0
|
419 |
+
- `adam_beta1`: 0.9
|
420 |
+
- `adam_beta2`: 0.999
|
421 |
+
- `adam_epsilon`: 1e-08
|
422 |
+
- `max_grad_norm`: 1.0
|
423 |
+
- `num_train_epochs`: 13
|
424 |
+
- `max_steps`: -1
|
425 |
+
- `lr_scheduler_type`: linear
|
426 |
+
- `lr_scheduler_kwargs`: {}
|
427 |
+
- `warmup_ratio`: 0.1
|
428 |
+
- `warmup_steps`: 0
|
429 |
+
- `log_level`: passive
|
430 |
+
- `log_level_replica`: warning
|
431 |
+
- `log_on_each_node`: True
|
432 |
+
- `logging_nan_inf_filter`: True
|
433 |
+
- `save_safetensors`: True
|
434 |
+
- `save_on_each_node`: False
|
435 |
+
- `save_only_model`: False
|
436 |
+
- `restore_callback_states_from_checkpoint`: False
|
437 |
+
- `no_cuda`: False
|
438 |
+
- `use_cpu`: False
|
439 |
+
- `use_mps_device`: False
|
440 |
+
- `seed`: 42
|
441 |
+
- `data_seed`: None
|
442 |
+
- `jit_mode_eval`: False
|
443 |
+
- `use_ipex`: False
|
444 |
+
- `bf16`: False
|
445 |
+
- `fp16`: True
|
446 |
+
- `fp16_opt_level`: O1
|
447 |
+
- `half_precision_backend`: auto
|
448 |
+
- `bf16_full_eval`: False
|
449 |
+
- `fp16_full_eval`: False
|
450 |
+
- `tf32`: None
|
451 |
+
- `local_rank`: 0
|
452 |
+
- `ddp_backend`: None
|
453 |
+
- `tpu_num_cores`: None
|
454 |
+
- `tpu_metrics_debug`: False
|
455 |
+
- `debug`: []
|
456 |
+
- `dataloader_drop_last`: False
|
457 |
+
- `dataloader_num_workers`: 0
|
458 |
+
- `dataloader_prefetch_factor`: None
|
459 |
+
- `past_index`: -1
|
460 |
+
- `disable_tqdm`: False
|
461 |
+
- `remove_unused_columns`: True
|
462 |
+
- `label_names`: None
|
463 |
+
- `load_best_model_at_end`: False
|
464 |
+
- `ignore_data_skip`: False
|
465 |
+
- `fsdp`: []
|
466 |
+
- `fsdp_min_num_params`: 0
|
467 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
468 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
469 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
470 |
+
- `deepspeed`: None
|
471 |
+
- `label_smoothing_factor`: 0.0
|
472 |
+
- `optim`: adamw_torch
|
473 |
+
- `optim_args`: None
|
474 |
+
- `adafactor`: False
|
475 |
+
- `group_by_length`: False
|
476 |
+
- `length_column_name`: length
|
477 |
+
- `ddp_find_unused_parameters`: None
|
478 |
+
- `ddp_bucket_cap_mb`: None
|
479 |
+
- `ddp_broadcast_buffers`: False
|
480 |
+
- `dataloader_pin_memory`: True
|
481 |
+
- `dataloader_persistent_workers`: False
|
482 |
+
- `skip_memory_metrics`: True
|
483 |
+
- `use_legacy_prediction_loop`: False
|
484 |
+
- `push_to_hub`: False
|
485 |
+
- `resume_from_checkpoint`: None
|
486 |
+
- `hub_model_id`: None
|
487 |
+
- `hub_strategy`: every_save
|
488 |
+
- `hub_private_repo`: False
|
489 |
+
- `hub_always_push`: False
|
490 |
+
- `gradient_checkpointing`: False
|
491 |
+
- `gradient_checkpointing_kwargs`: None
|
492 |
+
- `include_inputs_for_metrics`: False
|
493 |
+
- `eval_do_concat_batches`: True
|
494 |
+
- `fp16_backend`: auto
|
495 |
+
- `push_to_hub_model_id`: None
|
496 |
+
- `push_to_hub_organization`: None
|
497 |
+
- `mp_parameters`:
|
498 |
+
- `auto_find_batch_size`: False
|
499 |
+
- `full_determinism`: False
|
500 |
+
- `torchdynamo`: None
|
501 |
+
- `ray_scope`: last
|
502 |
+
- `ddp_timeout`: 1800
|
503 |
+
- `torch_compile`: False
|
504 |
+
- `torch_compile_backend`: None
|
505 |
+
- `torch_compile_mode`: None
|
506 |
+
- `dispatch_batches`: None
|
507 |
+
- `split_batches`: None
|
508 |
+
- `include_tokens_per_second`: False
|
509 |
+
- `include_num_input_tokens_seen`: False
|
510 |
+
- `neftune_noise_alpha`: None
|
511 |
+
- `optim_target_modules`: None
|
512 |
+
- `batch_eval_metrics`: False
|
513 |
+
- `eval_on_start`: False
|
514 |
+
- `eval_use_gather_object`: False
|
515 |
+
- `batch_sampler`: no_duplicates
|
516 |
+
- `multi_dataset_batch_sampler`: proportional
|
517 |
+
|
518 |
+
</details>
|
519 |
+
|
520 |
+
### Training Logs
|
521 |
+
| Epoch | Step | Training Loss | loss | custom-arc-semantics-data_max_ap |
|
522 |
+
|:-----:|:----:|:-------------:|:------:|:--------------------------------:|
|
523 |
+
| None | 0 | - | - | 1.0 |
|
524 |
+
| 1.0 | 27 | 0.2251 | 0.1920 | 1.0 |
|
525 |
+
| 2.0 | 54 | 0.1218 | 0.1768 | 1.0 |
|
526 |
+
| 3.0 | 81 | 0.0466 | 0.1644 | 1.0 |
|
527 |
+
| 4.0 | 108 | 0.0231 | 0.1514 | 1.0 |
|
528 |
+
| 5.0 | 135 | 0.0161 | 0.1374 | 1.0 |
|
529 |
+
| 6.0 | 162 | 0.0119 | 0.1339 | 1.0 |
|
530 |
+
| 7.0 | 189 | 0.0091 | 0.1331 | 1.0 |
|
531 |
+
| 8.0 | 216 | 0.0074 | 0.1292 | 1.0 |
|
532 |
+
| 9.0 | 243 | 0.0054 | 0.1265 | 1.0 |
|
533 |
+
| 10.0 | 270 | 0.0059 | 0.1244 | 1.0 |
|
534 |
+
| 11.0 | 297 | 0.0055 | 0.1254 | 1.0 |
|
535 |
+
| 12.0 | 324 | 0.0068 | 0.1236 | 1.0 |
|
536 |
+
| 13.0 | 351 | 0.0035 | 0.1234 | 1.0 |
|
537 |
+
|
538 |
+
|
539 |
+
### Framework Versions
|
540 |
+
- Python: 3.10.14
|
541 |
+
- Sentence Transformers: 3.0.1
|
542 |
+
- Transformers: 4.44.2
|
543 |
+
- PyTorch: 2.4.0+cu121
|
544 |
+
- Accelerate: 0.34.0
|
545 |
+
- Datasets: 2.20.0
|
546 |
+
- Tokenizers: 0.19.1
|
547 |
+
|
548 |
+
## Citation
|
549 |
+
|
550 |
+
### BibTeX
|
551 |
+
|
552 |
+
#### Sentence Transformers
|
553 |
+
```bibtex
|
554 |
+
@inproceedings{reimers-2019-sentence-bert,
|
555 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
556 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
557 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
558 |
+
month = "11",
|
559 |
+
year = "2019",
|
560 |
+
publisher = "Association for Computational Linguistics",
|
561 |
+
url = "https://arxiv.org/abs/1908.10084",
|
562 |
+
}
|
563 |
+
```
|
564 |
+
|
565 |
+
#### MultipleNegativesRankingLoss
|
566 |
+
```bibtex
|
567 |
+
@misc{henderson2017efficient,
|
568 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
569 |
+
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
|
570 |
+
year={2017},
|
571 |
+
eprint={1705.00652},
|
572 |
+
archivePrefix={arXiv},
|
573 |
+
primaryClass={cs.CL}
|
574 |
+
}
|
575 |
+
```
|
576 |
+
|
577 |
+
<!--
|
578 |
+
## Glossary
|
579 |
+
|
580 |
+
*Clearly define terms in order to be accessible across audiences.*
|
581 |
+
-->
|
582 |
+
|
583 |
+
<!--
|
584 |
+
## Model Card Authors
|
585 |
+
|
586 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
587 |
+
-->
|
588 |
+
|
589 |
+
<!--
|
590 |
+
## Model Card Contact
|
591 |
+
|
592 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
593 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"gradient_checkpointing": false,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 384,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 1536,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 6,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.44.2",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 30522
|
26 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.44.2",
|
5 |
+
"pytorch": "2.4.0+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a6cc633b22dd645d5916470915970b032282a71c48bdd15a97c49a86bb8bc83b
|
3 |
+
size 90864192
|
modules.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
{
|
15 |
+
"idx": 2,
|
16 |
+
"name": "2",
|
17 |
+
"path": "2_Normalize",
|
18 |
+
"type": "sentence_transformers.models.Normalize"
|
19 |
+
}
|
20 |
+
]
|
sentence_bert_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_seq_length": 256,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"max_length": 128,
|
50 |
+
"model_max_length": 256,
|
51 |
+
"never_split": null,
|
52 |
+
"pad_to_multiple_of": null,
|
53 |
+
"pad_token": "[PAD]",
|
54 |
+
"pad_token_type_id": 0,
|
55 |
+
"padding_side": "right",
|
56 |
+
"sep_token": "[SEP]",
|
57 |
+
"stride": 0,
|
58 |
+
"strip_accents": null,
|
59 |
+
"tokenize_chinese_chars": true,
|
60 |
+
"tokenizer_class": "BertTokenizer",
|
61 |
+
"truncation_side": "right",
|
62 |
+
"truncation_strategy": "longest_first",
|
63 |
+
"unk_token": "[UNK]"
|
64 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|