Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 32768, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, 'include_prompt': True})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6queries = [
7 "Confirm Massey-Ferguson harvester availability for Block 3A harvest scheduled for June 18.",
8]
9documents = [
10 'Subject: Agave Harvest Scheduling and Resource Coordination\nDate: 2026-01-05T10:03:00\nFrom: Javier Moreno\nParticipants: Sofia Hernandez\n\nBody:\nHi Sofia,\n\nI wanted to touch base regarding the upcoming agave harvest scheduling for the El Molino and San Pedro fields. Based on current field conditions and the lab’s recent Brix readings (average 26.5), I propose we start with Block 3A on June 18, aiming for 120 tons over three days. Please ensure the Massey-Ferguson harvester is available, and that the standard sanitation protocol for incoming loads is enforced. As always, maintaining optimal ripeness and minimizing core bruising are essential for product quality. Could you confirm equipment availability and crew scheduling?\n\nThanks for your attention to these details. Let me know if you have any concerns or require adjustments.\n\nBest,\nJavier\n\n--\nJavier Moreno\nQuality Control Manager\nDestilería Agave Spirits',
11 'Subject: Agave Supplier Delivery Schedule – Harvest Operations Planning\nDate: 2025-08-18T18:12:00\nFrom: Patricia Reeves\nParticipants: Thomas Bradford; Sarah Mitchell\n\nBody:\nDear Team,\n\nI wanted to provide an update regarding our agave sourcing and the delivery schedule for the upcoming harvest season. We have coordinated with our primary suppliers to ensure that initial deliveries will commence the week of July 10th, with subsequent shipments following a bi-weekly cadence. We are closely monitoring crop yields and weather conditions to proactively address any potential delays. Please review the attached delivery timeline and confirm receipt so we can coordinate logistics accordingly. Your timely collaboration will be crucial for maintaining smooth harvest operations and meeting production targets.\n\nBest regards,\nPatricia Reeves\n\n--\nPatricia Reeves\nExecutive Assistant to the CEO\nAgave Spirits International',
12 'Subject: Celebrating Our Team Excellence Award Recipient—¡Felicidades, Elena!\nDate: 2025-12-11T19:24:00\nFrom: Carlos Delgado\nParticipants: Agave Spirits Mexico Team\n\nBody:\nDear Team,\n\nI am delighted to announce that this quarter’s Team Excellence Award goes to our very own Elena Fuentes. Elena has shown unparalleled dedication in supporting our operations, always ensuring that even the smallest details are handled with cariño. Her ability to coordinate complex schedules and build confianza with our partners reflects the essence of how we do business here: en México, las relaciones importan, and Elena embodies this every day. Her work reminds us that true excellence comes from caring for each other, not just tasks.\n\nPlease join me in congratulating Elena. We will be honoring her achievement with just a small dinner—nada ostentoso, just a way to come together as equipo and celebrate the relationships that drive our success.\n\nUn abrazo fuerte a todos,\nCarlos\n\n--\nCarlos Delgado\nCountry Manager, Mexico Operations\nAgave Spirits International\nTequila, Jalisco',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 1024] [3, 1024]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[0.6602, 0.2324, 0.0050]], dtype=torch.bfloat16)val_full_corpusInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.8878 |
| cosine_accuracy@3 | 0.9561 |
| cosine_accuracy@5 | 0.9805 |
| cosine_accuracy@10 | 0.9902 |
| cosine_precision@1 | 0.8878 |
| cosine_precision@3 | 0.3187 |
| cosine_precision@5 | 0.1961 |
| cosine_precision@10 | 0.099 |
| cosine_recall@1 | 0.8878 |
| cosine_recall@3 | 0.9561 |
| cosine_recall@5 | 0.9805 |
| cosine_recall@10 | 0.9902 |
| cosine_ndcg@10 | 0.9419 |
| cosine_mrr@10 | 0.9259 |
| cosine_map@100 | 0.9265 |
sentence_0 and sentence_1| sentence_0 | sentence_1 | |
|---|---|---|
| type | string | string |
| details |
|
|
| sentence_0 | sentence_1 |
|---|---|
Find records of quality test results for batch QT-2024-0891 showing alcohol content 39.8%, pH 3.6, and approval by Carlos. | Subject: Batch QT-2024-0891 Quality Test Results[object Object]Date: 2025-10-15T12:26:00[object Object]From: Ana Lucia Vega[object Object]Participants: Javier Moreno[object Object][object Object]Body:[object Object]Hi Javier,[object Object][object Object]I wanted to share the results from the routine quality testing on batch QT-2024-0891. The alcohol content was measured at 39.8%, which is within our expected range. pH levels were 3.6, also within normal parameters. Taste panel notes described the flavor profile as clean and balanced, no anomalies reported. Carlos reviewed and approved these results before I sent this email. Please let me know if you need any more details or if you want the full lab report attached. Thanks![object Object][object Object]Regards,[object Object]Ana Lucia Vega |
What is the decision on replacing the battery for forklift unit 4: replace now or wait? | Subject: Forklift Fleet Routine Maintenance Completed – Service Report[object Object]Date: 2026-01-19T18:34:00[object Object]From: Diego Ramirez[object Object]Participants: Pedro Villanueva[object Object][object Object]Body:[object Object]Hi Pedro,[object Object][object Object]Just wanted to let you know we wrapped up routine maintenance on the forklift fleet this afternoon. We replaced the hydraulic filters on units 3 and 5, and topped up fluids on all machines. Belts on forklift 2 were showing a lot of wear, so we swapped those out—I'll need to order a few more spares from Guadalajara soon. Everything else checked out, but the battery on unit 4 is starting to lose charge faster than it should—might not last till next service, so let me know if you want to replace it now or wait. Next scheduled maintenance is set for July 21st. Let me know if you have any other issues you want the guys to check on.[object Object][object Object]Regards,[object Object]Diego |
Is there documentation of permit delays impacting production, including any contingency plan to shut down if the permit is not obtained? | Subject: Downtime Analysis – Tequila Distillery Production Update[object Object]Date: 2025-10-13T10:55:00[object Object]From: Roberto Garza[object Object]Participants: Thomas Bradford[object Object][object Object]Body:[object Object]Hi Tom,[object Object][object Object]I wanted to share our latest downtime analysis for the month. We experienced a total of 23 hours of unplanned downtime, primarily due to maintenance on the primary fermentation tanks and a hold in bottling while awaiting inspection. Output for the period was 212,000 liters, down approximately 8% from last month. I’m concerned the ongoing permit delays could impact our next production cycle; if we don't get the permit, we shut down. I trust Rick is moving things forward on the environmental side. Let me know if there’s anything else you need from my team.[object Object][object Object]Best,[object Object]Roberto[object Object][object Object]--[object Object]Roberto Garza[object Object]Plant Manager[object Object]Destilería Agave Spirits - Tequila |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}per_device_train_batch_size: 16per_device_eval_batch_size: 16multi_dataset_batch_sampler: round_robindo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16gradient_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: 3max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: Nonewarmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': 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: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_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: Truepush_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_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_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: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | val_full_corpus_cosine_ndcg@10 |
|---|---|---|
| 1.0 | 51 | 0.9334 |
| 2.0 | 102 | 0.9344 |
| 3.0 | 153 | 0.9419 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}