Skip to content

NSTiwari/Custom-Text-Classification-on-Android-using-TF-Lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Text Classification on Android using TensorFlow Lite

Create your own custom text classifier model and deploy it on an Android app using TensorFlow Lite.

Note: TF Lite Model Maker is now obsolete and is replaced by MediaPipe Model Maker. The below Colab notebook might therefore not work.

Steps:

  1. Clone the repository on your local machine.

  2. Sign in to your Google account and upload the Custom_Text_Classification.ipynb notebook on Colab.

  3. Run the notebook cells one-by-one by following the instructions.

  4. Once the TF Lite model is downloaded, copy the .tflite model file inside Custom-Text-Classification-on-Android-using-TF-Lite/Android_App/lib_task_api/src/main/assets directory.

  5. Open the project in Android Studio and let it build itself for some time.

  6. Open TextClassificationClient.java file under lib_task_api and edit Line 31 by replacing <your_model.tflite> with the name of your actual TF Lite model.

  7. Build the project and install it on your phone. Enjoy your own custom-build text classifier app.

Note: To build your custom dataset, refer the train.csv file for the format.

Output:

GitHub Logo

  • Read the Medium blog for step-by-step implementation.

About

An E2E custom text classification application for Android using TensorFlow Lite.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors