nomic
This is a sentence-transformers model finetuned from nomic-ai/nomic-embed-text-v1.5 on the ccdb-triplets dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: nomic-ai/nomic-embed-text-v1.5
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Dataset:
- Language: en
- License: apache-2.0
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'NomicBertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
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("sentence_transformers_model_id")
# Run inference
queries = [
'On XX/XX/year>. My wallet was stolen from XXXX XXXX on XXXX XXXX, CA. They spent XXXX on my my debit card somehow without my pin. Now I filed a dispute 3 times and the bank ( chime ) and they are claiming there was no error with the transactions. I clearly got scammed and they are basically saying there is nothing they can do and kick rocks. Their specialist claimed they throughly investigated but clearly they didnt do anything because I sent my police report just how they asked, and it didnt help. I needed that money and now Im left stuck',
]
documents = [
'On XX/XX/2026 @ XXXX & XXXX two fraudulent charges were made to my Chime bank account. \n\nThe amounts of {$270.00} and {$44.00} were made at a local XXXX store. \n\nMy debit card was stolen earlier that day from my driveway so I immediately called chime and they cancelled my card and assured me a new one. \n\nCreating a dispute to get my money back has been a hassle as I have been denied 3 times by Chime and keep saying no error has occurred. \n\nThey sent me their findings as to how they came to this conclusion. Which was essentially just transcripts of the previous phone calls I made to report it. No actual evidence was provided in the report. \n\nThere is also false information saying that I didnt make a police report when in fact I did, the same day of XX/XX/year>. \n\nToday I just got denied for the third time via email and am now seeking assistance from your organization. \nXX/XX/year> P.s I am willing to provide more evidence',
'Take time to review the materials ; the questions were submitted abruptly and might not be approved.',
"I am submitting this complaint regarding a medical collection account that is incorrectly appearing on my credit report, despite the CFPBs recent rule banning the inclusion of medical debt on credit reports used by lenders. \n\nOn XX/XX/year> I reviewed my credit reports and found that a medical collection account from XXXX XXXX XXXX is still being reported to EXPERIAN, EQUIFAX AND TRANSUNION. According to the CFPBs final rule effective in XXXX, medical debts should no longer appear on consumer credit reports. \n\nI've requested removal, but they have either refused or failed to take appropriate action. This incorrect reporting is negatively impacting my credit and financial opportunities.",
]
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.6088, -0.0844, -0.0697]])
Evaluation
Metrics
Triplet
Training Details
Training Dataset
ccdb-triplets
- Dataset: ccdb-triplets
- Size: 124,887 training samples
- Columns:
query, positive, and negative
- Approximate statistics based on the first 100 samples:
- Samples:
- Loss:
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
Evaluation Dataset
ccdb-triplets
- Dataset: ccdb-triplets
- Size: 26,763 evaluation samples
- Columns:
query, positive, and negative
- Approximate statistics based on the first 100 samples:
- Samples:
- Loss:
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16
num_train_epochs: 20
learning_rate: 2e-05
warmup_steps: 0.1
bf16: True
per_device_eval_batch_size: 16
load_best_model_at_end: True
seed: 777
data_seed: 777
prompts: {'query': 'search_query: ', 'positive': 'search_document: ', 'negative': 'search_document: '}
batch_sampler: no_duplicates
All Hyperparameters
Click to expand
per_device_train_batch_size: 16
num_train_epochs: 20
max_steps: -1
learning_rate: 2e-05
lr_scheduler_type: linear
lr_scheduler_kwargs: None
warmup_steps: 0.1
optim: adamw_torch_fused
optim_args: None
weight_decay: 0.0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
optim_target_modules: None
gradient_accumulation_steps: 1
average_tokens_across_devices: True
max_grad_norm: 1.0
label_smoothing_factor: 0.0
bf16: True
fp16: False
bf16_full_eval: False
fp16_full_eval: False
tf32: None
gradient_checkpointing: False
gradient_checkpointing_kwargs: None
torch_compile: False
torch_compile_backend: None
torch_compile_mode: None
use_liger_kernel: False
liger_kernel_config: None
use_cache: False
neftune_noise_alpha: None
torch_empty_cache_steps: None
auto_find_batch_size: False
log_on_each_node: True
logging_nan_inf_filter: True
include_num_input_tokens_seen: no
log_level: passive
log_level_replica: warning
disable_tqdm: False
project: huggingface
trackio_space_id: None
trackio_bucket_id: None
trackio_static_space_id: None
per_device_eval_batch_size: 16
prediction_loss_only: True
eval_on_start: False
eval_do_concat_batches: True
eval_use_gather_object: False
eval_accumulation_steps: None
include_for_metrics: []
batch_eval_metrics: False
save_only_model: False
save_on_each_node: False
enable_jit_checkpoint: False
push_to_hub: False
hub_private_repo: None
hub_model_id: None
hub_strategy: every_save
hub_always_push: False
hub_revision: None
load_best_model_at_end: True
ignore_data_skip: False
restore_callback_states_from_checkpoint: False
full_determinism: False
seed: 777
data_seed: 777
use_cpu: False
accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
parallelism_config: None
dataloader_drop_last: False
dataloader_num_workers: 0
dataloader_pin_memory: True
dataloader_persistent_workers: False
dataloader_prefetch_factor: None
dataloader_multiprocessing_context: None
dataloader_in_order: True
remove_unused_columns: True
label_names: None
train_sampling_strategy: random
length_column_name: length
ddp_find_unused_parameters: None
ddp_bucket_cap_mb: None
ddp_broadcast_buffers: False
ddp_static_graph: None
ddp_backend: None
ddp_timeout: 1800
fsdp: None
fsdp_config: None
deepspeed: None
debug: []
skip_memory_metrics: True
do_predict: False
resume_from_checkpoint: None
local_rank: -1
prompts: {'query': 'search_query: ', 'positive': 'search_document: ', 'negative': 'search_document: '}
batch_sampler: no_duplicates
multi_dataset_batch_sampler: proportional
router_mapping: {}
learning_rate_mapping: {}
warmup_ratio: None
Training Logs
- The bold row denotes the saved checkpoint.
Training Time
Framework Versions
- Python: 3.13.16
- Sentence Transformers: 5.6.0
- Transformers: 5.22.1
- PyTorch: 2.14.1+cu130
- Accelerate: 1.14.0
- Datasets: 4.8.5
- Tokenizers: 0.23.3
Citation
BibTeX
Sentence Transformers
@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",
}
CachedMultipleNegativesRankingLoss
@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}
}