gabrielloiseau commited on
Commit
ff90d7f
·
verified ·
1 Parent(s): 90d6891

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -514
README.md CHANGED
@@ -1,547 +1,59 @@
1
  ---
 
2
  tags:
3
  - sentence-transformers
4
  - sentence-similarity
5
  - feature-extraction
6
- - generated_from_trainer
7
- - dataset_size:156387
8
  - loss:ContrastiveLoss
9
  base_model: FacebookAI/xlm-roberta-large
10
- widget:
11
- - source_sentence: the latter is useful for modifying information about some or all
12
- forms of a word , hence reducing the work required to improve <t>dictionary</t>
13
- contents .
14
- sentences:
15
- - conchita nagged at the younger children , attempting without <t>success</t> to
16
- keep her thoughts off tom brannon .
17
- - another girl from a relatively large midwestern city described herself as `` the
18
- only orthodox girl in <t>town</t> '' .
19
- - entries are summarized only when by doing so the amount of information retained
20
- in the <t>dictionary</t> is reduced and the time required for dictionary operations
21
- is decreased .
22
- - source_sentence: the kind of religious experience that most moderns seek not only
23
- provides , clarifies , and relates human yearnings , values , ideals , and purposes
24
- ; it also provides facilities and incitements for the <t>development</t> of personality
25
- , sociality , and creativeness .
26
- sentences:
27
- - the artistic interest , then , lies in what the encounter may be made to represent
28
- , in the power of some <t>central</t> significance to draw the details into relevance
29
- and meaningfulness .
30
- - more than 25 carefully selected cities were visited , <t>including</t> new york
31
- , brooklyn , long island city , newark , elizabeth , stamford , waterbury , new
32
- haven , bridgeport , boston , cambridge , worcester , and waltham .
33
- - the liberals , smelling blood , were faced with the necessity of <t>winning</t>
34
- three big votes - in the democratic committee on committees , in the full party
35
- caucus , and on the floor of the house - before they could oust colmer .
36
- - source_sentence: 'another yankee became so disgusted as to state : `` i wish to
37
- god one half of our <t>officers</t> were knocked in the head by slinging them
38
- against [ the other half ] '''' .'
39
- sentences:
40
- - we 'd seen his handiwork out in the back yard , and the little his tenants had
41
- told us of him did make him sound a little <t>special</t> .
42
- - 'private george gray hunter of pennsylvania wrote : `` i am well convinced in
43
- my own mind that had it not been for <t>officers</t> this war would have ended
44
- long ago '''' .'
45
- - until this hunter-killer operation can be performed by spacecraft , manned aircraft
46
- <t>appear</t> to be the only means available to us .
47
- - source_sentence: there was a man 's jacket on the chair and a straw hat on the <t>table</t>
48
- .
49
- sentences:
50
- - this section shall not apply to corporations purchasing such stock solely for
51
- investment and not using the same by voting or otherwise to bring about , or in
52
- <t>attempting</t> to bring about , the substantial lessening of competition ``
53
- .
54
- - if your principal place of abode for the tax <t>year</t> is outside the united
55
- states ( including alaska and hawaii ) , puerto rico , or the virgin islands and
56
- you have no legal residence or principal place of business in any internal revenue
57
- district in the united states , you should file your return with the office of
58
- international operations , internal revenue service , washington 25 , d. c. .
59
- - both , of course , were remarkable feats and further embossed the fact that <t>baseball</t>
60
- rightfully is the national pastime .
61
- - source_sentence: a. e. sharp , in vowel-length and syllabicity in kikuyu , examines
62
- one set of related orthographic questions and its phonologic <t>background</t>
63
- in detail .
64
- sentences:
65
- - sensing the unseen presence of the other men in the patrol , he felt mutely united
66
- to these nine <t>near</t> strangers sharing this pinpoint of being with him .
67
- - this subsection shall not be so construed as to deprive the owner of any <t>background</t>
68
- patent relating thereto of such rights as he may have thereunder .
69
- - government itself was based upon contract ; business organization - the corporation
70
- - was analyzed in contractual terms ; trade was based on freedom of contract ,
71
- and money was lent and borrowed on contractual terms ; even marriage and the family
72
- was seen as a contractual <t>arrangement</t> .
73
  pipeline_tag: sentence-similarity
