UCE Gemma
A model for extracting structured concepts and labels from text
2 min readupdated
UCE Gemma represents text as a binary vector across 62,312 named concepts, is based on google/embeddinggemma-2, and was created by researchers Kenny Peng, Jon Kleinberg, and Nikhil Garg. The model consists of an encoder that translates text into a binary vector and a detailed dictionary with metrics and concept descriptions. It allows for precisely understanding which semantic elements, lexical patterns, or language structures are activated in the text. It is suitable for developers and researchers to analyze the semantic content of large text arrays.
Key features
- Binary encoding: texts are converted into a sparse matrix across 62,312 concepts with a customizable activation threshold.
- Built-in dictionary: each concept contains a label, category, description, and an F1 quality score of at least 0.7.
- Device support: runs on CUDA by default, as well as on Apple Silicon (MPS) and CPU.
- Continuous activations: the ability to obtain sigmoid scores instead of a strict binary threshold via the
binary=Falseparameter.
What you can do
- Semantic text analysis: find active topics, categories, and hidden patterns in documents.
- Data pipeline integration: batch-process long texts and extract structured metadata.
- Multimodal analysis: encode pre-prepared image, video, or audio embeddings through the concept encoder.
- Concept dictionary research: study categories of semantic content, lexical patterns, and language structure.
Example
from pprint import pprint
from uce_gemma import UCEGemma
model = UCEGemma.from_pretrained('.')
texts = ['Novak Djokovic dethroned Nadal at Wimbledon on Sunday.']
binary = model.encode(texts)
active_ids = binary.getrow(0).indices
active_labels = [model.concept_dict[int(cid)]['label'] for cid in active_ids]
pprint(active_labels)Read more
DetailsLicense: Apache 2.0.
Architecture: concept encoder on top of EmbeddingGemma-2 (768-dimensional space).
Concept categories: semantic content (37,464), lexical patterns (20,884), and language structure (3,964).
Limitations: maximum input length up to 8192 tokens.










Comments