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, classification, clustering, and more.

Model Details

Model Description

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

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:

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("dinushiTJ/nz-research-commons-embedding-gemma-v2")
# Run inference
queries = [
    'maori_origin',
]
documents = [
    'title: Understanding cultural relationships: Whānau, whanaungatanga and Māori student attainment of university entrance in a mainstream secondary school in Aotearoa, New Zealand\n\nauthors: McGill, Kristin\n\nsubjects: Cultural relationships\n\nabstract: This study seeks to understand the importance of cultural relationships in supporting Māori student achievement of University Entrance.  This research is based on the stories of five female ākonga Māori, all of whom completed five years of secondary education, and their whānau.  It looks deeply into their relational experiences of whanaungatanga and whānautanga with their school, and the impact this had on their academic achievement of NCEA Level 3 and University Entrance. \r\n\r\nThe results highlight the importance of culturally grounded transformative praxis and the risk of attempting to incorporate culturally located principles such as whānau and whanaungatanga into a schooling context, while still operating within historical hegemonic frameworks.\n\ntext: Understanding cultural relationships: Whānau, whanaungatanga and Māori student attainment of university entrance in a mainstream secondary school in Aotearoa, New Zealand This study seeks to understand the importance of cultural relationships in supporting Māori student achievement of University Entrance.  This research is based on the stories of five female ākonga Māori, all of whom completed five years of secondary education, and their whānau.  It looks deeply into their relational experiences of whanaungatanga and whānautanga with their school, and the impact this had on their academic achievement of NCEA Level 3 and University Entrance. \r\n\r\nThe results highlight the importance of culturally grounded transformative praxis and the risk of attempting to incorporate culturally located principles such as whānau and whanaungatanga into a schooling context, while still operating within historical hegemonic frameworks.\n\nyear: 2023',
    'title: Editorial: Pacific education: research and practice.\n\nauthors: Strachan, Jane\n\nsubjects: educational anthropology\n\nabstract: The article discusses various reports published within the issue including one by Tanya Wendt Samu on the call for teachers to be responsive to the diversities between group of learners as well as within groups of learners and another by Fran Cahill on the discussion of the difficulties that Samoan adolescents have in living within the traditional Samoan culture of home.\n\ntext: Editorial: Pacific education: research and practice. The article discusses various reports published within the issue including one by Tanya Wendt Samu on the call for teachers to be responsive to the diversities between group of learners as well as within groups of learners and another by Fran Cahill on the discussion of the difficulties that Samoan adolescents have in living within the traditional Samoan culture of home.\n\nyear: 2006',
    'title: An evaluation of Te Rau Puawai workforce 100: Perspectives of Te Rau Puawai bursars\n\nauthors: Nikora, Linda Waimarie\n\nsubjects: Maori students\n\nabstract: The Te Rau Puawai programme is an attempt to change the nature of the Maori\r\nmental health workforce. To do this, Maori with aspirations to work, or to continue to\r\nwork in the mental health workforce, are supported, financially and academically, to\r\ncomplete a tertiary qualification relevant to the field.\r\nTo evaluate the Te Rau Puawai programme, the Ministry of Health commissioned the\r\nMaori and Psychology Research Unit of the University of Waikato in July 2001. The\r\noverall aim of the evaluation was to provide the Ministry with a clearer understanding\r\nof the programme including: the perceived critical success factors, the barriers if any\r\nregarding Te Rau Puawai, the impact of the programme, the extent to which the\r\nprogramme may be transferable, gaps in the programme, and suggested\r\nimprovements.\r\nThe evaluation team set out to gather the experiences and perspectives of recipients of\r\nTe Rau Puawai services by asking all bursars to complete a questionnaire and\r\nvolunteer for follow up interviews or focus groups. Sixty two bursars responded to\r\nour questionnaire, and we complete focus group or individual follow up interviews\r\nwith 19 bursars.\n\ntext: An evaluation of Te Rau Puawai workforce 100: Perspectives of Te Rau Puawai bursars The Te Rau Puawai programme is an attempt to change the nature of the Maori\r\nmental health workforce. To do this, Maori with aspirations to work, or to continue to\r\nwork in the mental health workforce, are supported, financially and academically, to\r\ncomplete a tertiary qualification relevant to the field.\r\nTo evaluate the Te Rau Puawai programme, the Ministry of Health commissioned the\r\nMaori and Psychology Research Unit of the University of Waikato in July 2001. The\r\noverall aim of the evaluation was to provide the Ministry with a clearer understanding\r\nof the programme including: the perceived critical success factors, the barriers if any\r\nregarding Te Rau Puawai, the impact of the programme, the extent to which the\r\nprogramme may be transferable, gaps in the programme, and suggested\r\nimprovements.\r\nThe evaluation team set out to gather the experiences and perspectives of recipients of\r\nTe Rau Puawai services by asking all bursars to complete a questionnaire and\r\nvolunteer for follow up interviews or focus groups. Sixty two bursars responded to\r\nour questionnaire, and we complete focus group or individual follow up interviews\r\nwith 19 bursars.\n\nyear: 2002-05-01',
]
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.9017, -0.1908,  0.8361]])

