pmarquees/sf-symbols-classifier
sf-symbols-classifier
SFS1 int8 text classifier (2,714,833 bytes, 9,524 labels) that maps a short English phrase to ranked SF Symbols 27 icon names for live, offline icon suggestion. Ships dependency-free Swift and JavaScript runtimes reading the same quantized weights. v2 adds a natural-intent 'vibe' training layer over Apple's catalog metadata.
Model details
- Artifact:
sf-symbols-classifier v2 SFS1 int8 bundle (Swift/JS runtimes + armored tar.gz) - Version:
v2-sfsymbols27-int8 - Content hash:
sha256:ffff41f54bea4065f314bb0cce1365d813bd88e118645e0971bae979d607eb08
Intended use
On-device icon suggestion while the user types in English: an app takes a short phrase ('vacation', 'start of the school year') and the model returns the top-k SF Symbols names plus integer scores. Intended for apps embedding the Swift package or the JS runtime; prompts never leave the device. Not intended for image inputs or non-English text.
Evaluation
Frozen catalog-derived test split (38,235 rows, byte-identical to the v1 release): top-1 0.669 / top-5 0.852 quantized int8 (v1: 0.683 / 0.854, same split). Frozen 40-row dev regression of natural user phrases scored at family level: family top-1 0.85, exact top-1 0.775, family top-5 0.925 (v1: family top-1 0.30). All four user-reported failures now correct at rank 1: Flight->airplane, Start of the school year->studentdesk, Vacation->suitcase, Trip to Germany->airplane. Runtime parity: 100/100 JavaScript fixtures vs Python int8 scoring; macOS demo built, launched and verified locally with the v2 model. Missing evidence: no external human benchmark; the catalog test is metadata-derived and optimistic; Swift parity is verified via the demo launch plus format-identical JS/Python scoring.
Usage
Swift: let classifier = try SFSymbolsClassifier(url: SFSymbolsClassifierResources.bundledModelURL); let hits = classifier.predict(phrase, topK: 5) // [{symbol, score}]. JavaScript: import { SFSymbolsClassifier } from './sf-symbols-classifier.mjs'; const hits = new SFSymbolsClassifier(buffer).predict(phrase, 5). Inputs are normalized to lowercase ASCII alphanumerics; output symbols match Apple SF Symbols 27 names.
Limitations
Architecture is a hashed character n-gram + word bag model: it can only match meaning it has seen in training associations, and short phrases whose substrings collide with unrelated icon names (e.g. 'flight' vs 'lightbulb') can misrank. English-only intents. Rare symbols have few training rows. The 40-row dev gate is hand-authored and small. Catalog test rows are generated from Apple metadata, so synthetic-optimistic.
Provenance
Published by Mill from an immutable artifact. The content hash above identifies the exact approved model payload.
