fasttext_flutter 0.1.1 copy "fasttext_flutter: ^0.1.1" to clipboard
fasttext_flutter: ^0.1.1 copied to clipboard

On-device text classification and sentence embeddings using fastText .ftz quantized models via Dart FFI. Verified on Android. Contributions welcome

0.1.1 #

  • Fix (Android): Added missing aligned.h header from fastText's bundled intgemm library — resolves fatal error: 'aligned.h' file not found when compiling with Android NDK clang.
  • Fix (Android): Added -D_POSIX_C_SOURCE=200809L build flag to guarantee posix_memalign availability on all Android API levels ≥ 24.

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, returns List<FastTextPrediction>.
  • computeEmbedding(text) — dense sentence-vector embeddings as Float32List, works for all model types.
  • FastTextModel.cosineSimilarity(a, b) — static cosine-similarity helper.
  • FastTextModelType enum — detect whether the model is supervised, cbow, or skipgram at runtime.
  • All inference runs in a background Isolate — the Flutter UI thread is never blocked.
  • NativeFinalizer-based automatic memory management with explicit close() for deterministic cleanup.
  • Platform support: Android (arm64, arm, x86_64), iOS, macOS, Linux, Windows.
  • fastText C++ library compiled from source via native_toolchain_c build hooks — no pre-built binaries.
1
likes
150
points
138
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

On-device text classification and sentence embeddings using fastText .ftz quantized models via Dart FFI. Verified on Android. Contributions welcome

Repository (GitHub)
View/report issues

Topics

#nlp #machine-learning #ffi #text-classification #embeddings

License

unknown (license)

Dependencies

code_assets, ffi, flutter, hooks, logging, native_toolchain_c, path_provider

More

Packages that depend on fasttext_flutter