Training Details

Training Dataset

Unnamed Dataset

  • Size: 5,000 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 100 samples:
    anchor positive negative
    type string string string
    modality text text text
    details
    • min: 6 tokens
    • mean: 6.75 tokens
    • max: 8 tokens
    • min: 55 tokens
    • mean: 702.62 tokens
    • max: 1882 tokens
    • min: 93 tokens
    • mean: 651.33 tokens
    • max: 2048 tokens
  • Samples:
    anchor positive negative
    maori_origin title: Bite

    authors: Mitchell, Tori

    subjects: poetry

    abstract: Bite is a collection of blunt confessional poetry draped in honesty, identity, and 21st century feminism, examined through lived experience with eating disorders, sexuality, trauma, disconnect from family and culture, love and loss, and what it means to be a girl growing up. The collection explores these raw concepts with vulnerability, through the eyes of ‘wolf girl’, in hopes that talking loudly about these topics will force the public to challenge the silence and stigma around them.


    This thesis was inspired by Maori Mythology, and all of the Polynesian poets who showed me how important it is for women of colour to share their stories and experiences. It was also influenced by feminist artists Jenny Holzer, Tracey Emin, and Barbara Kruger, whose art embodies the content of these poems in a literal way: freedom of expression, stripped bare and unflinching. The poetry in this collection is confronting, visceral, and...
    title: Remote coastal monitoring of beach usage on Tairua Beach

    authors: May-Stanley, Bridgette Petra

    subjects: Remote Sensing

    abstract: Research that gathers data from public reporting is susceptible to population bias, which arises from a lack of knowledge on the probability of a person’s ability to witness an event. Data collection based on public reporting is often used in coastal research relating to litter, stranded marine animals or bird spotting. It is biased by the probability of a person being in the vicinity, noticing and informing the appropriate organizations about the event. There is potential to improve population biased data by correcting for the probability of a person being present in a particular coastal vicinity. This thesis aims to better understand spatial and temporal beach usage at Tairua Beach in New Zealand. Building on existing literature, this research incorporates modern techniques to detect people on beaches from images taken every hour, during daylight...
    maori_origin title: Ka Mahuta, Ngāti Hauā and the importance of translation theory

    authors: Roa, Raukura

    subjects: Waiata Māori

    abstract: In this paper, I provide an English translation of one Māori waiata - Ka Mahuta – a waiata of Ngāti Hauā, along with a discussion of the relevance of translation theory and of culturally appropriate translation processes that fully involve those whose guidance, support, knowledge and understanding are of critical importance.

    text: Ka Mahuta, Ngāti Hauā and the importance of translation theory In this paper, I provide an English translation of one Māori waiata - Ka Mahuta – a waiata of Ngāti Hauā, along with a discussion of the relevance of translation theory and of culturally appropriate translation processes that fully involve those whose guidance, support, knowledge and understanding are of critical importance.

    year: 2003-09
    title: Using the Internet to Enhance Teaching at The University of Waikato

    authors: Dewstow, Ross Albert

    subjects: e-learning

    abstract: The University of Waikato brought the Internet to New Zealand, was one of the first Universities in New Zealand to graduate students who had completed a bachelor's degree online, and recently won an award for innovative use of video software in an online classroom. The video software was created by a company that had its beginnings within the University. However, the use of the Internet for teaching and learning in the University has reached a plateau in the last few years, as measured by the daily page views of the online platform (Moodie, 2004), the number of courses taught online and staff teaching online remaining fairly constant. This thesis sets out to investigate why the use of online teaching at the University has not increased to a point where a majority of staff are using online teaching to at least supplement their classroom teaching.

    Pr...
    maori_origin title: Pretty difficult: Implementing kaupapa Māori theory in English-medium secondary schools

    authors: Bishop, Russell

    subjects: Te Kotahitanga Project

    abstract: Developed in New Zealand some twenty years ago, kaupapa Māori has had a successful impact in education, notably in Māori-medium settings such as kōhanga reo, kura kaupapa Māori and wharekura. However, in mainstream educational settings, where the vast majority of Māori children continue to be educated, achievement disparities between Māori and their non-Māori peers persist. This article focuses on Te Kotahitanga, a large-scale kaupapa Māori school reform project that seeks to address educational disparities by improving the educational achievement of Māori students in mainstream schooling. Experiences with implementing Te Kotahitanga would suggest that reforming mainstream educational practices along kaupapa Māori lines is not easy. This article examines three main impediments encountered in attempts to implement the Te Ko...
    title: Depositional record of historic lahars in the Whangaehu Gorge, Mt. Ruapehu

    authors: Graettinger, Alison Hollomon

    subjects: lahars

    abstract: Mt. Ruapehu is one of the most lahar prone volcanoes in the world, having both a crater lake and six small glaciers upon its 2797 m summit. The major outlet for the crater lake, the Whangaehu Gorge, has hosted over 46 historic lahars. However, the low preservation of debris flow deposits, as a result of frequent remobilisation on steep slopes, allows for the detailed description of only 9 lahar events over the last 150 years. Field investigation, historic aerial photos, two airborne LiDAR surveys and direct measurements have been utilised to describe the sedimentology, geomorphology and distribution of historic lahar deposits in the first 11 km of the Whangaehu Gorge. Inundation maps have been created for 1945, 1953, 1975, September 1995, October 1995, March 2007 and September 2007. Grain size distribution, componentry and geomorphol...
  • Loss: TripletLoss with these parameters:
    {
        "distance_metric": "TripletDistanceMetric.COSINE",
        "triplet_margin": 0.3
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 1
  • learning_rate: 2e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • prompts: task: classification | query:

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 1
  • per_device_eval_batch_size: 8
  • 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: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • 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
  • use_ipex: 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
  • 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: False
  • 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: False
  • prompts: task: classification | query:
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.01 50 0.1511
0.02 100 0.0427
0.03 150 0.0149
0.04 200 0.0092
0.05 250 0.0502
0.06 300 0.013
0.07 350 0.0497
0.08 400 0.053
0.09 450 0.0499
0.1 500 0.016
0.11 550 0.0442
0.12 600 0.0422
0.13 650 0.0533
0.14 700 0.014
0.15 750 0.0075
0.16 800 0.0304
0.17 850 0.078
0.18 900 0.0116
0.19 950 0.0474
0.2 1000 0.0095
0.21 1050 0.0254
0.22 1100 0.0049
0.23 1150 0.0332
0.24 1200 0.024
0.25 1250 0.0124
0.26 1300 0.0275
0.27 1350 0.0517
0.28 1400 0.0344
0.29 1450 0.0162
0.3 1500 0.0269
0.31 1550 0.0234
0.32 1600 0.0124
0.33 1650 0.033
0.34 1700 0.007
0.35 1750 0.001
0.36 1800 0.0161
0.37 1850 0.027
0.38 1900 0.0057
0.39 1950 0.0097
0.4 2000 0.0087
0.41 2050 0.012
0.42 2100 0.0028
0.43 2150 0.0196
0.44 2200 0.0116
0.45 2250 0.0415
0.46 2300 0.0288
0.47 2350 0.0022
0.48 2400 0.0032
0.49 2450 0.0532
0.5 2500 0.0108
0.51 2550 0.0152
0.52 2600 0.0089
0.53 2650 0.0158
0.54 2700 0.0018
0.55 2750 0.006
0.56 2800 0.0021
0.57 2850 0.0098
0.58 2900 0.0038
0.59 2950 0.0104
0.6 3000 0.0181
0.61 3050 0.0114
0.62 3100 0.0049
0.63 3150 0.0074
0.64 3200 0.0122
0.65 3250 0.0094
0.66 3300 0.0153
0.67 3350 0.0212
0.68 3400 0.0
0.69 3450 0.0025
0.7 3500 0.0128
0.71 3550 0.0301
0.72 3600 0.018
0.73 3650 0.0339
0.74 3700 0.0059
0.75 3750 0.0018
0.76 3800 0.032
0.77 3850 0.0076
0.78 3900 0.0204
0.79 3950 0.0046
0.8 4000 0.0
0.81 4050 0.0295
0.82 4100 0.0042
0.83 4150 0.0168
0.84 4200 0.0232
0.85 4250 0.0002
0.86 4300 0.0
0.87 4350 0.0039
0.88 4400 0.0
0.89 4450 0.0079
0.9 4500 0.0177
0.91 4550 0.0301
0.92 4600 0.0246
0.93 4650 0.0029
0.94 4700 0.0273
0.95 4750 0.0
0.96 4800 0.0025
0.97 4850 0.0
0.98 4900 0.0018
0.99 4950 0.0324
1.0 5000 0.0105

Training Time

  • Training: 1.1 hours

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.7.0
  • Transformers: 4.57.0.dev0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.13.0
  • Datasets: 5.0.1
  • Tokenizers: 0.22.2

Additional Resources

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",
}

TripletLoss

@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification},
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
Downloads last month
22
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 dinushiTJ/nz-research-commons-embedding-gemma-v2

Finetuned
(272)
this model

Papers for dinushiTJ/nz-research-commons-embedding-gemma-v2