SentenceTransformer based on nomic-ai/nomic-embed-text-v1.5
This is a sentence-transformers model finetuned from nomic-ai/nomic-embed-text-v1.5. 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: nomic-ai/nomic-embed-text-v1.5
- Maximum Sequence Length: 8192 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False, 'architecture': 'NomicBertModel'})
(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:
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
sentences = [
'search_query: quality inspection rejected but material received',
'search_document: [FIELD] quality_inspection | [TABLE] tabPurchase Receipt Item',
'search_document: [FIELD] delivery_date | [TABLE] tabSales Order',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.7248, 0.0996],
# [0.7248, 1.0000, 0.2103],
# [0.0996, 0.2103, 1.0000]])
Evaluation
Metrics
Information Retrieval
- Dataset:
erp-val - Evaluated with
InformationRetrievalEvaluator
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5228 |
| cosine_accuracy@5 | 0.7842 |
| cosine_accuracy@12 | 0.8759 |
| cosine_precision@12 | 0.1248 |
| cosine_recall@12 | 0.8324 |
| cosine_ndcg@10 | 0.6569 |
| cosine_mrr@10 | 0.6305 |
| cosine_map@10 | 0.5873 |
| cosine_map@12 | 0.5905 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 128,055 training samples
- Columns:
sentence_0andsentence_1 - Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 type string string details - min: 9 tokens
- mean: 15.81 tokens
- max: 34 tokens
- min: 11 tokens
- mean: 19.35 tokens
- max: 49 tokens
- Samples:
sentence_0 sentence_1 search_query: where's the list of folks on leave?search_document: [FIELD] status | [TABLE] tabLeave Applicationsearch_query: 2 barcodes samesearch_document: [FIELD] barcode | [TABLE] tabItem Barcodesearch_query: customers who havenโt bought last 12 mosearch_document: [FIELD] posting_date | [TABLE] tabSales Invoice - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 40.0, "similarity_fct": "cos_sim", "gather_across_devices": false }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 48per_device_eval_batch_size: 48num_train_epochs: 4fp16: Truemulti_dataset_batch_sampler: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 48per_device_eval_batch_size: 48per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 4max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Falsebf16: Falsefp16: Truefp16_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: Falseignore_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_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: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | erp-val_cosine_ndcg@10 |
|---|---|---|---|
| -1 | -1 | - | 0.4109 |
| 0.0562 | 150 | - | 0.5393 |
| 0.1124 | 300 | - | 0.5979 |
| 0.1687 | 450 | - | 0.6070 |
| 0.1874 | 500 | 2.226 | - |
| 0.2249 | 600 | - | 0.6149 |
| 0.2811 | 750 | - | 0.6232 |
| 0.3373 | 900 | - | 0.6207 |
| 0.3748 | 1000 | 1.557 | - |
| 0.3936 | 1050 | - | 0.6333 |
| 0.4498 | 1200 | - | 0.6410 |
| 0.5060 | 1350 | - | 0.6392 |
| 0.5622 | 1500 | 1.3475 | 0.6439 |
| 0.6184 | 1650 | - | 0.6402 |
| 0.6747 | 1800 | - | 0.6405 |
| 0.7309 | 1950 | - | 0.6465 |
| 0.7496 | 2000 | 1.249 | - |
| 0.7871 | 2100 | - | 0.6439 |
| 0.8433 | 2250 | - | 0.6465 |
| 0.8996 | 2400 | - | 0.6377 |
| 0.9370 | 2500 | 1.1999 | - |
| 0.9558 | 2550 | - | 0.6418 |
| 1.0 | 2668 | - | 0.6400 |
| 1.0120 | 2700 | - | 0.6414 |
| 1.0682 | 2850 | - | 0.6565 |
| 1.1244 | 3000 | 1.1002 | 0.6475 |
| 1.1807 | 3150 | - | 0.6440 |
| 1.2369 | 3300 | - | 0.6449 |
| 1.2931 | 3450 | - | 0.6540 |
| 1.3118 | 3500 | 1.0786 | - |
| 1.3493 | 3600 | - | 0.6492 |
| 1.4055 | 3750 | - | 0.6521 |
| 1.4618 | 3900 | - | 0.6511 |
| 1.4993 | 4000 | 1.0513 | - |
| 1.5180 | 4050 | - | 0.6595 |
| 1.5742 | 4200 | - | 0.6512 |
| 1.6304 | 4350 | - | 0.6456 |
| 1.6867 | 4500 | 1.0218 | 0.6508 |
| 1.7429 | 4650 | - | 0.6500 |
| 1.7991 | 4800 | - | 0.6405 |
| 1.8553 | 4950 | - | 0.6612 |
| 1.8741 | 5000 | 1.0101 | - |
| 1.9115 | 5100 | - | 0.6462 |
| 1.9678 | 5250 | - | 0.6571 |
| 2.0 | 5336 | - | 0.6616 |
| 2.0240 | 5400 | - | 0.6654 |
| 2.0615 | 5500 | 0.977 | - |
| 2.0802 | 5550 | - | 0.6554 |
| 2.1364 | 5700 | - | 0.6536 |
| 2.1927 | 5850 | - | 0.6614 |
| 2.2489 | 6000 | 0.9208 | 0.6629 |
| 2.3051 | 6150 | - | 0.6576 |
| 2.3613 | 6300 | - | 0.6503 |
| 2.4175 | 6450 | - | 0.6630 |
| 2.4363 | 6500 | 0.935 | - |
| 2.4738 | 6600 | - | 0.6509 |
| 2.5300 | 6750 | - | 0.6570 |
| 2.5862 | 6900 | - | 0.6485 |
| 2.6237 | 7000 | 0.9224 | - |
| 2.6424 | 7050 | - | 0.6508 |
| 2.6987 | 7200 | - | 0.6587 |
| 2.7549 | 7350 | - | 0.6578 |
| 2.8111 | 7500 | 0.9068 | 0.6563 |
| 2.8673 | 7650 | - | 0.6565 |
| 2.9235 | 7800 | - | 0.6612 |
| 2.9798 | 7950 | - | 0.6608 |
| 2.9985 | 8000 | 0.9139 | - |
| 3.0 | 8004 | - | 0.6588 |
| 3.0360 | 8100 | - | 0.6579 |
| 3.0922 | 8250 | - | 0.6526 |
| 3.1484 | 8400 | - | 0.6567 |
| 3.1859 | 8500 | 0.8468 | - |
| 3.2046 | 8550 | - | 0.6553 |
| 3.2609 | 8700 | - | 0.6562 |
| 3.3171 | 8850 | - | 0.6570 |
| 3.3733 | 9000 | 0.8638 | 0.6551 |
| 3.4295 | 9150 | - | 0.6551 |
| 3.4858 | 9300 | - | 0.6551 |
| 3.5420 | 9450 | - | 0.6564 |
| 3.5607 | 9500 | 0.8388 | - |
| 3.5982 | 9600 | - | 0.6563 |
| 3.6544 | 9750 | - | 0.6568 |
| 3.7106 | 9900 | - | 0.6564 |
| 3.7481 | 10000 | 0.8544 | - |
| 3.7669 | 10050 | - | 0.6568 |
| 3.8231 | 10200 | - | 0.6561 |
| 3.8793 | 10350 | - | 0.6567 |
| 3.9355 | 10500 | 0.8349 | 0.6569 |
Framework Versions
- Python: 3.12.12
- Sentence Transformers: 5.1.2
- Transformers: 4.57.2
- PyTorch: 2.9.0+cu126
- Accelerate: 1.12.0
- Datasets: 4.0.0
- Tokenizers: 0.22.1
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",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 732
Model tree for hyrinmansoor/changAI-nomic-embed-text-v1.5-finetuned
Base model
nomic-ai/nomic-embed-text-v1.5Evaluation results
- Cosine Accuracy@1 on erp valself-reported0.523
- Cosine Accuracy@5 on erp valself-reported0.784
- Cosine Accuracy@12 on erp valself-reported0.876
- Cosine Precision@12 on erp valself-reported0.125
- Cosine Recall@12 on erp valself-reported0.832
- Cosine Ndcg@10 on erp valself-reported0.657
- Cosine Mrr@10 on erp valself-reported0.630
- Cosine Map@10 on erp valself-reported0.587
- Cosine Map@12 on erp valself-reported0.590