Hello👋, This package is supports using Tensorflow Lite models for text classifications. I developed this when I wanted to integrate some models I generated from Tensorflow Model Maker in my flutter app.
Yes, without a doubt, giving a free 👍 or ⭐ will encourage me to keep this plugin updated.
A flutter plugin for doing text classification using tflite models.
Note: This project utilises tensorflow-lite-task-text library to classify the texts through models.
- Works on Android 5.0 (API level 21) or later.
- Requires 4 line code to get running.
- In pubspec.yaml, add this dependency:
tflite_text_classification:
- Add this package to your project:
import 'package:tflite_text_classification/tflite_text_classification.dart';
ClassificationResult? result = await TfliteTextClassification().classifyText(
params: TextClassifierParams params = TextClassifierParams(
text: 'aaj me bahut khush hu',
modelPath:
'path/mobilebert.tflite',
modelType: ModelType.mobileBert,
delegate: 0,
),
);
To run the example project, download this below model zips and extract them in the assets folder of the example project. I'm providing these sample models separately because of their size.
Sample Average Word Vec Model.zip
The provided models does Hinglish(Common language in India) Text Emotion Classification and are generated using the Tensorflow Lite Model Maker but they are not very accurate and are only here for demonstration purposes. Replace provided model with your own models.