On-device sentence embeddings with all-MiniLM-L6-V2 in Android

Sentence-Embeddings-Android is an Android library that provides an interface to the all-MiniLM-L6-V2 model from sentence-transformers.

The app uses ONNX/onnxruntime to execute the model and tokenizers wrapped as native libraries.
The video below demonstrates the working of the library by computing the cosine similarity between the given sentences. The download size of the app is 112 MB including the ONNX model and tokenizer.config.

GitHub (demo app and library): GitHub - shubham0204/Sentence-Embeddings-Android: Embeddings from sentence-transformers in Android! Uses all-MiniLM-L6-V2 model currently
Blog: From Python To Android: HF Sentence Transformers (Embeddings) | by Shubham Panchal | Jun, 2024 | ProAndroidDev

app_demo