CoolFace
Modelpublic

dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-50e

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes78downloads
Model Card

SentenceTransformer based on dbourget/pb-small-10e-tsdae6e-philsim-cosine-3e-pt1

This is a sentence-transformers model finetuned from dbourget/pb-small-10e-tsdae6e-philsim-cosine-3e-pt1. 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.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: dbourget/pb-small-10e-tsdae6e-philsim-cosine-3e-pt1 <!-- at revision e3be09e156ca8e2b7b4e5d296fc50a316393eda3 -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 1024 tokens
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("dbourget/pb-small-10e-tsdae6e-philsim-cosine-6e-beatai-cosine-50e")
# Run inference
sentences = [
    'scientific revolutions',
    'paradigm shifts',
    'scientific realism',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Triplet
MetricValue
cosine_accuracy0.7929
dot_accuracy0.2542
manhattan_accuracy0.8022
euclidean_accuracy0.8013
max_accuracy0.8022

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Hyperparameters

Non-Default Hyperparameters
  • —eval_strategy: steps
  • —per_device_train_batch_size: 138
  • —per_device_eval_batch_size: 138
  • —learning_rate: 5e-07
  • —weight_decay: 0.01
  • —num_train_epochs: 50
  • —lr_scheduler_type: constant
  • —bf16: True
  • —dataloader_drop_last: True
  • —resume_from_checkpoint: True
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 138
  • —per_device_eval_batch_size: 138
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 5e-07
  • —weight_decay: 0.01
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 50
  • —max_steps: -1
  • —lr_scheduler_type: constant
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0
  • —warmup_steps: 0
  • —log_level: passive
  • —log_level_replica: warning
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —save_safetensors: True
  • —save_on_each_node: False
  • —save_only_model: False
  • —restore_callback_states_from_checkpoint: False
  • —no_cuda: False
  • —use_cpu: False
  • —use_mps_device: False
  • —seed: 42
  • —data_seed: None
  • —jit_mode_eval: False
  • —use_ipex: False
  • —bf16: True
  • —fp16: False
  • —fp16_opt_level: O1
  • —half_precision_backend: auto
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —local_rank: 0
  • —ddp_backend: None
  • —tpu_num_cores: None
  • —tpu_metrics_debug: False
  • —debug: []
  • —dataloader_drop_last: True
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: 2
  • —past_index: -1
  • —disable_tqdm: False
  • —remove_unused_columns: True
  • —label_names: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —fsdp: []
  • —fsdp_min_num_params: 0
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —optim_args: None
  • —adafactor: False
  • —group_by_length: False
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —skip_memory_metrics: True
  • —use_legacy_prediction_loop: False
  • —push_to_hub: False
  • —resume_from_checkpoint: True
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —eval_do_concat_batches: True
  • —fp16_backend: auto
  • —push_to_hub_model_id: None
  • —push_to_hub_organization: None
  • —mp_parameters:
  • —auto_find_batch_size: False
  • —full_determinism: False
  • —torchdynamo: None
  • —ray_scope: last
  • —ddp_timeout: 1800
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —dispatch_batches: None
  • —split_batches: None
  • —include_tokens_per_second: False
  • —include_num_input_tokens_seen: False
  • —neftune_noise_alpha: None
  • —optim_target_modules: None
  • —batch_eval_metrics: False
  • —eval_on_start: False
  • —use_liger_kernel: False
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Losslossbeatai-dev_cosine_accuracy
00--0.4764
0.1471100.2061--
0.2941200.2048--
0.4412300.204--
0.5882400.202--
0.7353500.20190.20100.5219
0.8824600.2017--
1.0294700.1954--
1.1765800.1959--
1.3235900.1941--
1.47061000.19370.19290.5598
1.61761100.1923--
1.76471200.1893--
1.91181300.1861--
2.05881400.1842--
2.20591500.18180.18140.5985
2.35291600.1834--
2.51700.1729--
2.64711800.1726--
2.79411900.1668--
2.94122000.16220.16530.6330
3.08822100.1604--
3.23532200.1572--
3.38242300.159--
3.52942400.1567--
3.67652500.14810.15620.6532
3.82352600.148--
3.97062700.1492--
4.11762800.1528--
4.26472900.1437--
4.41183000.14810.14900.6658
4.55883100.1386--
4.70593200.1413--
4.85293300.1407--
5.03400.1387--
5.14713500.14230.14380.6717
5.29413600.1376--
5.44123700.1314--
5.58823800.1416--
5.73533900.1284--
5.88244000.13750.13940.6801
6.02944100.1308--
6.17654200.1286--
6.32354300.1326--
6.47064400.1356--
6.61764500.12980.13610.6877
6.76474600.1242--
6.91184700.1299--
7.05884800.1279--
7.20594900.1234--
7.35295000.12980.13330.7045
7.55100.1252--
7.64715200.1248--
7.79415300.1241--
7.94125400.126--
8.08825500.12520.13160.7071
8.23535600.1237--
8.38245700.1205--
8.52945800.1195--
8.67655900.1187--
8.82356000.11870.12930.7138
8.97066100.1269--
9.11766200.1261--
9.26476300.1182--
9.41186400.1219--
9.55886500.11730.12760.7172
9.70596600.1182--
9.85296700.122--
10.06800.1179--
10.14716900.1137--
10.29417000.12480.12610.7247
10.44127100.1162--
10.58827200.1166--
10.73537300.1111--
10.88247400.115--
11.02947500.11750.12470.7298
11.17657600.1136--
11.32357700.1172--
11.47067800.1158--
11.61767900.1142--
11.76478000.10970.12360.7332
11.91188100.1161--
12.05888200.1153--
12.20598300.1114--
12.35298400.1133--
12.58500.11040.12260.7332
12.64718600.1093--
12.79418700.1157--
12.94128800.1127--
13.08828900.1115--
13.23539000.11090.12140.7323
13.38249100.1125--
13.52949200.1097--
13.67659300.1124--
13.82359400.114--
13.97069500.110.12040.7382
14.11769600.1049--
14.26479700.1128--
14.41189800.1109--
14.55889900.1087--
14.705910000.10790.11960.7382
14.852910100.1077--
15.010200.1061--
15.147110300.1101--
15.294110400.1087--
15.441210500.1060.11860.7399
15.588210600.1047--
15.735310700.1048--
15.882410800.103--
16.029410900.1064--
16.176511000.10290.11790.7433
16.323511100.1033--
16.470611200.1066--
16.617611300.1095--
16.764711400.1031--
16.911811500.10.11720.7466
17.058811600.1056--
17.205911700.1033--
17.352911800.102--
17.511900.1083--
17.647112000.09710.11640.7458
17.794112100.1016--
17.941212200.1033--
18.088212300.0987--
18.235312400.1062--
18.382412500.09250.11570.7475
18.529412600.1028--
18.676512700.1012--
18.823512800.1027--
18.970612900.1026--
19.117613000.10230.11480.7508
19.264713100.1053--
19.411813200.0981--
19.558813300.0975--
19.705913400.1006--
19.852913500.09910.11410.7508
20.013600.0994--
20.147113700.0998--
20.294113800.1014--
20.441213900.0986--
20.588214000.0980.11330.7525
20.735314100.101--
20.882414200.098--
21.029414300.1041--
21.176514400.0979--
21.323514500.10060.11260.7559
21.470614600.097--
21.617614700.0985--
21.764714800.0956--
21.911814900.0993--
22.058815000.09430.11200.7551
22.205915100.0977--
22.352915200.0998--
22.515300.0977--
22.647115400.099--
22.794115500.09250.11130.7576
22.941215600.0929--
23.088215700.0965--
23.235315800.0896--
23.382415900.0993--
23.529416000.09410.11090.7576
23.676516100.0927--
23.823516200.0994--
23.970616300.0956--
24.117616400.0947--
24.264716500.09270.11030.7576
24.411816600.0935--
24.558816700.0996--
24.705916800.0903--
24.852916900.0916--
25.017000.09510.10960.7584
25.147117100.0924--
25.294117200.0952--
25.441217300.0954--
25.588217400.0968--
25.735317500.09420.10900.7593
25.882417600.0913--
26.029417700.0931--
26.176517800.0872--
26.323517900.0915--
26.470618000.09370.10850.7601
26.617618100.0971--
26.764718200.0944--
26.911818300.0908--
27.058818400.089--
27.205918500.09440.10820.7626
27.352918600.0926--
27.518700.087--
27.647118800.0904--
27.794118900.0886--
27.941219000.09420.10770.7635
28.088219100.0947--
28.235319200.0857--
28.382419300.0908--
28.529419400.0943--
28.676519500.09020.10710.7668
28.823519600.0909--
28.970619700.0897--
29.117619800.0924--
29.264719900.0909--
29.411820000.08950.10660.7652
29.558820100.0832--
29.705920200.0883--
29.852920300.0935--
30.020400.09--
30.147120500.08910.10600.7677
30.294120600.0978--
30.441220700.0894--
30.588220800.0893--
30.735320900.0815--
30.882421000.08890.10580.7660
31.029421100.0801--
31.176521200.0922--
31.323521300.0868--
31.470621400.0858--
31.617621500.08620.10550.7685
31.764721600.0861--
31.911821700.0896--
32.058821800.0877--
32.205921900.0864--
32.352922000.09210.10500.7694
32.522100.082--
32.647122200.0902--
32.794122300.0825--
32.941222400.0829--
33.088222500.08590.10460.7694
33.235322600.0847--
33.382422700.0829--
33.529422800.0841--
33.676522900.0833--
33.823523000.08990.10420.7710
33.970623100.0789--
34.117623200.0809--
34.264723300.0835--
34.411823400.0816--
34.558823500.08030.10380.7744
34.705923600.0808--
34.852923700.0867--
35.023800.0878--
35.147123900.0869--
35.294124000.07850.10340.7753
35.441224100.0849--
35.588224200.0832--
35.735324300.0799--
35.882424400.0813--
36.029424500.08010.10290.7753
36.176524600.0771--
36.323524700.0828--
36.470624800.0837--
36.617624900.0774--
36.764725000.08220.10260.7769
36.911825100.0845--
37.058825200.0882--
37.205925300.0802--
37.352925400.0806--
37.525500.08090.10220.7795
37.647125600.0806--
37.794125700.0788--
37.941225800.0858--
38.088225900.0791--
38.235326000.08420.10180.7795
38.382426100.0799--
38.529426200.0769--
38.676526300.0823--
38.823526400.0784--
38.970626500.08630.10160.7795
39.117626600.0751--
39.264726700.0847--
39.411826800.0784--
39.558826900.0799--
39.705927000.07710.10130.7811
39.852927100.0763--
40.027200.0783--
40.147127300.0784--
40.294127400.0761--
40.441227500.07970.10110.7837
40.588227600.0809--
40.735327700.0758--
40.882427800.0777--
41.029427900.0777--
41.176528000.08060.10060.7786
41.323528100.0852--
41.470628200.079--
41.617628300.0749--
41.764728400.0805--
41.911828500.07790.10030.7854
42.058828600.0759--
42.205928700.0794--
42.352928800.0811--
42.528900.0772--
42.647129000.07570.10010.7828
42.794129100.0781--
42.941229200.0751--
43.088229300.0752--
43.235329400.079--
43.382429500.0760.09970.7811
43.529429600.0783--
43.676529700.0774--
43.823529800.07--
43.970629900.073--
44.117630000.07620.09930.7854
44.264730100.0749--
44.411830200.0782--
44.558830300.0764--
44.705930400.0759--
44.852930500.07690.09910.7887
45.030600.0754--
45.147130700.0744--
45.294130800.0767--
45.441230900.0724--
45.588231000.07420.09890.7870
45.735331100.0745--
45.882431200.076--
46.029431300.0666--
46.176531400.0801--
46.323531500.07340.09850.7887
46.470631600.0703--
46.617631700.0772--
46.764731800.0763--
46.911831900.0718--
47.058832000.07240.09810.7904
47.205932100.0755--
47.352932200.0719--
47.532300.0742--
47.647132400.074--
47.794132500.07580.09800.7921
47.941232600.0727--
48.088232700.0676--
48.235332800.0791--
48.382432900.0751--
48.529433000.0750.09770.7887
48.676533100.0738--
48.823533200.0689--
48.970633300.0706--
49.117633400.0671--
49.264733500.07440.09740.7971
49.411833600.0739--
49.558833700.0721--
49.705933800.073--
49.852933900.0707--
50.034000.06890.09720.7929

</details>

Framework Versions

  • —Python: 3.8.18
  • —Sentence Transformers: 3.1.1
  • —Transformers: 4.45.1
  • —PyTorch: 1.13.1+cu117
  • —Accelerate: 0.34.2
  • —Datasets: 3.0.0
  • —Tokenizers: 0.20.0

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
TripletLoss
bibtex
@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->