
In this tutorial, we will use the SST-2 (Stanford Sentiment Treebank) which is one of the tasks in the GLUE benchmark. tmpfs/src/tf_docs_env/lib/python3.7/site-packages/numba/core/errors.py:168: UserWarning: Insufficiently recent colorama version found. tmpfs/src/tf_docs_env/lib/python3.7/site-packages/pkg_resources/_init_.py:119: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release import numpy as npįrom tflite_model_maker import model_specįrom tflite_model_maker import text_classifierįrom tflite_model_nfig import ExportFormatįrom tflite_model_maker.text_classifier import AverageWordVecSpecįrom tflite_model_maker.text_classifier import DataLoader To run this example, install the required packages, including the Model Maker package from the GitHub repo. Prerequisites Install the required packages The dataset used in this tutorial are positive and negative movie reviews.

The inputs should be preprocessed text and the outputs are the probabilities of the categories.

The text classification model classifies text into predefined categories. This notebook shows an end-to-end example that utilizes the Model Maker library to illustrate the adaptation and conversion of a commonly-used text classification model to classify movie reviews on a mobile device. The TensorFlow Lite Model Maker library simplifies the process of adapting and converting a TensorFlow model to particular input data when deploying this model for on-device ML applications.
