Skip to content

This is a simple Flutter app that runs local emotion classification with `bert-emotion` using `flutter_onnxruntime` and `dart_bert_tokenizer` packages.

Notifications You must be signed in to change notification settings

arqueffe/onnx_flutter_example

Repository files navigation

onnx_flutter_example

This is a simple Flutter app that runs local emotion classification with bert-emotion using flutter_onnxruntime and dart_bert_tokenizer packages. You can find the article about the project and the conversion process here.

Convert bert-emotion to ONNX

  1. Install Python dependencies:

    pip install torch transformers
  2. Run the conversion script from the project root:

    python scripts/convert_bert_emotion_to_onnx.py
  3. Ensure the output file exists:

    bert-emotion/bert-emotion.onnx
    
  4. Run the setup script to copy the ONNX model and tokenizer files to the Flutter assets directory:

    python scripts/setup_assets.py

Run the app

flutter pub get
flutter run

The app loads the ONNX model on startup, takes text input, and predicts one of the 13 emotion labels.

About

This is a simple Flutter app that runs local emotion classification with `bert-emotion` using `flutter_onnxruntime` and `dart_bert_tokenizer` packages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published