Downloads · 30 days
5
11% of all-time downloads
kwondw/bert-base-uncased-gooaq-unsloth-tiny
bert-base-uncased-gooaq-unsloth-tiny is a sentence similarity model from kwondw. 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 google-bert/bert-base-uncased on the gooaq dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
Downloads · 30 days
5
11% of all-time downloads
All-time downloads
45
Public
Repo size
42.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors42.9 MB · 98%
From the Hugging Face model README
This is a sentence-transformers model finetuned from google-bert/bert-base-uncased on the gooaq dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'PeftModelForFeatureExtraction'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)
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("kwondw/bert-base-uncased-gooaq-unsloth-tiny")
# Run inference
queries = [
'how much did it cost to build your own house?',
]
documents = [
'According to HomeAdvisor.com, an online marketplace that connects homeowners with home improvement professionals, the average cost to build a new house is a little over $290,000. But that cost can vary greatly. They go on to report that the average cost of building a house is around $147,000 to as much as $436,000.',
"['Connect your external hard drive to an Xbox One USB port. ... ', 'Select Format storage device.', 'Enter a name for the drive using the on-screen keyboard.', 'Select Install new things here to automatically install future games on this drive.', 'Select Format storage device.']",
'When wearing cowboy boots, your pants should come down to the foot of the boot or a little longer. They should not be long enough to drag on the floor, however, or too short. Keep in mind that most cowboy boots have a taller heel than regular shoes, as much as one or even two inches.',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.7040, 0.5361, 0.5989]])
<!--
### 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.*
-->
NanoMSMARCO| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.04 |
| cosine_accuracy@3 | 0.16 |
| cosine_accuracy@5 | 0.22 |
| cosine_accuracy@10 | 0.3 |
| cosine_precision@1 | 0.04 |
| cosine_precision@3 | 0.0533 |
| cosine_precision@5 | 0.044 |
| cosine_precision@10 | 0.03 |
| cosine_recall@1 | 0.04 |
| cosine_recall@3 | 0.16 |
| cosine_recall@5 | 0.22 |
| cosine_recall@10 | 0.3 |
| cosine_ndcg@10 | 0.1622 |
| cosine_mrr@10 | 0.1189 |
| cosine_map@100 | 0.1394 |
NanoMSMARCO| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.04 |
| cosine_accuracy@3 | 0.16 |
| cosine_accuracy@5 | 0.22 |
| cosine_accuracy@10 | 0.3 |
| cosine_precision@1 | 0.04 |
| cosine_precision@3 | 0.0533 |
| cosine_precision@5 | 0.044 |
| cosine_precision@10 | 0.03 |
| cosine_recall@1 | 0.04 |
| cosine_recall@3 | 0.16 |
| cosine_recall@5 | 0.22 |
| cosine_recall@10 | 0.3 |
| cosine_ndcg@10 | 0.1622 |
| cosine_mrr@10 | 0.1189 |
| cosine_map@100 | 0.1394 |
| question | answer | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 8 tokens</li><li>mean: 12.4 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 20 tokens</li><li>mean: 61.34 tokens</li><li>max: 140 tokens</li></ul> |
| question | answer |
|---|---|
| <code>is trazodone good for anxiety?</code> | <code>About trazodone Trazodone is an antidepressant medicine that works to balance chemicals in the brain. It's used to treat depression, anxiety, or a combination of depression and anxiety. It can help if you're having problems like low mood, poor sleep and poor concentration.</code> |
| <code>what mental disorder does hannibal lecter have?</code> | <code>Hannibal Lecter Both a talented psychiatrist and cannibalistic serial killer, the majority of Lecter's personality traits and behaviors can be categorized as evidence of ASPD. He can be specifically categorized as a malevolent antisocial due to his striking lack of remorse of guilt.</code> |
| <code>what is the apple watch nike series?</code> | <code>Get connected through sport. Apple Watch Nike is the perfect running partner with the Nike Run Club app. Featuring a world of workouts, coaching and motivation to help take your fitness to the next level. And with Apple Watch Series 5, every Nike watch face is optimised for the Always-On Retina display.</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
| question | answer | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 8 tokens</li><li>mean: 12.04 tokens</li><li>max: 21 tokens</li></ul> | <ul><li>min: 13 tokens</li><li>mean: 59.94 tokens</li><li>max: 127 tokens</li></ul> |
| question | answer |
|---|---|
| <code>what are the four main controls on a noise gate?</code> | <code>Noise gates usually have five main parameters: threshold, ratio (reduction), attack, hold and release. Threshold – this sets the level at which the gate opens to let the sound through.</code> |
| <code>is uncut gems on amazon prime?</code> | <code>Excited for the international release of Uncut Gems on Netflix tomorrow. ... Generally, Amazon Prime Video gets A24 movies between six and seven months after they are released in cinemas, which would fit the Safdie brothers' statement that Uncut Gems will be streaming in summer 2020.</code> |
| <code>how many days a week do you workout?</code> | <code>You need to be hitting the weights at least three days per week. The research says that at the very least, training a minimum of two days per week is needed to maximize muscle growth. How you structure your workouts and the amount of days you devote to strength training depends on your current fitness level.</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 8,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
num_train_epochs: 1learning_rate: 2e-05warmup_steps: 0.1fp16: Truebatch_sampler: no_duplicatesper_device_train_batch_size: 8num_train_epochs: 1max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: trackioper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Truedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_backend: Noneddp_timeout: 1800fsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}deepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_cosine_ndcg@10 |
|---|---|---|---|---|
| -1 | -1 | - | - | 0.1610 |
| 0.125 | 1 | 0.8378 | - | - |
| 0.25 | 2 | 0.6934 | 0.5679 | 0.1602 |
| 0.375 | 3 | 0.6606 | - | - |
| 0.5 | 4 | 0.5401 | 0.5417 | 0.1628 |
| 0.625 | 5 | 0.4406 | - | - |
| 0.75 | 6 | 0.7313 | 0.5256 | 0.1622 |
| 0.875 | 7 | 0.4173 | - | - |
| 1.0 | 8 | 0.4489 | 0.5186 | 0.1622 |
| -1 | -1 | - | - | 0.1622 |
@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",
}
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
<!--
## 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.*
-->