CoolFace
Modelpublic

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

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

SentenceTransformer based on dbourget/philai-embeddings-2.0

This is a sentence-transformers model finetuned from dbourget/philai-embeddings-2.0. 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/philai-embeddings-2.0 <!-- at revision d9add3b37c9bea5883418ac3f1d45cb29fe3a1dc -->
  • —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-30e")
# 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.8215
dot_accuracy0.2449
manhattan_accuracy0.835
euclidean_accuracy0.8342
max_accuracy0.835

<!--

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: 1e-06
  • —weight_decay: 0.01
  • —num_train_epochs: 20
  • —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: 1e-06
  • —weight_decay: 0.01
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 20
  • —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_max_accuracy
00--0.8308
0.1471101.056--
0.2941201.0992--
0.4412301.1678--
0.5882401.1586--
0.7353501.17772.07930.8291
0.8824601.1344--
1.0294701.0578--
1.1765801.0981--
1.3235901.1216--
1.47061001.04362.08260.8283
1.61761101.0422--
1.76471201.0857--
1.91181301.0502--
2.05881401.0363--
2.20591501.0812.07630.8316
2.35291601.1764--
2.51701.0393--
2.64711800.9586--
2.79411901.0537--
2.94122001.03132.06450.8325
3.08822101.0401--
3.23532201.0389--
3.38242301.0225--
3.52942401.0131--
3.67652500.95652.07050.8308
3.82352601.0059--
3.97062700.9629--
4.11762800.9546--
4.26472900.989--
4.41183001.05732.05140.8375
4.55883100.894--
4.70593201.0082--
4.85293300.969--
5.03400.9187--
5.14713500.90342.06630.8350
5.29413600.9043--
5.44123700.9517--
5.58823801.0272--
5.73533900.95--
5.88244000.82882.04000.8367
6.02944100.9809--
6.17654200.8776--
6.32354300.9744--
6.47064400.9982--
6.61764500.90762.04290.8350
6.76474600.8792--
6.91184700.787--
7.05884800.9506--
7.20594900.927--
7.35295000.94642.04870.8316
7.55100.886--
7.64715200.9142--
7.79415300.8741--
7.94125400.8703--
8.08825500.89472.04110.8333
8.23535600.8742--
8.38245700.8083--
8.52945800.9134--
8.67655900.8197--
8.82356000.82532.02720.8367
8.97066100.8665--
9.11766200.8853--
9.26476300.7566--
9.41186400.9101--
9.55886500.8012.02430.8350
9.70596600.8551--
9.85296700.8748--
10.06800.9798--
10.14716901.0544--
10.29417001.20772.01280.8367
10.44127101.0386--
10.58827201.0508--
10.73537301.0063--
10.88247401.0758--
11.02947501.15522.00310.8367
11.17657601.0259--
11.32357701.0724--
11.47067801.0524--
11.61767900.9957--
11.76478001.06972.00220.8367
11.91188101.0544--
12.05888201.0762--
12.20598301.0858--
12.35298401.0418--
12.58501.00411.99360.8392
12.64718600.998--
12.79418701.0737--
12.94128801.0637--
13.08828900.9689--
13.23539001.0011.98180.8392
13.38249101.0418--
13.52949201.0097--
13.67659301.0244--
13.82359401.0383--
13.97069501.0341.97980.8367
14.11769600.9609--
14.26479701.049--
14.41189801.0012--
14.55889900.9008--
14.705910001.01311.97410.8384
14.852910100.9714--
15.010200.9987--
15.147110301.1139--
15.294110401.005--
15.441210500.90741.97610.8359
15.588210600.9298--
15.735310700.9335--
15.882410800.9445--
16.029410901.0087--
16.176511000.91871.96790.8384
16.323511100.8502--
16.470611200.9924--
16.617611300.9982--
16.764711400.9643--
16.911811500.94911.97270.8333
17.058811600.9801--
17.205911700.9374--
17.352911800.8309--
17.511900.9524--
17.647112000.8861.97970.8350
17.794112100.9026--
17.941212200.8859--
18.088212300.8745--
18.235312400.9474--
18.382412500.8781.97370.8342
18.529412600.8372--
18.676512700.833--
18.823512800.9648--
18.970612900.918--
19.117613000.95881.96690.8359
19.264713101.0334--
19.411813200.8347--
19.558813300.828--
19.705913400.9117--
19.852913500.91231.96660.8350
20.013600.8538--

</details>

Framework Versions

  • —Python: 3.8.18
  • —Sentence Transformers: 3.1.1
  • —Transformers: 4.45.0
  • —PyTorch: 1.13.1+cu117
  • —Accelerate: 0.34.2
  • —Datasets: 3.0.1
  • —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. -->