CoolFace
Modelpublic

dbourget/pb-ds1-48K-philsim

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes88downloads
Model Card

SentenceTransformer based on dbourget/pb-ds1-48K

This is a sentence-transformers model finetuned from dbourget/pb-ds1-48K. 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.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: dbourget/pb-ds1-48K <!-- at revision fcd4aeedcdc3ad836820d47fd28ffd2529914647 -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 768 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': 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})
)

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-ds1-48K-philsim")
# Run inference
sentences = [
    'This essay explores the historical and modern perspectives on the Gettier problem, highlighting the connections between this issue, skepticism, and relevance. Through methods such as historical analysis, induction, and deduction, it is found that while contextual theories and varying definitions of knowledge do not fully address skeptical challenges, they can help clarify our understanding of knowledge. Ultimately, embracing subjectivity and intuition can provide insight into what it truly means to claim knowledge.',
    'Objective: In this essay,  I will try to track some historical and modern stages of the discussion on the Gettier problem, and point out the interrelations of the questions that this problem raises for epistemologists, with sceptical arguments, and a so-called problem of relevance. Methods: historical analysis, induction, generalization, deduction, discourse, intuition results: Albeit the contextual theories of knowledge, the use of different definitions of knowledge, and the different ways of the uses of knowledge do not resolve all the issues that the sceptic can put forward, but they can be productive in giving clarity to a concept of knowledge for us. On the other hand, our knowledge will always have an element of intuition and subjectivity, however not equating to epistemic luck and probability.  Significance novelty: the approach to the context in general, not giving up being a Subject may give us a clarity about the sense of what it means to say – “I know”.',
    "Teaching competency in bioethics has been a concern since the field's inception. The first report on the teaching of contemporary bioethics was published in 1976 by The Hastings Center, which concluded that graduate programs were not necessary at the time. However, the report speculated that future developments may require new academic structures for graduate education in bioethics. The creation of a terminal degree in bioethics has its critics, with scholars debating whether bioethics is a discipline with its own methods and theoretical grounding, a multidisciplinary field, or something else entirely. Despite these debates, new bioethics training programs have emerged at all postsecondary levels in the U.S. This essay examines the number and types of programs and degrees in this growing field.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# 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

Semantic Similarity
MetricValue
pearson_cosine0.9378
spearman_cosine0.8943
pearson_manhattan0.971
spearman_manhattan0.8969
pearson_euclidean0.9711
spearman_euclidean0.8966
pearson_dot0.942
spearman_dot0.8551
pearson_max0.9711
spearman_max0.8969

<!--

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: 190
  • —per_device_eval_batch_size: 190
  • —learning_rate: 5e-06
  • —num_train_epochs: 2
  • —warmup_ratio: 0.1
  • —bf16: True
  • —batch_sampler: no_duplicates
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: 190
  • —per_device_eval_batch_size: 190
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —learning_rate: 5e-06
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1.0
  • —num_train_epochs: 2
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.1
  • —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: False
  • —dataloader_num_workers: 0
  • —dataloader_prefetch_factor: None
  • —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: None
  • —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
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

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

EpochStepTraining Losslosssts-dev_spearman_cosine
00--0.8229
0.0178100.0545--
0.0355200.0556--
0.0533300.0502--
0.0710400.0497--
0.0888500.0413--
0.1066600.0334--
0.1243700.0238--
0.1421800.0206--
0.1599900.0167--
0.17761000.01460.07250.8788
0.19541100.0127--
0.21311200.0125--
0.23091300.0115--
0.24871400.0116--
0.26641500.0111--
0.28421600.0107--
0.30201700.0113--
0.31971800.0106--
0.33751900.0099--
0.35522000.00920.02070.8856
0.37302100.0097--
0.39082200.0099--
0.40852300.0087--
0.42632400.0087--
0.44402500.0082--
0.46182600.0083--
0.47962700.0089--
0.49732800.0082--
0.51512900.0078--
0.53293000.00810.00780.8891
0.55063100.0081--
0.56843200.0072--
0.58613300.0084--
0.60393400.0083--
0.62173500.0078--
0.63943600.0077--
0.65723700.008--
0.67503800.0073--
0.69273900.008--
0.71054000.00730.00580.8890
0.72824100.0075--
0.74604200.0077--
0.76384300.0074--
0.78154400.0073--
0.79934500.007--
0.81714600.0043--
0.83484700.0052--
0.85264800.0046--
0.87034900.0073--
0.88815000.00560.00690.8922
0.90595100.0059--
0.92365200.0045--
0.94145300.0033--
0.95915400.0058--
0.97695500.0056--
0.99475600.0046--
1.01245700.003--
1.03025800.0039--
1.04805900.0032--
1.06576000.00310.00290.8931
1.08356100.0046--
1.10126200.003--
1.11906300.0021--
1.13686400.0031--
1.15456500.0035--
1.17236600.0033--
1.19016700.0024--
1.20786800.0012--
1.22566900.0075--
1.24337000.00280.00360.8945
1.26117100.0033--
1.27897200.0023--
1.29667300.0034--
1.31447400.0018--
1.33217500.0016--
1.34997600.0025--
1.36777700.002--
1.38547800.0016--
1.40327900.0018--
1.42108000.0030.00270.8944
1.43878100.0018--
1.45658200.0008--
1.47428300.0014--
1.49208400.0025--
1.50988500.0026--
1.52758600.0012--
1.54538700.001--
1.56318800.001--
1.58088900.0012--
1.59869000.00210.00210.8952
1.61639100.0016--
1.63419200.0008--
1.65199300.0008--
1.66969400.0009--
1.68749500.0004--
1.70529600.0003--
1.72299700.0007--
1.74079800.0007--
1.75849900.0011--
1.776210000.00070.00290.8952
1.794010100.0008--
1.811710200.001--
1.829510300.0006--
1.847210400.0006--
1.865010500.0015--
1.882810600.0009--
1.900510700.0005--
1.918310800.0006--
1.936110900.0021--
1.953811000.00090.00230.8943
1.971611100.0007--
1.989311200.0003--

</details>

Framework Versions

  • —Python: 3.10.12
  • —Sentence Transformers: 3.0.1
  • —Transformers: 4.42.3
  • —PyTorch: 2.2.0+cu121
  • —Accelerate: 0.31.0
  • —Datasets: 2.20.0
  • —Tokenizers: 0.19.1

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",
}

<!--

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. -->