fasttext_flutter 0.1.0
fasttext_flutter: ^0.1.0 copied to clipboard
On-device text classification and sentence embeddings using fastText .ftz quantized models via Dart FFI. Supports Android, iOS, macOS, Linux, and Windows.
0.1.0 #
- Initial release.
- Load
.ftz(quantized) and.bin(full) fastText models from the file system or Flutter assets. predict(text, {k, threshold})— top-k text classification for supervised models, returnsList<FastTextPrediction>.computeEmbedding(text)— dense sentence-vector embeddings asFloat32List, works for all model types.FastTextModel.cosineSimilarity(a, b)— static cosine-similarity helper.FastTextModelTypeenum — detect whether the model issupervised,cbow, orskipgramat runtime.- All inference runs in a background
Isolate— the Flutter UI thread is never blocked. NativeFinalizer-based automatic memory management with explicitclose()for deterministic cleanup.- Platform support: Android (arm64, arm, x86_64), iOS, macOS, Linux, Windows.
- fastText C++ library compiled from source via
native_toolchain_cbuild hooks — no pre-built binaries.