CoolFace
Modelpublic

kevin-rice/embeddinggemma-ticket-similarity

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes84downloads
Model Card

SentenceTransformer based on google/embeddinggemma-300m

This is a sentence-transformers model finetuned from google/embeddinggemma-300m. 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: google/embeddinggemma-300m <!-- at revision 57c266a740f537b4dc058e1b0cda161fd15afa75 -->
  • —Maximum Sequence Length: 2048 tokens
  • —Output Dimensionality: 768 dimensions
  • —Similarity Function: Cosine Similarity
  • —Supported Modality: Text <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

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': 'Gemma3TextModel'})
  (1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', 'include_prompt': True})
  (2): Dense({'in_features': 768, 'out_features': 3072, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
  (3): Dense({'in_features': 3072, 'out_features': 768, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
  (4): Normalize({})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("kevin-rice/embeddinggemma-ticket-similarity")
# Run inference
queries = [
    'Misaligned Template Section Fields and Inconsistent Invoice Layout Compared to UPS Orders',
]
documents = [
    'PDF export button icon appears similar to Excel icon in Inventory Master List report',
    'Inventory Master List Displays Active/Inactive Products While Manage Products Uses Different Status Visibility Logic',
    'SKU Toggle Prints Commodity Code (CC) Instead of SKU in Location Labels',
]
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.3035, 0.6568, 0.2639]])

<!--

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. -->

Evaluation

Metrics

Semantic Similarity
MetricValue
pearson_cosine0.8735
spearman_cosine0.8192

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 315 training samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
  • —Approximate statistics based on the first 315 samples: | | sentence1 | sentence2 | score | |:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 10 tokens</li><li>mean: 16.62 tokens</li><li>max: 27 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 16.83 tokens</li><li>max: 27 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.57</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence1 | sentence2 | score | |:-------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------|:-----------------| | <code>View button icon under Action column is not displayed properly</code> | <code>Unable to Search and Select Product in Select Product Catalog During In-House Replenishment</code> | <code>1.0</code> | | <code>Pick Assignment Throws Replenishment Error Even When Primary Location Has Available Stock</code> | <code>Cycle Count Variance report not fetching latest cycle count data dynamically</code> | <code>0.8</code> | | <code>Move Items UI should auto-hide location selection when only one Primary location exists</code> | <code>Primary Location not populated when product is fetched using Scan/Search Barcode in In-House Replenishment</code> | <code>0.8</code> |
  • —Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss",
      "cos_score_transformation": "torch.nn.modules.linear.Identity"
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 79 evaluation samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
  • —Approximate statistics based on the first 79 samples: | | sentence1 | sentence2 | score | |:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 10 tokens</li><li>mean: 16.51 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 11 tokens</li><li>mean: 17.03 tokens</li><li>max: 26 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.63</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence1 | sentence2 | score | |:--------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:-----------------| | <code>Update Packing Slip date format to MM-DD-YYYY</code> | <code>Accounting Template data is not fetching under Template column in Sales History By Item report</code> | <code>0.8</code> | | <code>Update Comments Section Format and Merge Herman ID / Employee ID Field</code> | <code>Order With Quantity Exceeding Available Primary Stock Is Marked Delivered Instead of Back Order and Creates Negative Stock</code> | <code>0.0</code> | | <code>Default distribution center comment is not displayed in Comments section</code> | <code>Update Packing Slip date format to MM-DD-YYYY</code> | <code>0.8</code> |
  • —Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss",
      "cos_score_transformation": "torch.nn.modules.linear.Identity"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 4
  • —learning_rate: 2e-05
  • —warmup_steps: 0.1
  • —fp16: True
  • —per_device_eval_batch_size: 4
All Hyperparameters

<details><summary>Click to expand</summary>

  • —per_device_train_batch_size: 4
  • —num_train_epochs: 3
  • —max_steps: -1
  • —learning_rate: 2e-05
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: None
  • —warmup_steps: 0.1
  • —optim: adamwtorchfused
  • —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: False
  • —fp16: True
  • —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: 4
  • —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: False
  • —ignore_data_skip: False
  • —restore_callback_states_from_checkpoint: False
  • —full_determinism: False
  • —seed: 42
  • —data_seed: None
  • —use_cpu: False
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —dataloader_prefetch_factor: None
  • —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: []
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —deepspeed: None
  • —debug: []
  • —skip_memory_metrics: True
  • —do_predict: False
  • —resume_from_checkpoint: None
  • —warmup_ratio: None
  • —local_rank: -1
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: proportional
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining LossValidation Lossticket-similarity-eval_spearman_cosine
0.063350.1581--
0.1266100.1581--
0.1899150.1117--
0.2532200.08690.07500.6907
0.3165250.0651--
0.3797300.0590--
0.4430350.0580--
0.5063400.06980.11410.5602
0.5696450.1079--
0.6329500.0932--
0.6962550.0762--
0.7595600.09380.06370.7089
0.8228650.1259--
0.8861700.0735--
0.9494750.0276--
1.0127800.05510.06070.7692
1.0759850.0788--
1.1392900.0807--
1.2025950.0334--
1.26581000.05080.06870.7471
1.32911050.0719--
1.39241100.0404--
1.45571150.0143--
1.51901200.07400.06300.7372
1.58231250.0410--
1.64561300.0483--
1.70891350.0629--
1.77221400.05130.04830.7610
1.83541450.0175--
1.89871500.0397--
1.96201550.0341--
2.02531600.02230.04780.7755
2.08861650.0167--
2.15191700.0230--
2.21521750.0600--
2.27851800.03570.04120.8031
2.34181850.0479--
2.40511900.0172--
2.46841950.0183--
2.53162000.02130.03990.8162
2.59492050.0115--
2.65822100.0305--
2.72152150.0101--
2.78482200.01890.03880.8229
2.84812250.0249--
2.91142300.0104--
2.97472350.0099--
3.0237-0.03910.8192

Training Time

  • —Training: 46.3 minutes

Framework Versions

  • —Python: 3.12.13
  • —Sentence Transformers: 5.4.1
  • —Transformers: 5.7.0
  • —PyTorch: 2.10.0+cu128
  • —Accelerate: 1.13.0
  • —Datasets: 4.8.5
  • —Tokenizers: 0.22.2

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}

<!--

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. -->