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 semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: google/embeddinggemma-300m
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'Gemma3TextModel'})
  (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("ahmedHamdi/IR-fr-en-gemma")
# Run inference
sentences = [
    "Sheba Miller, a working-class girl, dreams of a life of luxury. Her father owns a cigar shop, while she works as a stenographer. Jack, another working man, is madly in love with her and has even asked her father for his consent to their marriage. Although Pa Miller loves Jack and would like to see his daughter marry him, Sheba refuses because of his current salary. One day, she convinces him to take her to a chic and exclusive nightclub, the Pirates Den. Once they arrive and are seated, he is shocked by the prices and suggests they go somewhere else; this leads to an argument. As the couple is about to leave, an advertisement is placed for a leg contest, and Sheba decides to enter. She wins first place and is presented with her prize by Nickey Solomon, a gangster. Finally, Nickey proposes to Sheba, but before they can get married, Solomon, short on cash, robs a cigar shop and, in doing so, shoots the man behind the counter. Unbeknownst to him, he has shot Sheba's father. As the two are about to head out for another night on the town now that they have money, they stop at her father's cigar shop to say hello. As they approach, they see the police stationed nearby, and Nickey realizes what he has done. He convinces Sheba to stay in the car while he checks what happened. He speaks briefly to the police and then tells them that her father is fine and is now at the station helping the police identify a robber. In reality, however, her father is in the hospital being treated for his gunshot wound. Nickey convinces Sheba to continue their date, and they go to the club, but Jack, who suspects Solomon of being behind the robbery, asks the police to help him with his plan to frame him. They manage to get Nickey to unwittingly confess to the crime and convince him to leave town, but they arrest him at the train station before he has a chance to board. Solomon is taken to jail, and Sheba is informed that her father is perfectly fine. Humiliated by the experience, Sheba agrees to marry Jack with his $35-a-week salary.",
    "Alice White plays Sheba Miller, a working-class girl who dreams about living a life of luxury. Her father runs a cigar store while she works as a stenographer. Jack, a soda jerk, is madly in love with her and has even asked her father for his consent to their marriage. Although Pa Miller likes Jack and would like to see his daughter marry him, Sheba refuses him on the wage he currently earns. One day, she convinces him to take her to a fancy exclusive nightclub, the Pirates Den. Once they arrive and are seated, he is shocked at the prices and suggests that they go elsewhere; this leads to an argument. As the couple is about to leave, an announcement is made for a leg contest and Sheba decides to enter. She wins first place and is awarded her prize by Nickey Solomon, a gangster. Dazzled by his fancy clothes and car, Sheba accepts his attentions and give Jack the air. Eventually Nickey asks Sheba to marry him, but before they tie the knot, Solomon, who is low on cash, robs a cigar store and in the process shoots the man behind the counter. Without knowing it, he has shot Sheba's father. As the two are about to head out for another night on the town now that they have money, they stop at her father's cigar store to say hello. As they approach, they see police stationed around and Nickey realizes what he has done. He convinces Sheba to stay in the car while he checks out what happened. He talks a bit to the police and then tells her that her father is all right and that he is now at the police station to help the police identify a thief. In reality, however, her father is at the hospital being treated for the gunshot wound. Nickey convinces Sheba to continue their date and they drive to the club, but Jack, who suspects that Solomon was behind the robbery, asks the police to help with his entrapment plan. They manage to get Nickey to unwittingly confess to the crime and convince him to skip town, but they arrest him at the train station before he has a chance to board. Solomon is taken to jail and Sheba is informed that her father is perfectly fine. Sheba, humbled by the experience, agrees to marry Jack on his $35 a week salary.",
    "Raj Sharma is a young playboy who meets three young women at different stages in his life and learns important lessons about love along the way. As the story opens in 2008, it leads to a series of flashbacks describing his growth both emotional and ethical. 1996, Switzerland – Mahi  On a trip to Switzerland with his friends, Raj runs into Mahi Pasricha on the Eurail, who is on vacation with her friends and family. Mahi is a sweet, dreamy girl who believes in true love and is hoping to find her 'Raj' (a reference to Dilwale Dulhania Le Jayenge (1995)) i.e. her true love. When she misses her train, Raj helps her reach the airport through a different route. On the way, they share a kiss after Raj reads her a poem he wrote about her. At the airport, when she opens the paper on which Raj had written the poem, she finds it blank. Raj boasts to his friends about what happened between the pair and how he took full advantage of the situation when she was alone. Mahi overhears this and is shocked and heartbroken. Raj realizes that she has overheard his conversation with his friends and shamefacedly leaves. 2002, Mumbai – Radhika  6 years after the Switzerland episode, Raj has moved to Mumbai and found a job with Microsoft as a game designer with his best friend Sachin Kashyap. Pretty soon, he enters into a live-in relationship with neighbor Radhika Kapoor, an aspiring model. Having received an offer to move to Sydney for a Halo 3 game launch, he expects to be able to leave Radhika and move on, assuming she is capable of handling a break-up. This vision is shattered when Radhika declares that she intends to sacrifice her career to marry Raj and join him in Australia. He makes up reasons to Radhika so as to prevent them from getting married, but she remains firm. Raj, unable to express his commitment phobia, boards his flight on the morning of his wedding to Radhika. Radhika learns this while waiting for him at the registrar's office dressed as a bride, and is left crestfallen and heartbroken. 2007, Sydney – Gayatri  5 years down the line, Raj now enjoys a successful career along with Sachin in Sydney. He meets Gayatri Divecha, a feisty and independent woman who studies at business school during the day, and moonlights as a taxi-driver at night. As they date, he gains feelings for her. He also realizes that his feelings for her challenge his misgivings towards commitment. He proposes to her, but Gayatri turns him down, saying that she is happy with her life as she is and she doesn't believe in marriage and commitment. Rejection cuts Raj deep. He recalls when he broke the hearts of Mahi and Radhika, realizing how they must have felt. He decides to seek them out and ask for forgiveness.",
]
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.9117, 0.0916],
#         [0.9117, 1.0000, 0.0746],
#         [0.0916, 0.0746, 1.0000]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 16,276 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 11 tokens
    • mean: 125.11 tokens
    • max: 256 tokens
    • min: 21 tokens
    • mean: 230.12 tokens
    • max: 256 tokens
  • Samples:
    sentence_0 sentence_1
    An unbelievable heatwave hits the British island of Fara in the middle of winter. At the Swan Inn, tension rises along with the temperature. The mysterious guest, Hanson, will eventually reveal the cause of this strange microclimate: aliens are preparing to invade Earth, and the intense heat is essential for their survival… Jeff and Frankie Callum run The Swan, an inn on the island of Fara, somewhere off the English coast. Jeff, a professional novelist, hires a secretary, but this turns out to be Angela Roberts, a younger woman with whom he had an affair some time before, and who has come to the island with the intent of luring Jeff away from his wife, or at least causing trouble in their marriage. The Callums moved to Fara so that Jeff could escape Angela's amorous advances, although as far as Frankie knows, it was only to escape the tedium of life on the mainland. Not helping matters is the fact that despite it being the middle of winter, Fara is experiencing a stifling and inexplicable heat wave, with temperatures rising rapidly. It has become so hot that cars stall, beer bottles shatter, televisions explode, and telephones have ceased to work. Into this tense situation comes Godfrey Hanson, a mysterious scientist from the mainland, who rents a room at The Swan. Hanson spends his time exploring the isl...
    Rasputin made his healing powers known in Russia by curing a tavern keeper's wife. He then decided to go to the capital to become important. He hypnotized several people, which allowed him to gain access to the Tsar's court. In the Russian countryside, Rasputin heals the sick wife of an innkeeper (Derek Francis). When he is later hauled before an Orthodox bishop for his sexual immorality and violence, the innkeeper springs to the monk's defence. Rasputin protests that he is sexually immoral because he likes to give God sins worth forgiving (loosely based on Rasputin's rumored connection to Khlysty, an obscure Christian sect which believed that those deliberately committing fornication, then repenting bitterly, would be closer to God). He also claims to have healing powers in his hands, and is unperturbed by the bishop's accusation that his power comes from Satan. Rasputin heads for Saint Petersburg, where he forces his way into the home of Dr Zargo (Pasco), from where he begins his campaign to gain influence over the Tsarina (Asherson). He manipulates one of the Tsarina's ladies-in-waiting, Sonia (Shelley), whom he uses to satisfy his voracious sexual appetite and gain access to the Tsarina. He places her ...
    The film depicts the Willard family on a trip to Europe. The family crosses the Atlantic Ocean aboard the SS United States. Harry Willard finally makes good his promise to take his bride of 20 years on a long-delayed trip by ship to Europe. They are accompanied by their 19-year-old son (Elliott), 18-year-old daughter (Amy), and 11-year-old son (Skipper). From the time they arrive at the dock, an unending series of comedy adventures and romantic encounters ensue until, exhausted but happy, they leave with memories that will stay with them all for years to come.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • bf16: False
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • 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
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.1229 500 0.0107
0.2458 1000 0.0318
0.3686 1500 0.0667
0.4915 2000 0.1008
0.6144 2500 0.0844
0.7373 3000 0.0762
0.8602 3500 0.075
0.9830 4000 0.0713
1.1059 4500 0.039
1.2288 5000 0.0322
1.3517 5500 0.0399
1.4746 6000 0.0394
1.5974 6500 0.0259
1.7203 7000 0.0258
1.8432 7500 0.0215
1.9661 8000 0.0189
2.0890 8500 0.0077
2.2118 9000 0.0138
2.3347 9500 0.0077
2.4576 10000 0.003
2.5805 10500 0.0073
2.7034 11000 0.0088
2.8262 11500 0.0047
2.9491 12000 0.0078

Framework Versions

  • Python: 3.9.18
  • Sentence Transformers: 5.1.2
  • Transformers: 4.57.6
  • PyTorch: 2.8.0+cu128
  • Accelerate: 1.10.1
  • Datasets: 4.5.0
  • Tokenizers: 0.22.2

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
2
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ahmedHamdi/IR-fr-en-gemma

Finetuned
(222)
this model

Papers for ahmedHamdi/IR-fr-en-gemma