gavinqiangli
commited on
Commit
•
d3fd1f2
1
Parent(s):
bc58d2d
Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +10 -0
- README.md +566 -0
- config.json +26 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +62 -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,566 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: google-bert/bert-base-uncased
|
3 |
+
library_name: sentence-transformers
|
4 |
+
metrics:
|
5 |
+
- cosine_accuracy
|
6 |
+
- cosine_accuracy_threshold
|
7 |
+
- cosine_f1
|
8 |
+
- cosine_f1_threshold
|
9 |
+
- cosine_precision
|
10 |
+
- cosine_recall
|
11 |
+
- cosine_ap
|
12 |
+
- dot_accuracy
|
13 |
+
- dot_accuracy_threshold
|
14 |
+
- dot_f1
|
15 |
+
- dot_f1_threshold
|
16 |
+
- dot_precision
|
17 |
+
- dot_recall
|
18 |
+
- dot_ap
|
19 |
+
- manhattan_accuracy
|
20 |
+
- manhattan_accuracy_threshold
|
21 |
+
- manhattan_f1
|
22 |
+
- manhattan_f1_threshold
|
23 |
+
- manhattan_precision
|
24 |
+
- manhattan_recall
|
25 |
+
- manhattan_ap
|
26 |
+
- euclidean_accuracy
|
27 |
+
- euclidean_accuracy_threshold
|
28 |
+
- euclidean_f1
|
29 |
+
- euclidean_f1_threshold
|
30 |
+
- euclidean_precision
|
31 |
+
- euclidean_recall
|
32 |
+
- euclidean_ap
|
33 |
+
- max_accuracy
|
34 |
+
- max_accuracy_threshold
|
35 |
+
- max_f1
|
36 |
+
- max_f1_threshold
|
37 |
+
- max_precision
|
38 |
+
- max_recall
|
39 |
+
- max_ap
|
40 |
+
pipeline_tag: sentence-similarity
|
41 |
+
tags:
|
42 |
+
- sentence-transformers
|
43 |
+
- sentence-similarity
|
44 |
+
- feature-extraction
|
45 |
+
- generated_from_trainer
|
46 |
+
- dataset_size:103663
|
47 |
+
- loss:MultipleNegativesRankingLoss
|
48 |
+
widget:
|
49 |
+
- source_sentence: How much native Icelandic and advanced Icelandic learners can read
|
50 |
+
and understand Old Norse?
|
51 |
+
sentences:
|
52 |
+
- What are the best answers for "Why should I hire you?"in a cool way?
|
53 |
+
- Are girls shy in expressing their feelings?
|
54 |
+
- If I learn Icelandic can I understand old norse texts?
|
55 |
+
- source_sentence: Where can I get quality assistance for budget conveyancing across
|
56 |
+
the Sydney?
|
57 |
+
sentences:
|
58 |
+
- What are the possible options for India to deal with Uri terror attack?
|
59 |
+
- What is the intended purpose of philosophy?
|
60 |
+
- Where can I get quality assistance in Sydney for any property transaction?
|
61 |
+
- source_sentence: What are some of the best IAS coaching institutions in Mumbai?
|
62 |
+
sentences:
|
63 |
+
- What are best IAS coaching institutes in Mumbai?
|
64 |
+
- Do vampires really exist?
|
65 |
+
- What do most women feel during sex?
|
66 |
+
- source_sentence: Is petroleum engineering still a good major?
|
67 |
+
sentences:
|
68 |
+
- What are some of the best sex stories?
|
69 |
+
- Can I clear CAT in 4.5 months?
|
70 |
+
- What is the future of petroleum engineering graduating in 2020?
|
71 |
+
- source_sentence: How can the drive from Edmonton to Auckland be described, and how
|
72 |
+
do these cities' attractions compare to those in Vancouver?
|
73 |
+
sentences:
|
74 |
+
- How can the drive from Edmonton to Auckland be described, and how does the history
|
75 |
+
of these cities compare and contrast to the history of Vancouver?
|
76 |
+
- What are the best hashtags to use as a photographer on instagram?
|
77 |
+
- Which optional subjects can I choose for the IAS exam?
|
78 |
+
model-index:
|
79 |
+
- name: SentenceTransformer based on google-bert/bert-base-uncased
|
80 |
+
results:
|
81 |
+
- task:
|
82 |
+
type: binary-classification
|
83 |
+
name: Binary Classification
|
84 |
+
dataset:
|
85 |
+
name: Unknown
|
86 |
+
type: unknown
|
87 |
+
metrics:
|
88 |
+
- type: cosine_accuracy
|
89 |
+
value: 0.7643828947012523
|
90 |
+
name: Cosine Accuracy
|
91 |
+
- type: cosine_accuracy_threshold
|
92 |
+
value: 0.8147265911102295
|
93 |
+
name: Cosine Accuracy Threshold
|
94 |
+
- type: cosine_f1
|
95 |
+
value: 0.6959193470955354
|
96 |
+
name: Cosine F1
|
97 |
+
- type: cosine_f1_threshold
|
98 |
+
value: 0.7402496337890625
|
99 |
+
name: Cosine F1 Threshold
|
100 |
+
- type: cosine_precision
|
101 |
+
value: 0.5945532101060921
|
102 |
+
name: Cosine Precision
|
103 |
+
- type: cosine_recall
|
104 |
+
value: 0.838953622964735
|
105 |
+
name: Cosine Recall
|
106 |
+
- type: cosine_ap
|
107 |
+
value: 0.7112611713824615
|
108 |
+
name: Cosine Ap
|
109 |
+
- type: dot_accuracy
|
110 |
+
value: 0.7399583457304374
|
111 |
+
name: Dot Accuracy
|
112 |
+
- type: dot_accuracy_threshold
|
113 |
+
value: 153.5009765625
|
114 |
+
name: Dot Accuracy Threshold
|
115 |
+
- type: dot_f1
|
116 |
+
value: 0.6710917251406536
|
117 |
+
name: Dot F1
|
118 |
+
- type: dot_f1_threshold
|
119 |
+
value: 133.23265075683594
|
120 |
+
name: Dot F1 Threshold
|
121 |
+
- type: dot_precision
|
122 |
+
value: 0.5683387761657477
|
123 |
+
name: Dot Precision
|
124 |
+
- type: dot_recall
|
125 |
+
value: 0.8191990122694652
|
126 |
+
name: Dot Recall
|
127 |
+
- type: dot_ap
|
128 |
+
value: 0.6542447011722929
|
129 |
+
name: Dot Ap
|
130 |
+
- type: manhattan_accuracy
|
131 |
+
value: 0.7665197046333613
|
132 |
+
name: Manhattan Accuracy
|
133 |
+
- type: manhattan_accuracy_threshold
|
134 |
+
value: 176.4288787841797
|
135 |
+
name: Manhattan Accuracy Threshold
|
136 |
+
- type: manhattan_f1
|
137 |
+
value: 0.6972882533068157
|
138 |
+
name: Manhattan F1
|
139 |
+
- type: manhattan_f1_threshold
|
140 |
+
value: 218.96762084960938
|
141 |
+
name: Manhattan F1 Threshold
|
142 |
+
- type: manhattan_precision
|
143 |
+
value: 0.590020301314243
|
144 |
+
name: Manhattan Precision
|
145 |
+
- type: manhattan_recall
|
146 |
+
value: 0.8522262520256193
|
147 |
+
name: Manhattan Recall
|
148 |
+
- type: manhattan_ap
|
149 |
+
value: 0.7109056366977289
|
150 |
+
name: Manhattan Ap
|
151 |
+
- type: euclidean_accuracy
|
152 |
+
value: 0.7665197046333613
|
153 |
+
name: Euclidean Accuracy
|
154 |
+
- type: euclidean_accuracy_threshold
|
155 |
+
value: 8.092199325561523
|
156 |
+
name: Euclidean Accuracy Threshold
|
157 |
+
- type: euclidean_f1
|
158 |
+
value: 0.6970045347129081
|
159 |
+
name: Euclidean F1
|
160 |
+
- type: euclidean_f1_threshold
|
161 |
+
value: 9.794208526611328
|
162 |
+
name: Euclidean F1 Threshold
|
163 |
+
- type: euclidean_precision
|
164 |
+
value: 0.5945518932171071
|
165 |
+
name: Euclidean Precision
|
166 |
+
- type: euclidean_recall
|
167 |
+
value: 0.8421174473338993
|
168 |
+
name: Euclidean Recall
|
169 |
+
- type: euclidean_ap
|
170 |
+
value: 0.7109417385930392
|
171 |
+
name: Euclidean Ap
|
172 |
+
- type: max_accuracy
|
173 |
+
value: 0.7665197046333613
|
174 |
+
name: Max Accuracy
|
175 |
+
- type: max_accuracy_threshold
|
176 |
+
value: 176.4288787841797
|
177 |
+
name: Max Accuracy Threshold
|
178 |
+
- type: max_f1
|
179 |
+
value: 0.6972882533068157
|
180 |
+
name: Max F1
|
181 |
+
- type: max_f1_threshold
|
182 |
+
value: 218.96762084960938
|
183 |
+
name: Max F1 Threshold
|
184 |
+
- type: max_precision
|
185 |
+
value: 0.5945532101060921
|
186 |
+
name: Max Precision
|
187 |
+
- type: max_recall
|
188 |
+
value: 0.8522262520256193
|
189 |
+
name: Max Recall
|
190 |
+
- type: max_ap
|
191 |
+
value: 0.7112611713824615
|
192 |
+
name: Max Ap
|
193 |
+
---
|
194 |
+
|
195 |
+
# SentenceTransformer based on google-bert/bert-base-uncased
|
196 |
+
|
197 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased). 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.
|
198 |
+
|
199 |
+
## Model Details
|
200 |
+
|
201 |
+
### Model Description
|
202 |
+
- **Model Type:** Sentence Transformer
|
203 |
+
- **Base model:** [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) <!-- at revision 86b5e0934494bd15c9632b12f734a8a67f723594 -->
|
204 |
+
- **Maximum Sequence Length:** 128 tokens
|
205 |
+
- **Output Dimensionality:** 768 tokens
|
206 |
+
- **Similarity Function:** Cosine Similarity
|
207 |
+
<!-- - **Training Dataset:** Unknown -->
|
208 |
+
<!-- - **Language:** Unknown -->
|
209 |
+
<!-- - **License:** Unknown -->
|
210 |
+
|
211 |
+
### Model Sources
|
212 |
+
|
213 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
214 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
215 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
216 |
+
|
217 |
+
### Full Model Architecture
|
218 |
+
|
219 |
+
```
|
220 |
+
SentenceTransformer(
|
221 |
+
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
|
222 |
+
(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})
|
223 |
+
)
|
224 |
+
```
|
225 |
+
|
226 |
+
## Usage
|
227 |
+
|
228 |
+
### Direct Usage (Sentence Transformers)
|
229 |
+
|
230 |
+
First install the Sentence Transformers library:
|
231 |
+
|
232 |
+
```bash
|
233 |
+
pip install -U sentence-transformers
|
234 |
+
```
|
235 |
+
|
236 |
+
Then you can load this model and run inference.
|
237 |
+
```python
|
238 |
+
from sentence_transformers import SentenceTransformer
|
239 |
+
|
240 |
+
# Download from the 🤗 Hub
|
241 |
+
model = SentenceTransformer("gavinqiangli/my-awesome-bi-encoder")
|
242 |
+
# Run inference
|
243 |
+
sentences = [
|
244 |
+
"How can the drive from Edmonton to Auckland be described, and how do these cities' attractions compare to those in Vancouver?",
|
245 |
+
'How can the drive from Edmonton to Auckland be described, and how does the history of these cities compare and contrast to the history of Vancouver?',
|
246 |
+
'Which optional subjects can I choose for the IAS exam?',
|
247 |
+
]
|
248 |
+
embeddings = model.encode(sentences)
|
249 |
+
print(embeddings.shape)
|
250 |
+
# [3, 768]
|
251 |
+
|
252 |
+
# Get the similarity scores for the embeddings
|
253 |
+
similarities = model.similarity(embeddings, embeddings)
|
254 |
+
print(similarities.shape)
|
255 |
+
# [3, 3]
|
256 |
+
```
|
257 |
+
|
258 |
+
<!--
|
259 |
+
### Direct Usage (Transformers)
|
260 |
+
|
261 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
262 |
+
|
263 |
+
</details>
|
264 |
+
-->
|
265 |
+
|
266 |
+
<!--
|
267 |
+
### Downstream Usage (Sentence Transformers)
|
268 |
+
|
269 |
+
You can finetune this model on your own dataset.
|
270 |
+
|
271 |
+
<details><summary>Click to expand</summary>
|
272 |
+
|
273 |
+
</details>
|
274 |
+
-->
|
275 |
+
|
276 |
+
<!--
|
277 |
+
### Out-of-Scope Use
|
278 |
+
|
279 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
280 |
+
-->
|
281 |
+
|
282 |
+
## Evaluation
|
283 |
+
|
284 |
+
### Metrics
|
285 |
+
|
286 |
+
#### Binary Classification
|
287 |
+
|
288 |
+
* Evaluated with [<code>BinaryClassificationEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
|
289 |
+
|
290 |
+
| Metric | Value |
|
291 |
+
|:-----------------------------|:-----------|
|
292 |
+
| cosine_accuracy | 0.7644 |
|
293 |
+
| cosine_accuracy_threshold | 0.8147 |
|
294 |
+
| cosine_f1 | 0.6959 |
|
295 |
+
| cosine_f1_threshold | 0.7402 |
|
296 |
+
| cosine_precision | 0.5946 |
|
297 |
+
| cosine_recall | 0.839 |
|
298 |
+
| cosine_ap | 0.7113 |
|
299 |
+
| dot_accuracy | 0.74 |
|
300 |
+
| dot_accuracy_threshold | 153.501 |
|
301 |
+
| dot_f1 | 0.6711 |
|
302 |
+
| dot_f1_threshold | 133.2327 |
|
303 |
+
| dot_precision | 0.5683 |
|
304 |
+
| dot_recall | 0.8192 |
|
305 |
+
| dot_ap | 0.6542 |
|
306 |
+
| manhattan_accuracy | 0.7665 |
|
307 |
+
| manhattan_accuracy_threshold | 176.4289 |
|
308 |
+
| manhattan_f1 | 0.6973 |
|
309 |
+
| manhattan_f1_threshold | 218.9676 |
|
310 |
+
| manhattan_precision | 0.59 |
|
311 |
+
| manhattan_recall | 0.8522 |
|
312 |
+
| manhattan_ap | 0.7109 |
|
313 |
+
| euclidean_accuracy | 0.7665 |
|
314 |
+
| euclidean_accuracy_threshold | 8.0922 |
|
315 |
+
| euclidean_f1 | 0.697 |
|
316 |
+
| euclidean_f1_threshold | 9.7942 |
|
317 |
+
| euclidean_precision | 0.5946 |
|
318 |
+
| euclidean_recall | 0.8421 |
|
319 |
+
| euclidean_ap | 0.7109 |
|
320 |
+
| max_accuracy | 0.7665 |
|
321 |
+
| max_accuracy_threshold | 176.4289 |
|
322 |
+
| max_f1 | 0.6973 |
|
323 |
+
| max_f1_threshold | 218.9676 |
|
324 |
+
| max_precision | 0.5946 |
|
325 |
+
| max_recall | 0.8522 |
|
326 |
+
| **max_ap** | **0.7113** |
|
327 |
+
|
328 |
+
<!--
|
329 |
+
## Bias, Risks and Limitations
|
330 |
+
|
331 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
332 |
+
-->
|
333 |
+
|
334 |
+
<!--
|
335 |
+
### Recommendations
|
336 |
+
|
337 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
338 |
+
-->
|
339 |
+
|
340 |
+
## Training Details
|
341 |
+
|
342 |
+
### Training Dataset
|
343 |
+
|
344 |
+
#### Unnamed Dataset
|
345 |
+
|
346 |
+
|
347 |
+
* Size: 103,663 training samples
|
348 |
+
* Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
|
349 |
+
* Approximate statistics based on the first 1000 samples:
|
350 |
+
| | sentence_0 | sentence_1 | label |
|
351 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------|
|
352 |
+
| type | string | string | int |
|
353 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 13.82 tokens</li><li>max: 41 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 13.87 tokens</li><li>max: 44 tokens</li></ul> | <ul><li>0: ~4.80%</li><li>1: ~95.20%</li></ul> |
|
354 |
+
* Samples:
|
355 |
+
| sentence_0 | sentence_1 | label |
|
356 |
+
|:-------------------------------------------------------------------------------------|:---------------------------------------------------------|:---------------|
|
357 |
+
| <code>Are Jewish people the most intelligent in the universe?</code> | <code>Why are Jewish people so intelligent?</code> | <code>1</code> |
|
358 |
+
| <code>How do I become a good lawyer? What are the qualities of a good lawyer?</code> | <code>How can someone become a successful lawyer?</code> | <code>1</code> |
|
359 |
+
| <code>Why is China going to the Moon?</code> | <code>What does China want with the moon?</code> | <code>1</code> |
|
360 |
+
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
361 |
+
```json
|
362 |
+
{
|
363 |
+
"scale": 20.0,
|
364 |
+
"similarity_fct": "cos_sim"
|
365 |
+
}
|
366 |
+
```
|
367 |
+
|
368 |
+
### Training Hyperparameters
|
369 |
+
#### Non-Default Hyperparameters
|
370 |
+
|
371 |
+
- `eval_strategy`: steps
|
372 |
+
- `per_device_train_batch_size`: 16
|
373 |
+
- `per_device_eval_batch_size`: 16
|
374 |
+
- `num_train_epochs`: 1
|
375 |
+
- `multi_dataset_batch_sampler`: round_robin
|
376 |
+
|
377 |
+
#### All Hyperparameters
|
378 |
+
<details><summary>Click to expand</summary>
|
379 |
+
|
380 |
+
- `overwrite_output_dir`: False
|
381 |
+
- `do_predict`: False
|
382 |
+
- `eval_strategy`: steps
|
383 |
+
- `prediction_loss_only`: True
|
384 |
+
- `per_device_train_batch_size`: 16
|
385 |
+
- `per_device_eval_batch_size`: 16
|
386 |
+
- `per_gpu_train_batch_size`: None
|
387 |
+
- `per_gpu_eval_batch_size`: None
|
388 |
+
- `gradient_accumulation_steps`: 1
|
389 |
+
- `eval_accumulation_steps`: None
|
390 |
+
- `torch_empty_cache_steps`: None
|
391 |
+
- `learning_rate`: 5e-05
|
392 |
+
- `weight_decay`: 0.0
|
393 |
+
- `adam_beta1`: 0.9
|
394 |
+
- `adam_beta2`: 0.999
|
395 |
+
- `adam_epsilon`: 1e-08
|
396 |
+
- `max_grad_norm`: 1
|
397 |
+
- `num_train_epochs`: 1
|
398 |
+
- `max_steps`: -1
|
399 |
+
- `lr_scheduler_type`: linear
|
400 |
+
- `lr_scheduler_kwargs`: {}
|
401 |
+
- `warmup_ratio`: 0.0
|
402 |
+
- `warmup_steps`: 0
|
403 |
+
- `log_level`: passive
|
404 |
+
- `log_level_replica`: warning
|
405 |
+
- `log_on_each_node`: True
|
406 |
+
- `logging_nan_inf_filter`: True
|
407 |
+
- `save_safetensors`: True
|
408 |
+
- `save_on_each_node`: False
|
409 |
+
- `save_only_model`: False
|
410 |
+
- `restore_callback_states_from_checkpoint`: False
|
411 |
+
- `no_cuda`: False
|
412 |
+
- `use_cpu`: False
|
413 |
+
- `use_mps_device`: False
|
414 |
+
- `seed`: 42
|
415 |
+
- `data_seed`: None
|
416 |
+
- `jit_mode_eval`: False
|
417 |
+
- `use_ipex`: False
|
418 |
+
- `bf16`: False
|
419 |
+
- `fp16`: False
|
420 |
+
- `fp16_opt_level`: O1
|
421 |
+
- `half_precision_backend`: auto
|
422 |
+
- `bf16_full_eval`: False
|
423 |
+
- `fp16_full_eval`: False
|
424 |
+
- `tf32`: None
|
425 |
+
- `local_rank`: 0
|
426 |
+
- `ddp_backend`: None
|
427 |
+
- `tpu_num_cores`: None
|
428 |
+
- `tpu_metrics_debug`: False
|
429 |
+
- `debug`: []
|
430 |
+
- `dataloader_drop_last`: False
|
431 |
+
- `dataloader_num_workers`: 0
|
432 |
+
- `dataloader_prefetch_factor`: None
|
433 |
+
- `past_index`: -1
|
434 |
+
- `disable_tqdm`: False
|
435 |
+
- `remove_unused_columns`: True
|
436 |
+
- `label_names`: None
|
437 |
+
- `load_best_model_at_end`: False
|
438 |
+
- `ignore_data_skip`: False
|
439 |
+
- `fsdp`: []
|
440 |
+
- `fsdp_min_num_params`: 0
|
441 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
442 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
443 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
444 |
+
- `deepspeed`: None
|
445 |
+
- `label_smoothing_factor`: 0.0
|
446 |
+
- `optim`: adamw_torch
|
447 |
+
- `optim_args`: None
|
448 |
+
- `adafactor`: False
|
449 |
+
- `group_by_length`: False
|
450 |
+
- `length_column_name`: length
|
451 |
+
- `ddp_find_unused_parameters`: None
|
452 |
+
- `ddp_bucket_cap_mb`: None
|
453 |
+
- `ddp_broadcast_buffers`: False
|
454 |
+
- `dataloader_pin_memory`: True
|
455 |
+
- `dataloader_persistent_workers`: False
|
456 |
+
- `skip_memory_metrics`: True
|
457 |
+
- `use_legacy_prediction_loop`: False
|
458 |
+
- `push_to_hub`: False
|
459 |
+
- `resume_from_checkpoint`: None
|
460 |
+
- `hub_model_id`: None
|
461 |
+
- `hub_strategy`: every_save
|
462 |
+
- `hub_private_repo`: False
|
463 |
+
- `hub_always_push`: False
|
464 |
+
- `gradient_checkpointing`: False
|
465 |
+
- `gradient_checkpointing_kwargs`: None
|
466 |
+
- `include_inputs_for_metrics`: False
|
467 |
+
- `eval_do_concat_batches`: True
|
468 |
+
- `fp16_backend`: auto
|
469 |
+
- `push_to_hub_model_id`: None
|
470 |
+
- `push_to_hub_organization`: None
|
471 |
+
- `mp_parameters`:
|
472 |
+
- `auto_find_batch_size`: False
|
473 |
+
- `full_determinism`: False
|
474 |
+
- `torchdynamo`: None
|
475 |
+
- `ray_scope`: last
|
476 |
+
- `ddp_timeout`: 1800
|
477 |
+
- `torch_compile`: False
|
478 |
+
- `torch_compile_backend`: None
|
479 |
+
- `torch_compile_mode`: None
|
480 |
+
- `dispatch_batches`: None
|
481 |
+
- `split_batches`: None
|
482 |
+
- `include_tokens_per_second`: False
|
483 |
+
- `include_num_input_tokens_seen`: False
|
484 |
+
- `neftune_noise_alpha`: None
|
485 |
+
- `optim_target_modules`: None
|
486 |
+
- `batch_eval_metrics`: False
|
487 |
+
- `eval_on_start`: False
|
488 |
+
- `eval_use_gather_object`: False
|
489 |
+
- `batch_sampler`: batch_sampler
|
490 |
+
- `multi_dataset_batch_sampler`: round_robin
|
491 |
+
|
492 |
+
</details>
|
493 |
+
|
494 |
+
### Training Logs
|
495 |
+
| Epoch | Step | Training Loss | max_ap |
|
496 |
+
|:------:|:----:|:-------------:|:------:|
|
497 |
+
| 0.0772 | 500 | 0.0796 | - |
|
498 |
+
| 0.1543 | 1000 | 0.0205 | 0.6878 |
|
499 |
+
| 0.2315 | 1500 | 0.0197 | - |
|
500 |
+
| 0.3087 | 2000 | 0.0201 | 0.6864 |
|
501 |
+
| 0.3859 | 2500 | 0.0185 | - |
|
502 |
+
| 0.4630 | 3000 | 0.0161 | 0.6933 |
|
503 |
+
| 0.5402 | 3500 | 0.0163 | - |
|
504 |
+
| 0.6174 | 4000 | 0.0172 | 0.7089 |
|
505 |
+
| 0.6946 | 4500 | 0.0172 | - |
|
506 |
+
| 0.7717 | 5000 | 0.0143 | 0.7072 |
|
507 |
+
| 0.8489 | 5500 | 0.0129 | - |
|
508 |
+
| 0.9261 | 6000 | 0.0124 | 0.7112 |
|
509 |
+
| 1.0 | 6479 | - | 0.7113 |
|
510 |
+
|
511 |
+
|
512 |
+
### Framework Versions
|
513 |
+
- Python: 3.10.12
|
514 |
+
- Sentence Transformers: 3.2.1
|
515 |
+
- Transformers: 4.44.2
|
516 |
+
- PyTorch: 2.5.0+cu121
|
517 |
+
- Accelerate: 0.34.2
|
518 |
+
- Datasets: 3.1.0
|
519 |
+
- Tokenizers: 0.19.1
|
520 |
+
|
521 |
+
## Citation
|
522 |
+
|
523 |
+
### BibTeX
|
524 |
+
|
525 |
+
#### Sentence Transformers
|
526 |
+
```bibtex
|
527 |
+
@inproceedings{reimers-2019-sentence-bert,
|
528 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
529 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
530 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
531 |
+
month = "11",
|
532 |
+
year = "2019",
|
533 |
+
publisher = "Association for Computational Linguistics",
|
534 |
+
url = "https://arxiv.org/abs/1908.10084",
|
535 |
+
}
|
536 |
+
```
|
537 |
+
|
538 |
+
#### MultipleNegativesRankingLoss
|
539 |
+
```bibtex
|
540 |
+
@misc{henderson2017efficient,
|
541 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
542 |
+
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},
|
543 |
+
year={2017},
|
544 |
+
eprint={1705.00652},
|
545 |
+
archivePrefix={arXiv},
|
546 |
+
primaryClass={cs.CL}
|
547 |
+
}
|
548 |
+
```
|
549 |
+
|
550 |
+
<!--
|
551 |
+
## Glossary
|
552 |
+
|
553 |
+
*Clearly define terms in order to be accessible across audiences.*
|
554 |
+
-->
|
555 |
+
|
556 |
+
<!--
|
557 |
+
## Model Card Authors
|
558 |
+
|
559 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
560 |
+
-->
|
561 |
+
|
562 |
+
<!--
|
563 |
+
## Model Card Contact
|
564 |
+
|
565 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
566 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "output/bi-encoder/qqp_cross_domain_bert-base-uncased",
|
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": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 12,
|
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.2.1",
|
4 |
+
"transformers": "4.44.2",
|
5 |
+
"pytorch": "2.5.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:94b2b583f259ec19a4d2d7b5ba5f3e403553a2011e05b803ca99eceb95f98cb4
|
3 |
+
size 437951328
|
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": 128,
|
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,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_lower_case": true,
|
47 |
+
"mask_token": "[MASK]",
|
48 |
+
"max_length": 128,
|
49 |
+
"model_max_length": 128,
|
50 |
+
"pad_to_multiple_of": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"pad_token_type_id": 0,
|
53 |
+
"padding_side": "right",
|
54 |
+
"sep_token": "[SEP]",
|
55 |
+
"stride": 0,
|
56 |
+
"strip_accents": null,
|
57 |
+
"tokenize_chinese_chars": true,
|
58 |
+
"tokenizer_class": "BertTokenizer",
|
59 |
+
"truncation_side": "right",
|
60 |
+
"truncation_strategy": "longest_first",
|
61 |
+
"unk_token": "[UNK]"
|
62 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|