You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Embedding Model APA/embed-embeddinggemma-300m-g39-v1.0

Overview

The model APA/embed-embeddinggemma-300m-g39-v1.0 is a text embedding model finetuned by APA – Austria Presse Agentur. The model produces embeddings that represent the semantics of the inputs and can be used in applications like semantic search.

It is based on a state-of-the-art open-weights embedding model (see section Base Model). APA finetuned the base model using various methods and a corpus of news texts provided by G39 members.

Embeddings produced by the model are vectors of 768 dimensions of floating-point numbers. The model was trained using Matryoshka Representation Learning (MRL) with dimensions 512, 256, and 128. Embeddings can be truncated to either number of dimensions with only a small loss of quality.

Finetuning primarily targeted the use case of asymmetric search (using a query to search for relevant documents in a large corpus). However, the model is also suitable for symmetric search (using an example document to search for similar documents).

Usage

The model is compatible with the SentenceTransformers framework. It can also be run using the vLLM or HuggingFace Text Embeddings Inference servers.

Texts passed to the model have to be prefixed depending on their usage:

  • When embedding a search query, add the prefix task: search result | query: (including a space character after the colon).
  • When embedding a document, add the prefix title: none | text: (including a space character after the colon). Using the actual document's title instead of none is supported by the base model, but was not used in finetuning and also wasn't tested by APA.

The model can process text lengths of up to 2048 tokens (including the prefix). Longer texts have to be split up into appropriate chunks. To count tokens, an AutoTokenizer from the HuggingFace Transformers framework can be used.

The model was trained using the bfloat16 data type. bfloat16 is also the preferred data type for running the model and is therefore specified as dtype in the model's config.json. If the used inference framework or hardware do not support bfloat16, float32 can be used instead. float16 cannot be used for running the model.

A minimal example for using the model in Python is below. Replace <model path> with the path to the model directory.

from transformers import AutoTokenizer
from sentence_transformers import SentenceTransformer
from enum import Enum

MODEL_PATH = "<model path>"


class TextType(Enum):
    QUERY = 0
    DOCUMENT = 1


def embed(text: str, text_type: TextType):
    match text_type:
        case TextType.QUERY:
            text = "task: search result | query: " + text
        case TextType.DOCUMENT:
            text = "title: none | text: " + text

    tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
    tokens = tokenizer.tokenize(text)
    if len(tokens) > 2048:
        raise ValueError("text is too long")

    model = SentenceTransformer(MODEL_PATH)
    embedding = model.encode(text, normalize_embeddings=True)
    return embedding


print(embed("This is an example query", TextType.QUERY))

Base Model

The APA/embed-embeddinggemma-300m-g39-v1.0 model is a finetuned version of the google/embeddinggemma-300m model.

The base model was published under the Gemma Terms of Use, see https://ai.google.dev/gemma/terms.

It was introduced with the following technical report:

@article{embedding_gemma_2025,
    title={EmbeddingGemma: Powerful and Lightweight Text Representations},
    author={Schechter Vera, Henrique* and Dua, Sahil* and Zhang, Biao and Salz, Daniel and Mullins, Ryan and Raghuram Panyam, Sindhu and Smoot, Sara and Naim, Iftekhar and Zou, Joe and Chen, Feiyang and Cer, Daniel and Lisak, Alice and Choi, Min and Gonzalez, Lucas and Sanseviero, Omar and Cameron, Glenn and Ballantyne, Ian and Black, Kat and Chen, Kaifeng and Wang, Weiyi and Li, Zhe and Martins, Gus and Lee, Jinhyuk and Sherwood, Mark and Ji, Juyeong and Wu, Renjie and Zheng, Jingxiao and Singh, Jyotinder and Sharma, Abheesht and Sreepat, Divya and Jain, Aashi and Elarabawy, Adham and Co, AJ and Doumanoglou, Andreas and Samari, Babak and Hora, Ben and Potetz, Brian and Kim, Dahun and Alfonseca, Enrique and Moiseev, Fedor and Han, Feng and Palma Gomez, Frank and Hernández Ábrego, Gustavo and Zhang, Hesen and Hui, Hui and Han, Jay and Gill, Karan and Chen, Ke and Chen, Koert and Shanbhogue, Madhuri and Boratko, Michael and Suganthan, Paul and Duddu, Sai Meher Karthik and Mariserla, Sandeep and Ariafar, Setareh and Zhang, Shanfeng and Zhang, Shijie and Baumgartner, Simon and Goenka, Sonam and Qiu, Steve and Dabral, Tanmaya and Walker, Trevor and Rao, Vikram and Khawaja, Waleed and Zhou, Wenlei and Ren, Xiaoqi and Xia, Ye and Chen, Yichang and Chen, Yi-Ting and Dong, Zhe and Ding, Zhongli and Visin, Francesco and Liu, Gaël and Zhang, Jiageng and Kenealy, Kathleen and Casbon, Michelle and Kumar, Ravin and Mesnard, Thomas and Gleicher, Zach and Brick, Cormac and Lacombe, Olivier and Roberts, Adam and Sung, Yunhsuan and Hoffmann, Raphael and Warkentin, Tris and Joulin, Armand and Duerig, Tom and Seyedhosseini, Mojtaba},
    publisher={Google DeepMind},
    year={2025},
    url={https://arxiv.org/abs/2509.20354}
}
Downloads last month
24
Safetensors
Model size
0.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for amauczka/APA-embed-embeddinggemma-300m-g39-v1.0

Finetuned
(286)
this model

Paper for amauczka/APA-embed-embeddinggemma-300m-g39-v1.0

Evaluation results