Downloads · 30 days
2.3K
27% of all-time downloads
tardellirs/aac-pictogram-retriever-ptbr
aac-pictogram-retriever-ptbr is a sentence similarity model from tardellirs. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as gemma.
[](https://huggingface.co/tardellirs/aac-pictogram-retriever-ptbr-GGUF) [](https://huggingface.co/datasets/tardellirs/aac-pictogram-retrieval-ptbr)
Downloads · 30 days
2.3K
27% of all-time downloads
All-time downloads
8.7K
Public
Parameters
151M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors622 MB · 98%
From the Hugging Face model README
A compact Brazilian-Portuguese embedding model that finds the right ARASAAC pictogram for a short search term — built for Augmentative and Alternative Communication (AAC). It was designed for pictogram search in Papuguinho, a tool for building communication boards (integration in progress).
llama.cpp: aac-pictogram-retriever-ptbr-GGUF (~190 MB RAM at Q8).| Resource | Description |
|---|---|
| 🧠 aac-pictogram-retriever-ptbr | This model — retrieval + reranking, 157M, CPU |
| ⚡ aac-pictogram-retriever-ptbr-GGUF | GGUF quants for llama.cpp (Q4/Q6/Q8/f16) |
| 📊 aac-pictogram-retrieval-ptbr | Evaluation benchmark (corpus / queries / qrels) |
| 🏋️ aac-pictogram-retrieval-ptbr-training | Training data (retrieval pairs + graded reranking) |
| 🌱 colibri-embed-ptbr | Base pt-BR embedding model |
In AAC, a child or therapist searches for a word (e.g. "escovar os dentes", "quero água") and the app must surface the pictogram that best represents it, so the child can point to it to communicate. This is a short-query, closed-domain, Brazilian-Portuguese retrieval problem where general-purpose embedders and leaderboard rankings do not transfer well. This model is tuned specifically for it.
Intended use: semantic search and reranking of ARASAAC pictograms from pt-BR words/phrases, in AAC applications.
Not intended for: general-purpose sentence embeddings, languages other than Brazilian Portuguese, or domains outside pictogram/AAC search.
sentence-transformersThe model uses asymmetric prompts — one for the query, one for the document (pictogram text). Always apply them.
from sentence_transformers import SentenceTransformer
import numpy as np
model = SentenceTransformer("tardellirs/aac-pictogram-retriever-ptbr", trust_remote_code=True)
QUERY_PROMPT = "task: search result | query: "
DOC_PROMPT = "title: none | text: "
query = "escovar os dentes"
# Pictogram "documents": a short text per pictogram (labels + synonyms + keywords + ARASAAC tags)
docs = [
"escovar os dentes; escovação. tags: hygiene, health, routine",
"escova de dentes; escova. tags: hygiene, object",
"pente; pentear. tags: hygiene, object",
]
q = model.encode(QUERY_PROMPT + query, normalize_embeddings=True)
d = model.encode([DOC_PROMPT + t for t in docs], normalize_embeddings=True)
scores = d @ q # cosine similarity
print(docs[int(np.argmax(scores))]) # -> the escovar-os-dentes pictogram
Pre-compute the document embeddings for your pictogram catalog once; at query time you only embed the query and take cosine similarities. The same cosine score is used both to retrieve (over the full catalog) and to rerank a candidate shortlist.
llama.cpp (recommended for deployment)Use the GGUF build — it serves the full pipeline (pooling + dense projections) and loads in ~190 MB at Q8:
# from tardellirs/aac-pictogram-retriever-ptbr-GGUF (keep tokenizer.model next to the .gguf)
llama-server -m aac-Q8_0.gguf --embedding --pooling mean --host 127.0.0.1 --port 8080
# POST {"input": "task: search result | query: escovar os dentes"} to /v1/embeddings ; then cosine + normalize
Quantization quality (cosine vs. the fp16 reference, near-lossless): Q8_0 0.9998, Q6_K 0.9991, Q4_K_M 0.9926.
SentenceTransformer — Transformer → mean Pooling → Dense (768→3072) → Dense (3072→768) →
Normalize. Output dimension 768.tardellirs/colibri-embed-ptbr, a
Brazilian-Portuguese model derived from Google's EmbeddingGemma-300M with its vocabulary trimmed to the most
relevant pt-BR tokens (~157M parameters after trimming). Architecture and prompts are inherited from EmbeddingGemma.task: search result | query: , document title: none | text: .Training data is released as aac-pictogram-retrieval-ptbr-training. The model was adapted to the AAC pictogram domain by distilling relevance signal from a strong LLM judge over the ARASAAC catalog:
Evaluated on the aac-pictogram-retrieval-ptbr benchmark — a held-out set of genuinely unseen, non-canonical pt-BR queries (morphological variants, child language, synonyms) against the full ~14k-pictogram catalog — a deliberately hard generalization test. Relevance was judged by an LLM over a candidate pool pooled across all compared systems (TREC-style pooling — so newcomers are not penalized for retrieving un-judged pictograms). Recall@k over the 13,800-pictogram corpus, sorted by R@5:
| # | System | R@1 | R@5 | R@10 | Size / type |
|---|---|---|---|---|---|
| 1 | gemini-embedding-001 | 0.542 | 0.797 | 0.864 | cloud API |
| 2 | aac-pictogram-retriever-ptbr (this model) | 0.546 🥇 | 0.786 | 0.827 | 157M · CPU |
| 3 | text-embedding-3-large | 0.472 | 0.756 | 0.845 | cloud API |
| 4 | qwen3-embedding-4b | 0.480 | 0.745 | 0.812 | 4B |
| 5 | voyage-4 | 0.447 | 0.716 | 0.823 | cloud API |
| 6 | text-embedding-3-small | 0.347 | 0.594 | 0.675 | cloud API |
| 7 | voyage-4-lite | 0.354 | 0.583 | 0.712 | cloud API |
| 8 | gte-large | 0.229 | 0.424 | 0.505 | 335M |
| 9 | e5-base-v2 | 0.236 | 0.406 | 0.528 | 110M |
| 10 | gte-base | 0.207 | 0.391 | 0.502 | 110M |
| 11 | all-MiniLM-L12-v2 | 0.126 | 0.336 | 0.406 | 33M |
| 12 | paraphrase-MiniLM-L6-v2 | 0.096 | 0.258 | 0.354 | 22M |
On the reranking task (choosing among a candidate shortlist), the model reaches accuracy@loose ≈ 0.96 with a false-accept rate ≈ 0.04 ("better to omit than to show the wrong picture" — an important property for AAC).
Takeaway: a 157M open model running on CPU ranks #2 of 12 on this domain — it has the best R@1 of all
systems (edging gemini-embedding-001), and on novel concepts (the target split) it ranks #1 by R@5
(0.806 vs. gemini's 0.778). It outranks much larger cloud APIs and multi-billion-parameter models
(text-embedding-3-large, qwen3-embedding-4b, voyage-4, text-embedding-3-small). Only gemini-embedding-001
edges it, by ~1 pt of R@5 — and the LLM judge is from the same family as that model. A fully self-hostable model at a
tiny fraction of the size and cost.
Developed for Papuguinho (integration in progress) — www.papuguinho.com.
@software{aac_pictogram_retriever_ptbr,
title = {AAC Pictogram Retriever (pt-BR)},
author = {Stekel, Tardelli R. C. and Antonelli, Manuela and Baroni, Gabriel P. and {Carvalho Neto}, José A. and Souza, Marcela J. V.},
year = {2026},
url = {https://huggingface.co/tardellirs/aac-pictogram-retriever-ptbr},
doi = {10.57967/hf/9658},
publisher = {Hugging Face},
note = {A CPU-friendly Brazilian-Portuguese embedding model for ARASAAC pictogram retrieval and reranking, built for Papuguinho (www.papuguinho.com)}
}