On-device emoji semantic lookup CLI powered by vector search
It's a simple CLI that uses sentence-transformers/all-MiniLM-L6-v2 quantized ONNX model and a vector search powered by sqlite-vec to help you to find emoji you are looking for
- Python 3.12 or higher
uv pip install -e .The CLI will automatically download the emoji data from this gist when needed. You can also use your own emoji data by placing it in shortnames_override.json.
The CLI will automatically download the quantized ONNX model from sentence-transformers/all-MiniLM-L6-v2 when needed. You can also use any other bi-encoder of your choice that fits your device by replacing the ONNX file. If you are using a model that requires different prompts to encode a query and a searched entity (emojis in our case) then you will need to modify the source code.
The tiny dedicated finetuned MiniLM is coming soon.
- Search for emojis (the CLI will automatically download dependencies and build the index if needed):
emji happy birthday
emji coffee break
emji celebration party-
Select and copy: Choose from the interactive list, and the emoji will be copied to your clipboard!
-
Force rebuild index (if needed):
emji --build-indexemji <text>- Search for emojis matching your descriptionemji --build-index- Force rebuild the semantic search index
Options:
--n <number>: Number of results to return (default: 3)
# Find celebration emojis
emji party celebration
# Find food-related emojis
emji delicious food
# Find weather emojis
emji sunny day
# Get more results
emji animals --n 5
# Force rebuild the index
emji --build-index- Automatic Setup: On first run, the CLI automatically downloads the required model and emoji data
- Embedding Generation: Uses a quantized version of
sentence-transformers/all-MiniLM-L6-v2to convert emoji names and descriptions into 384-dimensional vectors - Vector Database: Stores embeddings in SQLite with
sqlite-vecextension for fast similarity search - Semantic Matching: When you search, your query is converted to an embedding and compared against all emoji embeddings
- Interactive Selection: The best matches are presented in an interactive menu for you to choose from
# create virtual env
uv venv
# activate
source .venv/bin/activate
# sync dependencies
uv sync --all-groups
# Set up pre-commit hooks
pre-commit installLicensed under the Apache License 2.0. See for details.
Contributions are welcome! Please feel free to submit a Pull Request.