Deehan1866
commited on
Commit
•
3b76d79
1
Parent(s):
bc30642
Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +601 -0
- config.json +30 -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 +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +55 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 1024,
|
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,601 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
+
- cosine_accuracy
|
10 |
+
- cosine_accuracy_threshold
|
11 |
+
- cosine_f1
|
12 |
+
- cosine_f1_threshold
|
13 |
+
- cosine_precision
|
14 |
+
- cosine_recall
|
15 |
+
- cosine_ap
|
16 |
+
- dot_accuracy
|
17 |
+
- dot_accuracy_threshold
|
18 |
+
- dot_f1
|
19 |
+
- dot_f1_threshold
|
20 |
+
- dot_precision
|
21 |
+
- dot_recall
|
22 |
+
- dot_ap
|
23 |
+
- manhattan_accuracy
|
24 |
+
- manhattan_accuracy_threshold
|
25 |
+
- manhattan_f1
|
26 |
+
- manhattan_f1_threshold
|
27 |
+
- manhattan_precision
|
28 |
+
- manhattan_recall
|
29 |
+
- manhattan_ap
|
30 |
+
- euclidean_accuracy
|
31 |
+
- euclidean_accuracy_threshold
|
32 |
+
- euclidean_f1
|
33 |
+
- euclidean_f1_threshold
|
34 |
+
- euclidean_precision
|
35 |
+
- euclidean_recall
|
36 |
+
- euclidean_ap
|
37 |
+
- max_accuracy
|
38 |
+
- max_accuracy_threshold
|
39 |
+
- max_f1
|
40 |
+
- max_f1_threshold
|
41 |
+
- max_precision
|
42 |
+
- max_recall
|
43 |
+
- max_ap
|
44 |
+
pipeline_tag: sentence-similarity
|
45 |
+
tags:
|
46 |
+
- sentence-transformers
|
47 |
+
- sentence-similarity
|
48 |
+
- feature-extraction
|
49 |
+
- generated_from_trainer
|
50 |
+
- dataset_size:7004
|
51 |
+
- loss:SoftmaxLoss
|
52 |
+
widget:
|
53 |
+
- source_sentence: Google SEO expert Matt Cutts had a similar experience, of the eight
|
54 |
+
magazines and newspapers Cutts tried to order, he received zero.
|
55 |
+
sentences:
|
56 |
+
- He dissolved the services of her guards and her court attendants and seized an
|
57 |
+
expansive reach of properties belonging to her.
|
58 |
+
- Google SEO expert Matt Cutts had a comparable occurrence, of the eight magazines
|
59 |
+
and newspapers Cutts tried to order, he received zero.
|
60 |
+
- bill's newest solo play, "all over the map", premiered off broadway in april 2016,
|
61 |
+
produced by all for an individual cinema.
|
62 |
+
- source_sentence: Shula said that Namath "beat our blitz" with his fast release,
|
63 |
+
which let him quickly dump the football off to a receiver.
|
64 |
+
sentences:
|
65 |
+
- Shula said that Namath "beat our blitz" with his quick throw, which let him quickly
|
66 |
+
dump the football off to a receiver.
|
67 |
+
- it elects a single component of parliament (mp) by the first past the post system
|
68 |
+
of election.
|
69 |
+
- Matt Groening said that West was one of the most widely known group to ever come
|
70 |
+
to the studio.
|
71 |
+
- source_sentence: When Angel calls out her name, Cordelia suddenly appears from the
|
72 |
+
opposite side of the room saying, "Yep, that chick's in rough shape.
|
73 |
+
sentences:
|
74 |
+
- The ruined row of text, part of the Florida East Coast Railway, was repaired by
|
75 |
+
2014 renewing freight train access to the port.
|
76 |
+
- When Angel calls out her name, Cordelia suddenly appears from the opposite side
|
77 |
+
of the room saying, "Yep, that chick's in approximate form.
|
78 |
+
- Chaplin's films introduced a moderated kind of comedy than the typical Keystone
|
79 |
+
farce, and he developed a large fan base.
|
80 |
+
- source_sentence: The following table shows the distances traversed by National Route
|
81 |
+
11 in each different department, showing cities and towns that it passes by (or
|
82 |
+
near).
|
83 |
+
sentences:
|
84 |
+
- The following table shows the distances traversed by National Route 11 in each
|
85 |
+
separate city authority, showing cities and towns that it passes by (or near).
|
86 |
+
- Similarly, indigenous communities and leaders practice as the main rule of law
|
87 |
+
on local native lands and reserves.
|
88 |
+
- later, sylvan mixed gary numan's albums "replicas" (with numan's previous band
|
89 |
+
tubeway army) and "the quest for instant gratification".
|
90 |
+
- source_sentence: She wants to write about Keima but suffers a major case of writer's
|
91 |
+
block.
|
92 |
+
sentences:
|
93 |
+
- In some countries, new extremist parties on the extreme opposite of left of the
|
94 |
+
political spectrum arose, motivated through issues of immigration, multiculturalism
|
95 |
+
and integration.
|
96 |
+
- specific medical status of movement and the general condition of movement both
|
97 |
+
are conditions under which contradictions can move.
|
98 |
+
- She wants to write about Keima but suffers a huge occurrence of writer's block.
|
99 |
+
model-index:
|
100 |
+
- name: SentenceTransformer based on google/electra-large-discriminator
|
101 |
+
results:
|
102 |
+
- task:
|
103 |
+
type: binary-classification
|
104 |
+
name: Binary Classification
|
105 |
+
dataset:
|
106 |
+
name: quora duplicates dev
|
107 |
+
type: quora-duplicates-dev
|
108 |
+
metrics:
|
109 |
+
- type: cosine_accuracy
|
110 |
+
value: 0.748
|
111 |
+
name: Cosine Accuracy
|
112 |
+
- type: cosine_accuracy_threshold
|
113 |
+
value: 0.9737387895584106
|
114 |
+
name: Cosine Accuracy Threshold
|
115 |
+
- type: cosine_f1
|
116 |
+
value: 0.7604846225535881
|
117 |
+
name: Cosine F1
|
118 |
+
- type: cosine_f1_threshold
|
119 |
+
value: 0.9574624300003052
|
120 |
+
name: Cosine F1 Threshold
|
121 |
+
- type: cosine_precision
|
122 |
+
value: 0.7120418848167539
|
123 |
+
name: Cosine Precision
|
124 |
+
- type: cosine_recall
|
125 |
+
value: 0.816
|
126 |
+
name: Cosine Recall
|
127 |
+
- type: cosine_ap
|
128 |
+
value: 0.786909093121924
|
129 |
+
name: Cosine Ap
|
130 |
+
- type: dot_accuracy
|
131 |
+
value: 0.667
|
132 |
+
name: Dot Accuracy
|
133 |
+
- type: dot_accuracy_threshold
|
134 |
+
value: 275.4551696777344
|
135 |
+
name: Dot Accuracy Threshold
|
136 |
+
- type: dot_f1
|
137 |
+
value: 0.733229329173167
|
138 |
+
name: Dot F1
|
139 |
+
- type: dot_f1_threshold
|
140 |
+
value: 266.14727783203125
|
141 |
+
name: Dot F1 Threshold
|
142 |
+
- type: dot_precision
|
143 |
+
value: 0.6010230179028133
|
144 |
+
name: Dot Precision
|
145 |
+
- type: dot_recall
|
146 |
+
value: 0.94
|
147 |
+
name: Dot Recall
|
148 |
+
- type: dot_ap
|
149 |
+
value: 0.5935392159238977
|
150 |
+
name: Dot Ap
|
151 |
+
- type: manhattan_accuracy
|
152 |
+
value: 0.746
|
153 |
+
name: Manhattan Accuracy
|
154 |
+
- type: manhattan_accuracy_threshold
|
155 |
+
value: 87.73857116699219
|
156 |
+
name: Manhattan Accuracy Threshold
|
157 |
+
- type: manhattan_f1
|
158 |
+
value: 0.7614678899082568
|
159 |
+
name: Manhattan F1
|
160 |
+
- type: manhattan_f1_threshold
|
161 |
+
value: 131.43374633789062
|
162 |
+
name: Manhattan F1 Threshold
|
163 |
+
- type: manhattan_precision
|
164 |
+
value: 0.7033898305084746
|
165 |
+
name: Manhattan Precision
|
166 |
+
- type: manhattan_recall
|
167 |
+
value: 0.83
|
168 |
+
name: Manhattan Recall
|
169 |
+
- type: manhattan_ap
|
170 |
+
value: 0.7904964653279406
|
171 |
+
name: Manhattan Ap
|
172 |
+
- type: euclidean_accuracy
|
173 |
+
value: 0.747
|
174 |
+
name: Euclidean Accuracy
|
175 |
+
- type: euclidean_accuracy_threshold
|
176 |
+
value: 4.5833892822265625
|
177 |
+
name: Euclidean Accuracy Threshold
|
178 |
+
- type: euclidean_f1
|
179 |
+
value: 0.7610121836925962
|
180 |
+
name: Euclidean F1
|
181 |
+
- type: euclidean_f1_threshold
|
182 |
+
value: 5.5540361404418945
|
183 |
+
name: Euclidean F1 Threshold
|
184 |
+
- type: euclidean_precision
|
185 |
+
value: 0.7160493827160493
|
186 |
+
name: Euclidean Precision
|
187 |
+
- type: euclidean_recall
|
188 |
+
value: 0.812
|
189 |
+
name: Euclidean Recall
|
190 |
+
- type: euclidean_ap
|
191 |
+
value: 0.789806008641207
|
192 |
+
name: Euclidean Ap
|
193 |
+
- type: max_accuracy
|
194 |
+
value: 0.748
|
195 |
+
name: Max Accuracy
|
196 |
+
- type: max_accuracy_threshold
|
197 |
+
value: 275.4551696777344
|
198 |
+
name: Max Accuracy Threshold
|
199 |
+
- type: max_f1
|
200 |
+
value: 0.7614678899082568
|
201 |
+
name: Max F1
|
202 |
+
- type: max_f1_threshold
|
203 |
+
value: 266.14727783203125
|
204 |
+
name: Max F1 Threshold
|
205 |
+
- type: max_precision
|
206 |
+
value: 0.7160493827160493
|
207 |
+
name: Max Precision
|
208 |
+
- type: max_recall
|
209 |
+
value: 0.94
|
210 |
+
name: Max Recall
|
211 |
+
- type: max_ap
|
212 |
+
value: 0.7904964653279406
|
213 |
+
name: Max Ap
|
214 |
+
---
|
215 |
+
|
216 |
+
# SentenceTransformer based on google/electra-large-discriminator
|
217 |
+
|
218 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [google/electra-large-discriminator](https://huggingface.co/google/electra-large-discriminator) on the [PiC/phrase_similarity](https://huggingface.co/datasets/PiC/phrase_similarity) dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
219 |
+
|
220 |
+
## Model Details
|
221 |
+
|
222 |
+
### Model Description
|
223 |
+
- **Model Type:** Sentence Transformer
|
224 |
+
- **Base model:** [google/electra-large-discriminator](https://huggingface.co/google/electra-large-discriminator) <!-- at revision c13c3df7efadc2162f42588bd28eb4e187d602a5 -->
|
225 |
+
- **Maximum Sequence Length:** 512 tokens
|
226 |
+
- **Output Dimensionality:** 1024 tokens
|
227 |
+
- **Similarity Function:** Cosine Similarity
|
228 |
+
- **Training Dataset:**
|
229 |
+
- [PiC/phrase_similarity](https://huggingface.co/datasets/PiC/phrase_similarity)
|
230 |
+
- **Language:** en
|
231 |
+
<!-- - **License:** Unknown -->
|
232 |
+
|
233 |
+
### Model Sources
|
234 |
+
|
235 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
236 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
237 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
238 |
+
|
239 |
+
### Full Model Architecture
|
240 |
+
|
241 |
+
```
|
242 |
+
SentenceTransformer(
|
243 |
+
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: ElectraModel
|
244 |
+
(1): Pooling({'word_embedding_dimension': 1024, '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})
|
245 |
+
)
|
246 |
+
```
|
247 |
+
|
248 |
+
## Usage
|
249 |
+
|
250 |
+
### Direct Usage (Sentence Transformers)
|
251 |
+
|
252 |
+
First install the Sentence Transformers library:
|
253 |
+
|
254 |
+
```bash
|
255 |
+
pip install -U sentence-transformers
|
256 |
+
```
|
257 |
+
|
258 |
+
Then you can load this model and run inference.
|
259 |
+
```python
|
260 |
+
from sentence_transformers import SentenceTransformer
|
261 |
+
|
262 |
+
# Download from the 🤗 Hub
|
263 |
+
model = SentenceTransformer("Deehan1866/Electra")
|
264 |
+
# Run inference
|
265 |
+
sentences = [
|
266 |
+
"She wants to write about Keima but suffers a major case of writer's block.",
|
267 |
+
"She wants to write about Keima but suffers a huge occurrence of writer's block.",
|
268 |
+
'specific medical status of movement and the general condition of movement both are conditions under which contradictions can move.',
|
269 |
+
]
|
270 |
+
embeddings = model.encode(sentences)
|
271 |
+
print(embeddings.shape)
|
272 |
+
# [3, 1024]
|
273 |
+
|
274 |
+
# Get the similarity scores for the embeddings
|
275 |
+
similarities = model.similarity(embeddings, embeddings)
|
276 |
+
print(similarities.shape)
|
277 |
+
# [3, 3]
|
278 |
+
```
|
279 |
+
|
280 |
+
<!--
|
281 |
+
### Direct Usage (Transformers)
|
282 |
+
|
283 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
284 |
+
|
285 |
+
</details>
|
286 |
+
-->
|
287 |
+
|
288 |
+
<!--
|
289 |
+
### Downstream Usage (Sentence Transformers)
|
290 |
+
|
291 |
+
You can finetune this model on your own dataset.
|
292 |
+
|
293 |
+
<details><summary>Click to expand</summary>
|
294 |
+
|
295 |
+
</details>
|
296 |
+
-->
|
297 |
+
|
298 |
+
<!--
|
299 |
+
### Out-of-Scope Use
|
300 |
+
|
301 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
302 |
+
-->
|
303 |
+
|
304 |
+
## Evaluation
|
305 |
+
|
306 |
+
### Metrics
|
307 |
+
|
308 |
+
#### Binary Classification
|
309 |
+
* Dataset: `quora-duplicates-dev`
|
310 |
+
* Evaluated with [<code>BinaryClassificationEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
|
311 |
+
|
312 |
+
| Metric | Value |
|
313 |
+
|:-----------------------------|:-----------|
|
314 |
+
| cosine_accuracy | 0.748 |
|
315 |
+
| cosine_accuracy_threshold | 0.9737 |
|
316 |
+
| cosine_f1 | 0.7605 |
|
317 |
+
| cosine_f1_threshold | 0.9575 |
|
318 |
+
| cosine_precision | 0.712 |
|
319 |
+
| cosine_recall | 0.816 |
|
320 |
+
| cosine_ap | 0.7869 |
|
321 |
+
| dot_accuracy | 0.667 |
|
322 |
+
| dot_accuracy_threshold | 275.4552 |
|
323 |
+
| dot_f1 | 0.7332 |
|
324 |
+
| dot_f1_threshold | 266.1473 |
|
325 |
+
| dot_precision | 0.601 |
|
326 |
+
| dot_recall | 0.94 |
|
327 |
+
| dot_ap | 0.5935 |
|
328 |
+
| manhattan_accuracy | 0.746 |
|
329 |
+
| manhattan_accuracy_threshold | 87.7386 |
|
330 |
+
| manhattan_f1 | 0.7615 |
|
331 |
+
| manhattan_f1_threshold | 131.4337 |
|
332 |
+
| manhattan_precision | 0.7034 |
|
333 |
+
| manhattan_recall | 0.83 |
|
334 |
+
| manhattan_ap | 0.7905 |
|
335 |
+
| euclidean_accuracy | 0.747 |
|
336 |
+
| euclidean_accuracy_threshold | 4.5834 |
|
337 |
+
| euclidean_f1 | 0.761 |
|
338 |
+
| euclidean_f1_threshold | 5.554 |
|
339 |
+
| euclidean_precision | 0.716 |
|
340 |
+
| euclidean_recall | 0.812 |
|
341 |
+
| euclidean_ap | 0.7898 |
|
342 |
+
| max_accuracy | 0.748 |
|
343 |
+
| max_accuracy_threshold | 275.4552 |
|
344 |
+
| max_f1 | 0.7615 |
|
345 |
+
| max_f1_threshold | 266.1473 |
|
346 |
+
| max_precision | 0.716 |
|
347 |
+
| max_recall | 0.94 |
|
348 |
+
| **max_ap** | **0.7905** |
|
349 |
+
|
350 |
+
<!--
|
351 |
+
## Bias, Risks and Limitations
|
352 |
+
|
353 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
354 |
+
-->
|
355 |
+
|
356 |
+
<!--
|
357 |
+
### Recommendations
|
358 |
+
|
359 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
360 |
+
-->
|
361 |
+
|
362 |
+
## Training Details
|
363 |
+
|
364 |
+
### Training Dataset
|
365 |
+
|
366 |
+
#### PiC/phrase_similarity
|
367 |
+
|
368 |
+
* Dataset: [PiC/phrase_similarity](https://huggingface.co/datasets/PiC/phrase_similarity) at [fc67ce7](https://huggingface.co/datasets/PiC/phrase_similarity/tree/fc67ce7c1e69e360e42dc6f31ddf97bb32f1923d)
|
369 |
+
* Size: 7,004 training samples
|
370 |
+
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
371 |
+
* Approximate statistics based on the first 1000 samples:
|
372 |
+
| | sentence1 | sentence2 | label |
|
373 |
+
|:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:------------------------------------------------|
|
374 |
+
| type | string | string | int |
|
375 |
+
| details | <ul><li>min: 12 tokens</li><li>mean: 26.35 tokens</li><li>max: 57 tokens</li></ul> | <ul><li>min: 12 tokens</li><li>mean: 26.89 tokens</li><li>max: 58 tokens</li></ul> | <ul><li>0: ~48.80%</li><li>1: ~51.20%</li></ul> |
|
376 |
+
* Samples:
|
377 |
+
| sentence1 | sentence2 | label |
|
378 |
+
|:------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|
|
379 |
+
| <code>newly formed camp is released from the membrane and diffuses across the intracellular space where it serves to activate pka.</code> | <code>recently made encampment is released from the membrane and diffuses across the intracellular space where it serves to activate pka.</code> | <code>0</code> |
|
380 |
+
| <code>According to one data, in 1910, on others – in 1915, the mansion became Natalya Dmitriyevna Shchuchkina's property.</code> | <code>According to a particular statistic, in 1910, on others – in 1915, the mansion became Natalya Dmitriyevna Shchuchkina's property.</code> | <code>1</code> |
|
381 |
+
| <code>Note that Fact 1 does not assume any particular structure on the set formula_65.</code> | <code>Note that Fact 1 does not assume any specific edifice on the set formula_65.</code> | <code>0</code> |
|
382 |
+
* Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)
|
383 |
+
|
384 |
+
### Evaluation Dataset
|
385 |
+
|
386 |
+
#### PiC/phrase_similarity
|
387 |
+
|
388 |
+
* Dataset: [PiC/phrase_similarity](https://huggingface.co/datasets/PiC/phrase_similarity) at [fc67ce7](https://huggingface.co/datasets/PiC/phrase_similarity/tree/fc67ce7c1e69e360e42dc6f31ddf97bb32f1923d)
|
389 |
+
* Size: 1,000 evaluation samples
|
390 |
+
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
391 |
+
* Approximate statistics based on the first 1000 samples:
|
392 |
+
| | sentence1 | sentence2 | label |
|
393 |
+
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:------------------------------------------------|
|
394 |
+
| type | string | string | int |
|
395 |
+
| details | <ul><li>min: 9 tokens</li><li>mean: 26.21 tokens</li><li>max: 61 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 26.8 tokens</li><li>max: 61 tokens</li></ul> | <ul><li>0: ~50.00%</li><li>1: ~50.00%</li></ul> |
|
396 |
+
* Samples:
|
397 |
+
| sentence1 | sentence2 | label |
|
398 |
+
|:----------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------|:---------------|
|
399 |
+
| <code>after theo's apparent death, she decides to leave first colony and ends up traveling with the apostles.</code> | <code>after theo's apparent death, she decides to leave original settlement and ends up traveling with the apostles.</code> | <code>0</code> |
|
400 |
+
| <code>The guard assigned to Vivian leaves her to prevent the robbery, allowing her to connect to the bank's network.</code> | <code>The guard assigned to Vivian leaves her to prevent the robbery, allowing her to connect to the bank's locations.</code> | <code>0</code> |
|
401 |
+
| <code>Two days later Louis XVI banished Necker by a "lettre de cachet" for his very public exchange of pamphlets.</code> | <code>Two days later Louis XVI banished Necker by a "lettre de cachet" for his very free forum of pamphlets.</code> | <code>0</code> |
|
402 |
+
* Loss: [<code>SoftmaxLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#softmaxloss)
|
403 |
+
|
404 |
+
### Training Hyperparameters
|
405 |
+
#### Non-Default Hyperparameters
|
406 |
+
|
407 |
+
- `eval_strategy`: steps
|
408 |
+
- `per_device_train_batch_size`: 16
|
409 |
+
- `per_device_eval_batch_size`: 16
|
410 |
+
- `learning_rate`: 2e-05
|
411 |
+
- `num_train_epochs`: 5
|
412 |
+
- `warmup_ratio`: 0.1
|
413 |
+
- `load_best_model_at_end`: True
|
414 |
+
|
415 |
+
#### All Hyperparameters
|
416 |
+
<details><summary>Click to expand</summary>
|
417 |
+
|
418 |
+
- `overwrite_output_dir`: False
|
419 |
+
- `do_predict`: False
|
420 |
+
- `eval_strategy`: steps
|
421 |
+
- `prediction_loss_only`: True
|
422 |
+
- `per_device_train_batch_size`: 16
|
423 |
+
- `per_device_eval_batch_size`: 16
|
424 |
+
- `per_gpu_train_batch_size`: None
|
425 |
+
- `per_gpu_eval_batch_size`: None
|
426 |
+
- `gradient_accumulation_steps`: 1
|
427 |
+
- `eval_accumulation_steps`: None
|
428 |
+
- `learning_rate`: 2e-05
|
429 |
+
- `weight_decay`: 0.0
|
430 |
+
- `adam_beta1`: 0.9
|
431 |
+
- `adam_beta2`: 0.999
|
432 |
+
- `adam_epsilon`: 1e-08
|
433 |
+
- `max_grad_norm`: 1.0
|
434 |
+
- `num_train_epochs`: 5
|
435 |
+
- `max_steps`: -1
|
436 |
+
- `lr_scheduler_type`: linear
|
437 |
+
- `lr_scheduler_kwargs`: {}
|
438 |
+
- `warmup_ratio`: 0.1
|
439 |
+
- `warmup_steps`: 0
|
440 |
+
- `log_level`: passive
|
441 |
+
- `log_level_replica`: warning
|
442 |
+
- `log_on_each_node`: True
|
443 |
+
- `logging_nan_inf_filter`: True
|
444 |
+
- `save_safetensors`: True
|
445 |
+
- `save_on_each_node`: False
|
446 |
+
- `save_only_model`: False
|
447 |
+
- `restore_callback_states_from_checkpoint`: False
|
448 |
+
- `no_cuda`: False
|
449 |
+
- `use_cpu`: False
|
450 |
+
- `use_mps_device`: False
|
451 |
+
- `seed`: 42
|
452 |
+
- `data_seed`: None
|
453 |
+
- `jit_mode_eval`: False
|
454 |
+
- `use_ipex`: False
|
455 |
+
- `bf16`: False
|
456 |
+
- `fp16`: False
|
457 |
+
- `fp16_opt_level`: O1
|
458 |
+
- `half_precision_backend`: auto
|
459 |
+
- `bf16_full_eval`: False
|
460 |
+
- `fp16_full_eval`: False
|
461 |
+
- `tf32`: None
|
462 |
+
- `local_rank`: 0
|
463 |
+
- `ddp_backend`: None
|
464 |
+
- `tpu_num_cores`: None
|
465 |
+
- `tpu_metrics_debug`: False
|
466 |
+
- `debug`: []
|
467 |
+
- `dataloader_drop_last`: False
|
468 |
+
- `dataloader_num_workers`: 0
|
469 |
+
- `dataloader_prefetch_factor`: None
|
470 |
+
- `past_index`: -1
|
471 |
+
- `disable_tqdm`: False
|
472 |
+
- `remove_unused_columns`: True
|
473 |
+
- `label_names`: None
|
474 |
+
- `load_best_model_at_end`: True
|
475 |
+
- `ignore_data_skip`: False
|
476 |
+
- `fsdp`: []
|
477 |
+
- `fsdp_min_num_params`: 0
|
478 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
479 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
480 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
481 |
+
- `deepspeed`: None
|
482 |
+
- `label_smoothing_factor`: 0.0
|
483 |
+
- `optim`: adamw_torch
|
484 |
+
- `optim_args`: None
|
485 |
+
- `adafactor`: False
|
486 |
+
- `group_by_length`: False
|
487 |
+
- `length_column_name`: length
|
488 |
+
- `ddp_find_unused_parameters`: None
|
489 |
+
- `ddp_bucket_cap_mb`: None
|
490 |
+
- `ddp_broadcast_buffers`: False
|
491 |
+
- `dataloader_pin_memory`: True
|
492 |
+
- `dataloader_persistent_workers`: False
|
493 |
+
- `skip_memory_metrics`: True
|
494 |
+
- `use_legacy_prediction_loop`: False
|
495 |
+
- `push_to_hub`: False
|
496 |
+
- `resume_from_checkpoint`: None
|
497 |
+
- `hub_model_id`: None
|
498 |
+
- `hub_strategy`: every_save
|
499 |
+
- `hub_private_repo`: False
|
500 |
+
- `hub_always_push`: False
|
501 |
+
- `gradient_checkpointing`: False
|
502 |
+
- `gradient_checkpointing_kwargs`: None
|
503 |
+
- `include_inputs_for_metrics`: False
|
504 |
+
- `eval_do_concat_batches`: True
|
505 |
+
- `fp16_backend`: auto
|
506 |
+
- `push_to_hub_model_id`: None
|
507 |
+
- `push_to_hub_organization`: None
|
508 |
+
- `mp_parameters`:
|
509 |
+
- `auto_find_batch_size`: False
|
510 |
+
- `full_determinism`: False
|
511 |
+
- `torchdynamo`: None
|
512 |
+
- `ray_scope`: last
|
513 |
+
- `ddp_timeout`: 1800
|
514 |
+
- `torch_compile`: False
|
515 |
+
- `torch_compile_backend`: None
|
516 |
+
- `torch_compile_mode`: None
|
517 |
+
- `dispatch_batches`: None
|
518 |
+
- `split_batches`: None
|
519 |
+
- `include_tokens_per_second`: False
|
520 |
+
- `include_num_input_tokens_seen`: False
|
521 |
+
- `neftune_noise_alpha`: None
|
522 |
+
- `optim_target_modules`: None
|
523 |
+
- `batch_eval_metrics`: False
|
524 |
+
- `eval_on_start`: False
|
525 |
+
- `batch_sampler`: batch_sampler
|
526 |
+
- `multi_dataset_batch_sampler`: proportional
|
527 |
+
|
528 |
+
</details>
|
529 |
+
|
530 |
+
### Training Logs
|
531 |
+
| Epoch | Step | Training Loss | loss | quora-duplicates-dev_max_ap |
|
532 |
+
|:----------:|:-------:|:-------------:|:----------:|:---------------------------:|
|
533 |
+
| 0 | 0 | - | - | 0.6721 |
|
534 |
+
| 0.2283 | 100 | - | 0.6805 | 0.6847 |
|
535 |
+
| **0.4566** | **200** | **-** | **0.5313** | **0.7905** |
|
536 |
+
| 0.6849 | 300 | - | 0.5383 | 0.7838 |
|
537 |
+
| 0.9132 | 400 | - | 0.6442 | 0.7585 |
|
538 |
+
| 1.1416 | 500 | 0.5761 | 0.5742 | 0.7843 |
|
539 |
+
| 1.3699 | 600 | - | 0.5606 | 0.7558 |
|
540 |
+
| 1.5982 | 700 | - | 0.5716 | 0.7772 |
|
541 |
+
| 1.8265 | 800 | - | 0.5573 | 0.7619 |
|
542 |
+
| 2.0548 | 900 | - | 0.6951 | 0.7760 |
|
543 |
+
| 2.2831 | 1000 | 0.3712 | 0.7678 | 0.7753 |
|
544 |
+
| 2.5114 | 1100 | - | 0.7712 | 0.7915 |
|
545 |
+
| 2.7397 | 1200 | - | 0.8120 | 0.7914 |
|
546 |
+
| 2.9680 | 1300 | - | 0.8045 | 0.7789 |
|
547 |
+
| 3.1963 | 1400 | - | 0.9936 | 0.7821 |
|
548 |
+
| 3.4247 | 1500 | 0.1942 | 1.0883 | 0.7679 |
|
549 |
+
| 3.6530 | 1600 | - | 0.9814 | 0.7566 |
|
550 |
+
| 3.8813 | 1700 | - | 1.0897 | 0.7830 |
|
551 |
+
| 4.1096 | 1800 | - | 1.0764 | 0.7729 |
|
552 |
+
| 4.3379 | 1900 | - | 1.1209 | 0.7802 |
|
553 |
+
| 4.5662 | 2000 | 0.1175 | 1.1522 | 0.7804 |
|
554 |
+
| 4.7945 | 2100 | - | 1.1545 | 0.7807 |
|
555 |
+
| 5.0 | 2190 | - | - | 0.7905 |
|
556 |
+
|
557 |
+
* The bold row denotes the saved checkpoint.
|
558 |
+
|
559 |
+
### Framework Versions
|
560 |
+
- Python: 3.10.10
|
561 |
+
- Sentence Transformers: 3.0.1
|
562 |
+
- Transformers: 4.42.3
|
563 |
+
- PyTorch: 2.2.1+cu121
|
564 |
+
- Accelerate: 0.32.1
|
565 |
+
- Datasets: 2.20.0
|
566 |
+
- Tokenizers: 0.19.1
|
567 |
+
|
568 |
+
## Citation
|
569 |
+
|
570 |
+
### BibTeX
|
571 |
+
|
572 |
+
#### Sentence Transformers and SoftmaxLoss
|
573 |
+
```bibtex
|
574 |
+
@inproceedings{reimers-2019-sentence-bert,
|
575 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
576 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
577 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
578 |
+
month = "11",
|
579 |
+
year = "2019",
|
580 |
+
publisher = "Association for Computational Linguistics",
|
581 |
+
url = "https://arxiv.org/abs/1908.10084",
|
582 |
+
}
|
583 |
+
```
|
584 |
+
|
585 |
+
<!--
|
586 |
+
## Glossary
|
587 |
+
|
588 |
+
*Clearly define terms in order to be accessible across audiences.*
|
589 |
+
-->
|
590 |
+
|
591 |
+
<!--
|
592 |
+
## Model Card Authors
|
593 |
+
|
594 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
595 |
+
-->
|
596 |
+
|
597 |
+
<!--
|
598 |
+
## Model Card Contact
|
599 |
+
|
600 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
601 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "google/electra-large-discriminator",
|
3 |
+
"architectures": [
|
4 |
+
"ElectraModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"embedding_size": 1024,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 1024,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 4096,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "electra",
|
17 |
+
"num_attention_heads": 16,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"summary_activation": "gelu",
|
22 |
+
"summary_last_dropout": 0.1,
|
23 |
+
"summary_type": "first",
|
24 |
+
"summary_use_proj": true,
|
25 |
+
"torch_dtype": "float32",
|
26 |
+
"transformers_version": "4.42.3",
|
27 |
+
"type_vocab_size": 2,
|
28 |
+
"use_cache": true,
|
29 |
+
"vocab_size": 30522
|
30 |
+
}
|
config_sentence_transformers.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.42.3",
|
5 |
+
"pytorch": "2.2.1+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:170ef32b7e718a9992f87bf9957c7fb14b15e6fe2bb743094a0ac8fa746ff9ad
|
3 |
+
size 1336413848
|
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": 512,
|
3 |
+
"do_lower_case": false
|
4 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"model_max_length": 512,
|
49 |
+
"pad_token": "[PAD]",
|
50 |
+
"sep_token": "[SEP]",
|
51 |
+
"strip_accents": null,
|
52 |
+
"tokenize_chinese_chars": true,
|
53 |
+
"tokenizer_class": "ElectraTokenizer",
|
54 |
+
"unk_token": "[UNK]"
|
55 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|