74
- library_name: sentence-transformers
75
- metrics:
76
- - cosine_accuracy
77
- - cosine_accuracy_threshold
78
- - cosine_f1
79
- - cosine_f1_threshold
80
- - cosine_precision
81
- - cosine_recall
82
- - cosine_ap
83
- model-index:
84
- - name: SentenceTransformer based on FacebookAI/xlm-roberta-large
85
- results:
86
- - task:
87
- type: binary-classification
88
- name: Binary Classification
89
- dataset:
90
- name: cale eval
91
- type: cale-eval
92
- metrics:
93
- - type: cosine_accuracy
94
- value: 0.7822948920719075
95
- name: Cosine Accuracy
96
- - type: cosine_accuracy_threshold
97
- value: 0.6373387575149536
98
- name: Cosine Accuracy Threshold
99
- - type: cosine_f1
100
- value: 0.7738327068520447
101
- name: Cosine F1
102
- - type: cosine_f1_threshold
103
- value: 0.5533720254898071
104
- name: Cosine F1 Threshold
105
- - type: cosine_precision
106
- value: 0.661133681563165
107
- name: Cosine Precision
108
- - type: cosine_recall
109
- value: 0.9328492657094503
110
- name: Cosine Recall
111
- - type: cosine_ap
112
- value: 0.7420096616621343
113
- name: Cosine Ap
114
  ---
115
 
116
- # SentenceTransformer based on FacebookAI/xlm-roberta-large
117
 
