EmojiFinder v2
Type a word, phrase or sentence and get the emoji that fit it, ranked, offline, in a few milliseconds.
EmojiFinder v2 is a small semantic emoji search model. It understands what you mean,
not just matching keywords: we lost the match returns 😢 😞 😔 rather than 🏆, and
studying for finals returns 📚. When nothing fits, it says so instead of guessing.
| Task | Text → ranked emoji (search, pickers, keyboard suggestions) |
| Catalog | 1,923 emoji up to Emoji 18.0, plus 2,040 skin-tone variants |
| Model | 6-layer MiniLM bi-encoder, about 22.7M parameters, FP16 ONNX (45.2 MB) |
| Speed | 2.9 ms median for a full search on one CPU thread (Apple M3) |
| Runs on | ONNX Runtime, CPU only, fully offline; no PyTorch or Transformers needed |
| License | Apache-2.0 (weights); Unicode and emojilib notices retained |
Examples
Real outputs from this release (served search: rules and display trim applied, first six results). Bold results are strong, meaning they cleared the calibrated confidence threshold. The rest are faded suggestions.
| Query | Results (bold = strong) |
|---|---|
pizza |
🍕 🧀 🍅 |
happy birthday |
🎂 🎈 🥳 🍰 🎉 🎊 |
we lost the match |
😢 😞 😔 😭 💔 😩 |
studying for finals |
📚 ✍️ 🧠 🎓 ✏️ 💻 |
new year party |
🎆 🥂 🎉 🕛 🏮 🎊 |
touch grass |
🌱 🌿 🌳 🏞️ 🍃 🌾 |
thumbs up medium skin tone |
👍🏽 |
light skin and dark skin handshake |
🫱🏻🫲🏿 |
😀 |
😀 😁 😃 😄 🙂 😊 |
What's new since v1
| v1 | v2 | |
|---|---|---|
| Architecture | Hashed n-gram classifier | Pretrained sentence encoder (bi-encoder) |
| Emoji catalog | 1,870, up to Emoji 15.0 | 1,923, up to Emoji 18.0 |
| Skin tones | Not supported | Parsed from the query ("dark skin", "tone 3", 👍🏽) |
| Output | Fixed 0.8 threshold, often empty | Full ranking with a strong/faded split |
| "No emoji fits" | Not modelled | Trained to abstain on words with no good emoji |
| Negation | Not targeted | Trained on contrast ("lost", "no longer", "not") |
| Pasted emoji | Not supported | 😀 searches for similar emoji |
| Held-out top-1, natural + category queries | 60.0% | 87.6% |
Quick start
pip install onnxruntime tokenizers numpy huggingface_hub
import json, re, unicodedata
import numpy as np, onnxruntime as ort
from huggingface_hub import snapshot_download
from tokenizers import Tokenizer
path = snapshot_download("vinteai/EmojiFinder")
meta = json.load(open(f"{path}/metadata.json", encoding="utf-8"))
session = ort.InferenceSession(f"{path}/model.onnx", providers=["CPUExecutionProvider"])
tokenizer = Tokenizer.from_file(f"{path}/tokenizer.json")
tokenizer.enable_truncation(meta["max_tokens"])
vectors = np.load(f"{path}/emoji_vectors.npy").astype(np.float32)
def normalize(text):
text = unicodedata.normalize("NFKD", unicodedata.normalize("NFKC", text).casefold())
text = "".join(c for c in text if not unicodedata.combining(c))
text = text.replace("’", "").replace("'", "")
return " ".join(re.findall(r"[^\W_]+", text))
def search(query, limit=8):
text = normalize(query)
if not text:
return []
enc = tokenizer.encode(text)
feeds = {"input_ids": np.array([enc.ids], dtype=np.int64),
"attention_mask": np.array([enc.attention_mask], dtype=np.int64)}
embedding = session.run(["embedding"], feeds)[0][0]
logits = vectors @ embedding * meta["scale"] + meta["bias"]
scores = np.exp(logits - logits.max())
scores /= scores.sum()
top = np.argsort(-scores, kind="stable")[:limit]
return [(meta["catalog"][i]["emoji"], round(float(scores[i]), 4),
bool(scores[i] >= meta["strong_threshold"])) for i in top]
print(search("studying for finals"))
This is the raw model ranking. A complete integration adds the steps in
INTEGRATION.md: skin tones, pasted emoji, pinned answers, place-name
rules and the display trim that lets the model say "no emoji fits". Check your
implementation against the 43 cases in deployment-fixtures.json.
How it works
flowchart LR
Q["Query text"] --> T["Skin-tone parsing"]
T --> N["Normalize<br/>casefold, strip accents"]
N --> K["WordPiece tokenizer<br/>max 32 tokens"]
K --> E["MiniLM encoder<br/>model.onnx"]
E --> V["384-d unit vector"]
V --> S["Cosine vs 1,923<br/>emoji vectors"]
S --> P["Softmax over catalog"]
P --> R["Rules: pinned answers,<br/>place names"]
R --> D["Strong / faded / hidden"]
- Encode the query. The text is normalized and run through a 6-layer MiniLM encoder. Mean pooling produces a 384-dimensional unit vector.
- Score every emoji. Each emoji has a precomputed vector (
emoji_vectors.npy) built by the same encoder from its names and keywords. The model scores the query against all 1,923 emoji at once with a scaled dot product, then a softmax turns the scores into one distribution over the catalog. - Decide what to show. Results at or above
strong_thresholdare strong. Results down to 10% of that threshold are faded (at most 12). Anything lower is hidden. When nothing reaches the faded floor, the answer is "no emoji fits". - Apply light rules.
associations.jsonpins hand-curated answers for a few exact phrases (for exampletouch grassorrip).serving-rules.jsonkeeps place-name queries neutral: the named country's flag only, no rival flags or religious symbols, and no flags for disputed regions.
Training techniques
- Bi-encoder fine-tuning of a pretrained sentence encoder: queries and emoji descriptions share one encoder.
- Full-catalog contrastive objective: softmax over every emoji, with a learned temperature and bias.
- Multi-label soft targets that weight primary and related emoji differently.
- Abstention training: words with no fitting emoji train toward a uniform distribution, so the model can signal "nothing fits".
- Synthetic data augmentation: large sets of synthetic natural-language queries, with model-assisted labelling under a written sensitivity rubric.
- Negation and contrast examples ("not happy", "we lost the match").
- Reinforcement learning (REINFORCE) on the results users actually see. Rule-based rewards favour correct emoji and penalize confident results on no-answer words and unwanted sensitive emoji. A KL penalty keeps the model close to its supervised starting point.
- Precision-targeted calibration of the strong/faded threshold.
- FP16 ONNX export with measured FP32 parity.
The training data combines Unicode Emoji 18.0 and CLDR emoji annotations (English, plus Spanish keywords), emojilib keywords, synthetic queries, and reviewed corrections.
Evaluation
Both models are scored on identical queries, and v2 never saw these queries in training. Top-1 means the first result is a labelled emoji. Hit@3 means a labelled emoji appears in the first three.
| Test set | Queries | v2 top-1 | v2 hit@3 | v1 top-1 (raw) | v1 top-1 (served) |
|---|---|---|---|---|---|
| Everyday phrases | 112 | 93.8% | 99.1% | 81.2% | 72.3% |
| Original held-out | 81 | 76.5% | 87.7% | 51.9% | 46.9% |
| Natural + category | 210 | 87.6% | 98.6% | 60.0% | 51.4% |
| Paraphrases | 76 | 68.4% | 84.2% | 30.3% | 23.7% |
| Pop culture & slang | 52 | 44.2% | 59.6% | 34.6% | 25.0% |
| Synthetic phrases | 1,676 | 51.7% | 71.9% | 26.4% | 15.3% |
| Regression suite | 2,991 | 99.5% | 100% | 99.5% | 99.4% |
| Targeted probes | 96 | 86.5% | 90.6% | 100% | 100% |
| User corrections | 46 | 91.3% | 95.7% | 100% | 100% |
v1 (raw) is v1's ranking without its 0.8 threshold. v1 (served) is what v1 users saw, where empty results count as misses. v1 was tuned directly on the probes and corrections, so those last two rows favour it.
Strong results are usually right. Over the first 24 results, the share of strong-marked emoji that match a label is 80% on natural + category queries, 72% on everyday phrases and 68% on the original held-out set. The model marks about two strong results per query.
Abstention and safety. On its 13,596-word vocabulary, 1.6% of words with no fitting emoji still get a strong result, and an unwanted sensitive emoji (a flag for an ethnic group, a religious symbol for a non-religious word) is visible for 0.3% of words. These words were part of training, so treat these numbers as fit, not as held-out accuracy.
FP16 vs FP32. On 6,356 queries, the FP16 graph keeps the same top result for 6,350 and the same top-5 set for 6,345.
Labels are model-assisted and incomplete, so a correct emoji that nobody labelled counts as a miss. The sets are small, and the results are not a blind human evaluation. Machine-readable results are in evaluation.json.
Known weaknesses
| Query | Results (bold = strong) |
|---|---|
cumpleaños |
🩳 🧦 🩲 👖 🍰 🍦 |
feliz navidad |
😃 😊 😄 😁 😀 🎉 |
it is raining cats and dogs |
🐾 🌈 🌧️ 🐈⬛ 🐈 ☂️ |
beanie |
🧢 👕 🫘 🤳 🧥 🧸 |
- Languages other than English are weak. Spanish keywords help single emoji names, but phrases often fail.
- Idioms can be read literally (
raining cats and dogs→ 🐾 🌈). - Spelling lookalikes can leak into faded results (
beanie→ 🫘). - Faded tails are low-confidence by design and are sometimes unrelated.
- Glyph support: emoji from Unicode 16–18 (for example ) may draw as empty boxes on older operating systems. The package contains Unicode strings, not artwork.
- Rules are exact-match. Pinned answers apply only to listed phrases (
ripis covered,rip to my phoneis not).
Intended use
Good for: emoji pickers and search boxes, keyboard and chat suggestions, tagging short texts with emoji, and offline or privacy-sensitive apps.
Not for: sentiment or content moderation, judging people or groups, or any decision with consequences. Emoji associations are cultural and subjective, and the model reflects the judgments in its training labels.
Files
| File | Size | Contents |
|---|---|---|
model.onnx |
45.2 MB | FP16 encoder graph (opset 17): input_ids, attention_mask → embedding |
tokenizer.json |
0.7 MB | Uncased WordPiece tokenizer (Hugging Face tokenizers format) |
emoji_vectors.npy |
1.5 MB | FP16 [1923, 384] unit vectors, in catalog order |
metadata.json |
0.35 MB | Catalog (ids, emoji, names, versions, skin-tone variants), scale, bias, thresholds |
associations.json |
4 KB | Pinned answers for exact phrases |
serving-rules.json |
16 KB | Place-name and religious-symbol rule data |
deployment-fixtures.json |
72 KB | 43 end-to-end cases for checking an integration |
evaluation.json, runtime.json, provenance.json, config.json |
— | Results, speed, sources, configuration |
INTEGRATION.md |
— | The complete inference contract |
SHA256SUMS.json |
— | SHA-256 for every file |
This is an open-weight release: weights, data files and documentation, with no
application source code. config.json is not a Transformers configuration, and the
graph does not load with AutoModel.
Performance
On an Apple M3 with Python 3.11, ONNX Runtime 1.30 and one CPU thread, a complete served search measured 2.87 ms median and 3.79 ms p95 over 3,452 queries. That covers tokenizing, encoding, scoring all 1,923 emoji, applying rules and trimming to 24 results. Peak process memory was about 280 MiB. Browser, mobile and GPU runtimes have not been measured. See runtime.json.
License
The model weights and documentation are released under Apache-2.0. The base encoder, sentence-transformers/all-MiniLM-L6-v2, is Apache-2.0. Unicode data keeps its Unicode-3.0 notice, and emojilib keeps its MIT notice. See NOTICE. Emoji appearance comes from your device's fonts; no emoji artwork is included.
Citation
@misc{emojifinder_v2_2026,
title = {EmojiFinder v2: offline semantic emoji search},
author = {{Vinte AI}},
year = {2026},
url = {https://huggingface.co/vinteai/EmojiFinder}
}