This is a sentence-transformers model finetuned from answerdotai/ModernBERT-base. It maps inputs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'query_length': 32, 'document_length': 256, 'architecture': 'ModernBertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)
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("tomaarsen/modernbert-base-dense-msmarco32k-1e-4-20261014")
# Run inference
queries = [
'goldman sachs contact number',
]
documents = [
'The customer support phone number of Goldman Sachs Contact is 1-212-902-0300 (Click phone number to call).',
'Goldman Sachs Bank USA is an FDIC insured institution located in New York, NY. It was founded in 1990 and has approximately $122.68 billion in assets. Customers can open an account via one of its 5 branches.',
'The Director of Supply Chain will be responsible for ensuring supply and availability of finished goods and services to optimize customer services at the lowest... 5 days ago - save job - more... -',
]
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.6950, 0.4216, 0.0709]])
query, positive, and negative| query | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| modality | text | text | text |
| details |
|
|
|
| query | positive | negative |
|---|---|---|
what clothing do people wear in denmark guys |
While suits and other forms of Western fashion are ubiquitous in Japan, most people also wear some of the more traditional styles of Japanese clothing. For example, you often ⦠will see people wearing traditional Japanese clothing at weddings or funerals, graduations and even for the summer fireworks festivals--hanabi. You can learn about some of the different styles of Japanese clothing and--if you dare--try some of them yourself. |
Yet even the Democratic presidential candidates, who say they love or want to learn from those countries, donât seem know how they actually work. Why Weâre Not Denmark Proof that they do work is delivered every year in data-rich evaluations by the United Nations and other international bodies. |
average salary healthcare administration |
Healthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job.ealthcare Administrator Salary. (United States). A Healthcare Administrator earns an average salary of $64,821 per year. The highest paying skills associated with this job are Program Management, Budget Management, and Operations Management. Experience has a moderate effect on income for this job. |
The five states with the highest average annual salaries for health care administrators, according to May 2011 data from the BLS, are: Massachusetts, $112,690; Rhode Island, $112,260; New York, $111,270; New Jersey, $110,100; and Washington, $108,620. |
what unique characteristics does bacillus megaterium have |
Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture.Bacterium is arranged into the streptobacillus form.. Get help from a doctor now âº. Rare to none: Bacillus megaterium is a rod-shaped, gram-positive, endospore forming, aerotolerant species of bacteria used as a soil inoculant in agriculture and horticulture. Bacterium is arranged into the streptobacillus form. |
Bacillus. Bacillus is a specific genus of rod-shaped bacteria that are capable of forming spores. They are sporulating, aerobic and ubiquitous in nature. Bacillus is a fairly large group with many members, including Bacillus cereus, Bacillus clausii and Bacillus halodenitrificans.Bacillus spores, also called endospores, are resistant to harsh chemical and physical conditions. This makes the bacteria able to withstand disinfectants, radiation, desiccation and heat.acillus is a fairly large group with many members, including Bacillus cereus, Bacillus clausii and Bacillus halodenitrificans. Bacillus spores, also called endospores, are resistant to harsh chemical and physical conditions. This makes the bacteria able to withstand disinfectants, radiation, desiccation and heat. |
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 16,
"mini_batch_num_tokens": null,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
per_device_train_batch_size: 128num_train_epochs: 1learning_rate: 0.0001warmup_steps: 0.05optim: adamw_torchweight_decay: 0.01bf16: Truetf32: Truelogging_nan_inf_filter: Falsedisable_tqdm: Trueper_device_eval_batch_size: 32push_to_hub: Truehub_private_repo: Falsehub_model_id: tomaarsen/modernbert-base-dense-msmarco32k-1e-4-20261014load_best_model_at_end: Trueseed: 12data_seed: 12dataloader_num_workers: 2batch_sampler: no_duplicatesrouter_mapping: {'query': 'query', 'positive': 'document', 'negative': 'document'}per_device_train_batch_size: 128num_train_epochs: 1max_steps: -1learning_rate: 0.0001lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.05optim: adamw_torchoptim_args: Noneweight_decay: 0.01adam_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: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Truegradient_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: Falseinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Trueproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 32prediction_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: Truehub_private_repo: Falsehub_model_id: tomaarsen/modernbert-base-dense-msmarco32k-1e-4-20261014hub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 12data_seed: 12use_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: Falsedataloader_num_workers: 2dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {'query': 'query', 'positive': 'document', 'negative': 'document'}learning_rate_mapping: {}warmup_ratio: None| Epoch | Step | Training Loss |
|---|---|---|
| 0.0039 | 1 | 5.0170 |
| 0.0391 | 10 | 4.0128 |
| 0.0781 | 20 | 1.6476 |
| 0.1172 | 30 | 0.7907 |
| 0.1562 | 40 | 0.6419 |
| 0.1953 | 50 | 0.5537 |
| 0.2344 | 60 | 0.5281 |
| 0.25 | 64 | - |
| 0.2734 | 70 | 0.4631 |
| 0.3125 | 80 | 0.4749 |
| 0.3516 | 90 | 0.4538 |
| 0.3906 | 100 | 0.4319 |
| 0.4297 | 110 | 0.4422 |
| 0.4688 | 120 | 0.4082 |
| 0.5 | 128 | - |
| 0.5078 | 130 | 0.3887 |
| 0.5469 | 140 | 0.4319 |
| 0.5859 | 150 | 0.4022 |
| 0.625 | 160 | 0.3926 |
| 0.6641 | 170 | 0.3727 |
| 0.7031 | 180 | 0.3694 |
| 0.7422 | 190 | 0.3853 |
| 0.75 | 192 | - |
| 0.7812 | 200 | 0.3742 |
| 0.8203 | 210 | 0.3817 |
| 0.8594 | 220 | 0.3673 |
| 0.8984 | 230 | 0.3590 |
| 0.9375 | 240 | 0.3769 |
| 0.9766 | 250 | 0.3568 |
| 1.0 | 256 | - |
@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}
}
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}
Part of the encoder comparison. One epoch maximum on 32,768 MS MARCO triplets, seed 12. The best validation checkpoint was recovered from the repository history after a publication error. No training was repeated. See experiment.json for its original revision and validation score. Learning-rate selection uses validation only. Test data does not select checkpoints.
Dense and multi-vector use query length 32 and passage length 256 including special tokens. Rerankers use 32 query content tokens, 256 passage content tokens and a combined cap of 291. See the comparison scripts for matching input clipping. These are small-data research models.
model.safetensors 596 MBtraining_args.bin 5.8 kB