118
- This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [FacebookAI/xlm-roberta-large](https://huggingface.co/FacebookAI/xlm-roberta-large). 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.
119
 
120
- ## Model Details
121
 
122
- ### Model Description
123
- - **Model Type:** Sentence Transformer
124
- - **Base model:** [FacebookAI/xlm-roberta-large](https://huggingface.co/FacebookAI/xlm-roberta-large) <!-- at revision c23d21b0620b635a76227c604d44e43a9f0ee389 -->
125
- - **Maximum Sequence Length:** 512 tokens
126
- - **Output Dimensionality:** 1024 dimensions
127
- - **Similarity Function:** Cosine Similarity
128
- <!-- - **Training Dataset:** Unknown -->
129
- <!-- - **Language:** Unknown -->
130
- <!-- - **License:** Unknown -->
131
 
132
- ### Model Sources
133
 
134
- - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
135
- - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
136
- - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
137
-
138
- ### Full Model Architecture
139
-
140
- ```
141
- SentenceTransformer(
142
- (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
143
- (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})
144
- )
145
  ```
146
-
147
- ## Usage
148
-
149
- ### Direct Usage (Sentence Transformers)
150
-
151
- First install the Sentence Transformers library:
152
-
153
- ```bash
154
  pip install -U sentence-transformers
155
  ```
156
 
157
- Then you can load this model and run inference.
 
158
  ```python
159
  from sentence_transformers import SentenceTransformer
160
 
161
- # Download from the 🤗 Hub
162
  model = SentenceTransformer("gabrielloiseau/CALE-XLM-R")
163
- # Run inference
164
  sentences = [
165
- 'a. e. sharp , in vowel-length and syllabicity in kikuyu , examines one set of related orthographic questions and its phonologic <t>background</t> in detail .',
166
- 'this subsection shall not be so construed as to deprive the owner of any <t>background</t> patent relating thereto of such rights as he may have thereunder .',
167
- 'sensing the unseen presence of the other men in the patrol , he felt mutely united to these nine <t>near</t> strangers sharing this pinpoint of being with him .',
168
  ]
 
 
169
  embeddings = model.encode(sentences)
170
  print(embeddings.shape)
171
  # [3, 1024]
172
 
173
- # Get the similarity scores for the embeddings
174
  similarities = model.similarity(embeddings, embeddings)
175
- print(similarities.shape)
176
- # [3, 3]
 
 
177
  ```
178
 
179
- <!--
180
- ### Direct Usage (Transformers)
181
-
182
- <details><summary>Click to see the direct usage in Transformers</summary>
183
-
184
- </details>
185
- -->
186
-
187
- <!--
188
- ### Downstream Usage (Sentence Transformers)
189
-
190
- You can finetune this model on your own dataset.
191
-
192
- <details><summary>Click to expand</summary>
193
-
194
- </details>
195
- -->
196
-
197
- <!--
198
- ### Out-of-Scope Use
199
-
200
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
201
- -->
202
-
203
- ## Evaluation
204
-
205
- ### Metrics
206
-
207
- #### Binary Classification
208
-
209
- * Dataset: `cale-eval`
210
- * Evaluated with [<code>BinaryClassificationEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.BinaryClassificationEvaluator)
211
-
212
- | Metric | Value |
213
- |:--------------------------|:----------|
214
- | cosine_accuracy | 0.7823 |
215
- | cosine_accuracy_threshold | 0.6373 |
216
- | cosine_f1 | 0.7738 |
217
- | cosine_f1_threshold | 0.5534 |
218
- | cosine_precision | 0.6611 |
219
- | cosine_recall | 0.9328 |
220
- | **cosine_ap** | **0.742** |
221
-
222
- <!--
223
- ## Bias, Risks and Limitations
224
-
225
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
226
- -->
227
-
228
- <!--
229
- ### Recommendations
230
-
231
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
232
- -->
233
-
234
- ## Training Details
235
-
236
- ### Training Dataset
237
-
238
- #### Unnamed Dataset
239
-
240
-
241
- * Size: 156,387 training samples
242
- * Columns: <code>label</code>, <code>sentence1</code>, and <code>sentence2</code>
243
- * Approximate statistics based on the first 1000 samples:
244
- | | label | sentence1 | sentence2 |
245
- |:--------|:------------------------------------------------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
246
- | type | int | string | string |
247
- | details | <ul><li>0: ~60.70%</li><li>1: ~39.30%</li></ul> | <ul><li>min: 23 tokens</li><li>mean: 56.47 tokens</li><li>max: 134 tokens</li></ul> | <ul><li>min: 23 tokens</li><li>mean: 57.06 tokens</li><li>max: 135 tokens</li></ul> |
248
- * Samples:
249
- | label | sentence1 | sentence2 |
250
- |:---------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
251
- | <code>1</code> | <code>as a result , although we still make use of this distinction , there is much confusion as to the meaning of the <t>basic</t> terms employed .</code> | <code>but he takes his bearings from the great guidelines of policy , well established precedents , the commitments of the united states under international charters and treaties , <t>basic</t> statutes , and well understood notions of the american people about how we are to conduct ourselves , in policy literature such as country papers and national security council papers accumulated in the department .</code> |
252
- | <code>0</code> | <code>as a result , although we still make use of this distinction , there is much confusion as to the meaning of the <t>basic</t> terms employed .</code> | <code>if adjectival meanings show relatively low retentiveness of stems , as i am confident will prove to be the case in most languages of the world , why should our <t>basic</t> lists include 15 per cent of these unstable forms , but only 8 per cent of animals and plants which replace much more slowly ?</code> |
253
- | <code>0</code> | <code>as a result , although we still make use of this distinction , there is much confusion as to the meaning of the <t>basic</t> terms employed .</code> | <code>in 1927 his father 's business collapsed , and , rather than go bankrupt , mercer senior turned his firm over to a <t>bank</t> for liquidation .</code> |
254
- * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
255
- ```json
256
- {
257
- "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
258
- "margin": 0.7,
259
- "size_average": true
260
- }
261
- ```
262
-
263
- ### Evaluation Dataset
264
-
265
- #### Unnamed Dataset
266
-
267
-
268
- * Size: 44,891 evaluation samples
269
- * Columns: <code>label</code>, <code>sentence1</code>, and <code>sentence2</code>
270
- * Approximate statistics based on the first 1000 samples:
271
- | | label | sentence1 | sentence2 |
272
- |:--------|:------------------------------------------------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
273
- | type | int | string | string |
274
- | details | <ul><li>0: ~60.60%</li><li>1: ~39.40%</li></ul> | <ul><li>min: 20 tokens</li><li>mean: 53.29 tokens</li><li>max: 151 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 54.72 tokens</li><li>max: 149 tokens</li></ul> |
275
- * Samples:
276
- | label | sentence1 | sentence2 |
277
- |:---------------|:-------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
278
- | <code>1</code> | <code>drop both hands to the floor and at the same time kick the right <t>foot</t> up in back .</code> | <code>place a suitably loaded barbell across them ; grasp the bar ( which will rest against the back of your neck ) ; extend your <t>feet</t> forward and backward until you are in a deep leg split .</code> |
279
- | <code>0</code> | <code>drop both hands to the floor and at the same time kick the right <t>foot</t> up in back .</code> | <code>a scant half mile away shelley and mary were doubtless sitting on their diminutive terrace , the air about them scented with stock , and listening to the nightingale who had nested in the big lime tree at the <t>foot</t> of the garden .</code> |
280
- | <code>0</code> | <code>drop both hands to the floor and at the same time kick the right <t>foot</t> up in back .</code> | <code>in preparing the state guide plan , particular attention will be given means of <t>strengthening</t> the economy of the state through the development of industry and recreation .</code> |
281
- * Loss: [<code>ContrastiveLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#contrastiveloss) with these parameters:
282
- ```json
283
- {
284
- "distance_metric": "SiameseDistanceMetric.COSINE_DISTANCE",
285
- "margin": 0.7,
286
- "size_average": true
287
- }
288
- ```
289
-
290
- ### Training Hyperparameters
291
- #### Non-Default Hyperparameters
292
-
293
- - `eval_strategy`: steps
294
- - `per_device_train_batch_size`: 13
295
- - `per_device_eval_batch_size`: 13
296
- - `gradient_accumulation_steps`: 2
297
- - `learning_rate`: 4.46438e-06
298
- - `weight_decay`: 0.0388
299
- - `num_train_epochs`: 1
300
- - `warmup_ratio`: 0.2995
301
- - `fp16`: True
302
- - `gradient_checkpointing`: True
303
-
304
- #### All Hyperparameters
305
- <details><summary>Click to expand</summary>
306
-
307
- - `overwrite_output_dir`: False
308
- - `do_predict`: False
309
- - `eval_strategy`: steps
310
- - `prediction_loss_only`: True
311
- - `per_device_train_batch_size`: 13
312
- - `per_device_eval_batch_size`: 13
313
- - `per_gpu_train_batch_size`: None
314
- - `per_gpu_eval_batch_size`: None
315
- - `gradient_accumulation_steps`: 2
316
- - `eval_accumulation_steps`: None
317
- - `torch_empty_cache_steps`: None
318
- - `learning_rate`: 4.46438e-06
319
- - `weight_decay`: 0.0388
320
- - `adam_beta1`: 0.9
321
- - `adam_beta2`: 0.999
322
- - `adam_epsilon`: 1e-08
323
- - `max_grad_norm`: 1.0
324
- - `num_train_epochs`: 1
325
- - `max_steps`: -1
326
- - `lr_scheduler_type`: linear
327
- - `lr_scheduler_kwargs`: {}
328
- - `warmup_ratio`: 0.2995
329
- - `warmup_steps`: 0
330
- - `log_level`: passive
331
- - `log_level_replica`: warning
332
- - `log_on_each_node`: True
333
- - `logging_nan_inf_filter`: True
334
- - `save_safetensors`: True
335
- - `save_on_each_node`: False
336
- - `save_only_model`: False
337
- - `restore_callback_states_from_checkpoint`: False
338
- - `no_cuda`: False
339
- - `use_cpu`: False
340
- - `use_mps_device`: False
341
- - `seed`: 42
342
- - `data_seed`: None
343
- - `jit_mode_eval`: False
344
- - `use_ipex`: False
345
- - `bf16`: False
346
- - `fp16`: True
347
- - `fp16_opt_level`: O1
348
- - `half_precision_backend`: auto
349
- - `bf16_full_eval`: False
350
- - `fp16_full_eval`: False
351
- - `tf32`: None
352
- - `local_rank`: 0
353
- - `ddp_backend`: None
354
- - `tpu_num_cores`: None
355
- - `tpu_metrics_debug`: False
356
- - `debug`: []
357
- - `dataloader_drop_last`: False
358
- - `dataloader_num_workers`: 0
359
- - `dataloader_prefetch_factor`: None
360
- - `past_index`: -1
361
- - `disable_tqdm`: False
362
- - `remove_unused_columns`: True
363
- - `label_names`: None
364
- - `load_best_model_at_end`: False
365
- - `ignore_data_skip`: False
366
- - `fsdp`: []
367
- - `fsdp_min_num_params`: 0
368
- - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
369
- - `fsdp_transformer_layer_cls_to_wrap`: None
370
- - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
371
- - `deepspeed`: None
372
- - `label_smoothing_factor`: 0.0
373
- - `optim`: adamw_torch
374
- - `optim_args`: None
375
- - `adafactor`: False
376
- - `group_by_length`: False
377
- - `length_column_name`: length
378
- - `ddp_find_unused_parameters`: None
379
- - `ddp_bucket_cap_mb`: None
380
- - `ddp_broadcast_buffers`: False
381
- - `dataloader_pin_memory`: True
382
- - `dataloader_persistent_workers`: False
383
- - `skip_memory_metrics`: True
384
- - `use_legacy_prediction_loop`: False
385
- - `push_to_hub`: False
386
- - `resume_from_checkpoint`: None
387
- - `hub_model_id`: None
388
- - `hub_strategy`: every_save
389
- - `hub_private_repo`: None
390
- - `hub_always_push`: False
391
- - `gradient_checkpointing`: True
392
- - `gradient_checkpointing_kwargs`: None
393
- - `include_inputs_for_metrics`: False
394
- - `include_for_metrics`: []
395
- - `eval_do_concat_batches`: True
396
- - `fp16_backend`: auto
397
- - `push_to_hub_model_id`: None
398
- - `push_to_hub_organization`: None
399
- - `mp_parameters`:
400
- - `auto_find_batch_size`: False
401
- - `full_determinism`: False
402
- - `torchdynamo`: None
403
- - `ray_scope`: last
404
- - `ddp_timeout`: 1800
405
- - `torch_compile`: False
406
- - `torch_compile_backend`: None
407
- - `torch_compile_mode`: None
408
- - `dispatch_batches`: None
409
- - `split_batches`: None
410
- - `include_tokens_per_second`: False
411
- - `include_num_input_tokens_seen`: False
412
- - `neftune_noise_alpha`: None
413
- - `optim_target_modules`: None
414
- - `batch_eval_metrics`: False
415
- - `eval_on_start`: False
416
- - `use_liger_kernel`: False
417
- - `eval_use_gather_object`: False
418
- - `average_tokens_across_devices`: False
419
- - `prompts`: None
420
- - `batch_sampler`: batch_sampler
421
- - `multi_dataset_batch_sampler`: proportional
422
-
423
- </details>
424
-
425
- ### Training Logs
426
- | Epoch | Step | Training Loss | Validation Loss | cale-eval_cosine_ap |
427
- |:------:|:----:|:-------------:|:---------------:|:-------------------:|
428
- | 0 | 0 | - | - | 0.5131 |
429
- | 0.0166 | 100 | 0.2826 | - | - |
430
- | 0.0333 | 200 | 0.2505 | - | - |
431
- | 0.0499 | 300 | 0.1684 | - | - |
432
- | 0.0665 | 400 | 0.1539 | - | - |
433
- | 0.0831 | 500 | 0.1297 | 0.0598 | 0.5317 |
434
- | 0.0998 | 600 | 0.1237 | - | - |
435
- | 0.1164 | 700 | 0.1141 | - | - |
436
- | 0.1330 | 800 | 0.114 | - | - |
437
- | 0.1496 | 900 | 0.1161 | - | - |
438
- | 0.1663 | 1000 | 0.111 | 0.0561 | 0.5799 |
439
- | 0.1829 | 1100 | 0.1066 | - | - |
440
- | 0.1995 | 1200 | 0.1012 | - | - |
441
- | 0.2161 | 1300 | 0.0951 | - | - |
442
- | 0.2328 | 1400 | 0.0885 | - | - |
443
- | 0.2494 | 1500 | 0.0844 | 0.0410 | 0.7014 |
444
- | 0.2660 | 1600 | 0.0827 | - | - |
445
- | 0.2826 | 1700 | 0.0807 | - | - |
446
- | 0.2993 | 1800 | 0.0833 | - | - |
447
- | 0.3159 | 1900 | 0.079 | - | - |
448
- | 0.3325 | 2000 | 0.0778 | 0.0393 | 0.7209 |
449
- | 0.3491 | 2100 | 0.0756 | - | - |
450
- | 0.3658 | 2200 | 0.0798 | - | - |
451
- | 0.3824 | 2300 | 0.0756 | - | - |
452
- | 0.3990 | 2400 | 0.0715 | - | - |
453
- | 0.4156 | 2500 | 0.0723 | 0.0374 | 0.7374 |
454
- | 0.4323 | 2600 | 0.0728 | - | - |
455
- | 0.4489 | 2700 | 0.0719 | - | - |
456
- | 0.4655 | 2800 | 0.0724 | - | - |
457
- | 0.4821 | 2900 | 0.0674 | - | - |
458
- | 0.4988 | 3000 | 0.0683 | 0.0377 | 0.7344 |
459
- | 0.5154 | 3100 | 0.0673 | - | - |
460
- | 0.5320 | 3200 | 0.0684 | - | - |
461
- | 0.5486 | 3300 | 0.0649 | - | - |
462
- | 0.5653 | 3400 | 0.067 | - | - |
463
- | 0.5819 | 3500 | 0.0673 | 0.0373 | 0.7382 |
464
- | 0.5985 | 3600 | 0.0701 | - | - |
465
- | 0.6151 | 3700 | 0.0648 | - | - |
466
- | 0.6318 | 3800 | 0.0641 | - | - |
467
- | 0.6484 | 3900 | 0.0653 | - | - |
468
- | 0.6650 | 4000 | 0.0658 | 0.0367 | 0.7428 |
469
- | 0.6816 | 4100 | 0.0628 | - | - |
470
- | 0.6983 | 4200 | 0.0671 | - | - |
471
- | 0.7149 | 4300 | 0.0626 | - | - |
472
- | 0.7315 | 4400 | 0.0638 | - | - |
473
- | 0.7481 | 4500 | 0.0655 | 0.0370 | 0.7383 |
474
- | 0.7648 | 4600 | 0.0608 | - | - |
475
- | 0.7814 | 4700 | 0.062 | - | - |
476
- | 0.7980 | 4800 | 0.0625 | - | - |
477
- | 0.8146 | 4900 | 0.0629 | - | - |
478
- | 0.8313 | 5000 | 0.0631 | 0.0368 | 0.7409 |
479
- | 0.8479 | 5100 | 0.0619 | - | - |
480
- | 0.8645 | 5200 | 0.0623 | - | - |
481
- | 0.8811 | 5300 | 0.0623 | - | - |
482
- | 0.8978 | 5400 | 0.0631 | - | - |
483
- | 0.9144 | 5500 | 0.0588 | 0.0367 | 0.7409 |
484
- | 0.9310 | 5600 | 0.0618 | - | - |
485
- | 0.9476 | 5700 | 0.0588 | - | - |
486
- | 0.9643 | 5800 | 0.0605 | - | - |
487
- | 0.9809 | 5900 | 0.061 | - | - |
488
- | 0.9975 | 6000 | 0.0587 | 0.0367 | 0.7420 |
489
-
490
-
491
- ### Framework Versions
492
- - Python: 3.10.12
493
- - Sentence Transformers: 3.3.1
494
- - Transformers: 4.48.1
495
- - PyTorch: 2.5.1
496
- - Accelerate: 1.2.1
497
- - Datasets: 3.2.0
498
- - Tokenizers: 0.21.0
499
-
500
- ## Citation
501
-
502
- ### BibTeX
503
-
504
- #### Sentence Transformers
505
- ```bibtex
506
- @inproceedings{reimers-2019-sentence-bert,
507
- title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
508
- author = "Reimers, Nils and Gurevych, Iryna",
509
- booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
510
- month = "11",
511
- year = "2019",
512
- publisher = "Association for Computational Linguistics",
513
- url = "https://arxiv.org/abs/1908.10084",
514
- }
515
  ```
516
-
517
- #### ContrastiveLoss
518
- ```bibtex
519
- @inproceedings{hadsell2006dimensionality,
520
- author={Hadsell, R. and Chopra, S. and LeCun, Y.},
521
- booktitle={2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06)},
522
- title={Dimensionality Reduction by Learning an Invariant Mapping},
523
- year={2006},
524
- volume={2},
525
- number={},
526
- pages={1735-1742},
527
- doi={10.1109/CVPR.2006.100}
528
- }
529
- ```
530
-
531
- <!--
532
- ## Glossary
533
-
534
- *Clearly define terms in order to be accessible across audiences.*
535
- -->
536
-
537
- <!--
538
- ## Model Card Authors
539
-
540
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
541
- -->
542
-
543
- <!--
544
- ## Model Card Contact
545
-
546
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
547
- -->
 
1
  ---
2
+ license: apache-2.0
3
  tags:
4
  - sentence-transformers
5
  - sentence-similarity
6
  - feature-extraction
 
 
7
  - loss:ContrastiveLoss
8
  base_model: FacebookAI/xlm-roberta-large
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  pipeline_tag: sentence-similarity
10
+ datasets:
11
+ - gabrielloiseau/CALE-SPCD
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
+ # CALE-XLM-R
15
 
16
+ This is a [sentence-transformers](https://www.SBERT.net) model: It maps occurences of a word to a 1024 dimensional dense vector space and can be used for tasks like clustering or semantic search.
17
 
 
18
 
 
 
 
 
 
 
 
 
 
19
 
20
+ ## Usage (Sentence-Transformers)
21
 
 
 
 
 
 
 
 
 
 
 
 
22
  ```
 
 
 
 
 
 
 
 
23
  pip install -U sentence-transformers
24
  ```
25
 
26
+ Then you can use the model like this:
27
+
28
  ```python
29
  from sentence_transformers import SentenceTransformer
30
 
31
+ # 1. Load CALE model
32
  model = SentenceTransformer("gabrielloiseau/CALE-XLM-R")
33
+
34
  sentences = [
35
+ "the boy could easily <t>distinguish</t> the different note values",
36
+ "he patient’s ability to <t>recognize</t> forms and shapes",
37
+ "the government had refused to <t>recognize</t> their autonomy and existence as a state",
38
  ]
39
+
40
+ # 2. Calculate embeddings
41
  embeddings = model.encode(sentences)
42
  print(embeddings.shape)
43
  # [3, 1024]
44
 
45
+ # 3. Calculate the embedding similarities
46
  similarities = model.similarity(embeddings, embeddings)
47
+ print(similarities)
48
+ # tensor([[1.0000, 0.9332, 0.5331],
49
+ # [0.9332, 1.0000, 0.5619],
50
+ # [0.5331, 0.5619, 1.0000]])
51
  ```
52
 
53
+ ## Full Model Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ```
55
+ SentenceTransformer(
56
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
57
+ (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})
58
+ )
59
+ ```