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.
-
Install Python dependencies:
pip install torch transformers
-
Run the conversion script from the project root:
python scripts/convert_bert_emotion_to_onnx.py
-
Ensure the output file exists:
bert-emotion/bert-emotion.onnx -
Run the setup script to copy the ONNX model and tokenizer files to the Flutter assets directory:
python scripts/setup_assets.py
flutter pub get
flutter runThe app loads the ONNX model on startup, takes text input, and predicts one of the 13 emotion labels.