Downloads · 30 days
65
27% of all-time downloads
srikarvar/fine_tuned_model_8
fine_tuned_model_8 is a sentence similarity model from srikarvar. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-small. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic sea…
Downloads · 30 days
65
27% of all-time downloads
All-time downloads
245
Public
Parameters
118M
493 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors471 MB · 95%
From the Hugging Face model README
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-small. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, '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})
(2): Normalize()
)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("srikarvar/fine_tuned_model_8")
# Run inference
sentences = [
'Practical guides are available to assist you in achieving specific goals and addressing real-world challenges with the framework.',
'Yes, there are practical guides to help you achieve specific objectives and solve real-world problems with the framework.',
'How to bake cookies?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# 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.*
-->
pair-class-dev| Metric | Value |
|---|---|
| cosine_accuracy | 0.9183 |
| cosine_accuracy_threshold | 0.8421 |
| cosine_f1 | 0.9208 |
| cosine_f1_threshold | 0.8421 |
| cosine_precision | 0.9037 |
| cosine_recall | 0.9385 |
| cosine_ap | 0.9453 |
| dot_accuracy | 0.9183 |
| dot_accuracy_threshold | 0.8421 |
| dot_f1 | 0.9208 |
| dot_f1_threshold | 0.8421 |
| dot_precision | 0.9037 |
| dot_recall | 0.9385 |
| dot_ap | 0.9453 |
| manhattan_accuracy | 0.9183 |
| manhattan_accuracy_threshold | 8.5071 |
| manhattan_f1 | 0.9195 |
| manhattan_f1_threshold | 8.6426 |
| manhattan_precision | 0.916 |
| manhattan_recall | 0.9231 |
| manhattan_ap | 0.9454 |
| euclidean_accuracy | 0.9183 |
| euclidean_accuracy_threshold | 0.5619 |
| euclidean_f1 | 0.9208 |
| euclidean_f1_threshold | 0.5619 |
| euclidean_precision | 0.9037 |
| euclidean_recall | 0.9385 |
| euclidean_ap | 0.9453 |
| max_accuracy | 0.9183 |
| max_accuracy_threshold | 8.5071 |
| max_f1 | 0.9208 |
| max_f1_threshold | 8.6426 |
| max_precision | 0.916 |
| max_recall | 0.9385 |
| max_ap | 0.9454 |
pair-class-test| Metric | Value |
|---|---|
| cosine_accuracy | 0.9183 |
| cosine_accuracy_threshold | 0.8421 |
| cosine_f1 | 0.9208 |
| cosine_f1_threshold | 0.8421 |
| cosine_precision | 0.9037 |
| cosine_recall | 0.9385 |
| cosine_ap | 0.9453 |
| dot_accuracy | 0.9183 |
| dot_accuracy_threshold | 0.8421 |
| dot_f1 | 0.9208 |
| dot_f1_threshold | 0.8421 |
| dot_precision | 0.9037 |
| dot_recall | 0.9385 |
| dot_ap | 0.9453 |
| manhattan_accuracy | 0.9183 |
| manhattan_accuracy_threshold | 8.5071 |
| manhattan_f1 | 0.9195 |
| manhattan_f1_threshold | 8.6426 |
| manhattan_precision | 0.916 |
| manhattan_recall | 0.9231 |
| manhattan_ap | 0.9454 |
| euclidean_accuracy | 0.9183 |
| euclidean_accuracy_threshold | 0.5619 |
| euclidean_f1 | 0.9208 |
| euclidean_f1_threshold | 0.5619 |
| euclidean_precision | 0.9037 |
| euclidean_recall | 0.9385 |
| euclidean_ap | 0.9453 |
| max_accuracy | 0.9183 |
| max_accuracy_threshold | 8.5071 |
| max_f1 | 0.9208 |
| max_f1_threshold | 8.6426 |
| max_precision | 0.916 |
| max_recall | 0.9385 |
| max_ap | 0.9454 |
| sentence2 | sentence1 | label | |
|---|---|---|---|
| type | string | string | int |
| details | <ul><li>min: 5 tokens</li><li>mean: 13.74 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.13 tokens</li><li>max: 66 tokens</li></ul> | <ul><li>0: ~43.00%</li><li>1: ~57.00%</li></ul> |
| sentence2 | sentence1 | label |
|---|---|---|
| <code>What are the components of a computer?</code> | <code>How does a computer work?</code> | <code>0</code> |
| <code>You have the option to create your own personal blog with the help of Blogging Platforms.</code> | <code>Yes, you can start your own personal blog using Blogging Platforms.</code> | <code>1</code> |
| <code>It provides the layout of the data and its components.</code> | <code>It returns the structure of the data and its fields.</code> | <code>1</code> |
| sentence2 | sentence1 | label | |
|---|---|---|---|
| type | string | string | int |
| details | <ul><li>min: 4 tokens</li><li>mean: 14.92 tokens</li><li>max: 50 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 14.84 tokens</li><li>max: 51 tokens</li></ul> | <ul><li>0: ~49.42%</li><li>1: ~50.58%</li></ul> |
| sentence2 | sentence1 | label |
|---|---|---|
| <code>What is the speed of sound in air?</code> | <code>What is the speed of light in a vacuum?</code> | <code>0</code> |
| <code>Steps to fix a leaking faucet</code> | <code>How to repair a leaking faucet?</code> | <code>1</code> |
| <code>Total bones in an adult human</code> | <code>How many bones are in the human body?</code> | <code>1</code> |
eval_strategy: epochper_device_train_batch_size: 32per_device_eval_batch_size: 32gradient_accumulation_steps: 2num_train_epochs: 4warmup_ratio: 0.1load_best_model_at_end: Trueoptim: adamw_torch_fusedbatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 2eval_accumulation_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falsebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | loss | pair-class-dev_max_ap | pair-class-test_max_ap |
|---|---|---|---|---|---|
| 0 | 0 | - | - | 0.7947 | - |
| 0.2740 | 10 | 1.6052 | - | - | - |
| 0.5479 | 20 | 0.8914 | - | - | - |
| 0.8219 | 30 | 0.8434 | - | - | - |
| 0.9863 | 36 | - | 0.6144 | 0.9366 | - |
| 1.0959 | 40 | 0.7351 | - | - | - |
| 1.3699 | 50 | 0.5016 | - | - | - |
| 1.6438 | 60 | 0.3754 | - | - | - |
| 1.9178 | 70 | 0.3364 | - | - | - |
| 2.0 | 73 | - | 0.5985 | 0.9396 | - |
| 2.1918 | 80 | 0.3456 | - | - | - |
| 2.4658 | 90 | 0.1953 | - | - | - |
| 2.7397 | 100 | 0.1186 | - | - | - |
| 2.9863 | 109 | - | 0.5853 | 0.9455 | - |
| 3.0137 | 110 | 0.1622 | - | - | - |
| 3.2877 | 120 | 0.1863 | - | - | - |
| 3.5616 | 130 | 0.0906 | - | - | - |
| 3.8356 | 140 | 0.1035 | - | - | - |
| 3.9452 | 144 | - | 0.5461 | 0.9454 | 0.9454 |
@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.*
-->