In this recipe, you will add the tflite_flutter package and use its example model to classify a text, and sort whether the sentiment of the text is positive or negative. Follow these steps:
- Complete the setup procedure necessary to use the tflite_lite package; this depends on your system and is available at the following address: https://pub.dev/packages/tflite_flutter, in the Initial setup section.
- In the pubspec.yaml file, download the latest version of the tflite_lite package:
tflite_flutter: ^0.5.0
- In the root of the app, create a new folder, called assets.
- Download the text_classification.tflite model from https://github.com/am15h/tflite_flutter_plugin/tree/master/example/assets to the assets folder.
- Download the text_classification_vocab.txt vocabulary file from https://github.com/am15h/tflite_flutter_plugin/tree/master/example/assets to the assets folder.
- Download the classifier.dart file from https://github.com/am15h/tflite_flutter_plugin/tree/master/example...