tflite_text_classification 0.0.2 copy "tflite_text_classification: ^0.0.2" to clipboard
tflite_text_classification: ^0.0.2 copied to clipboard

PlatformAndroid

A flutter plugin for doing text classification using tflite models.

pub package wakatime

Word from creator #

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.

Package description #

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.

Features #

  • Works on Android 5.0 (API level 21) or later.
  • Requires 4 line code to get running.

Getting started #

  • In pubspec.yaml, add this dependency:
tflite_text_classification: 
copied to clipboard
  • Add this package to your project:
import 'package:tflite_text_classification/tflite_text_classification.dart';
copied to clipboard

Basic Usage #

ClassificationResult? result = await TfliteTextClassification().classifyText(
  params: TextClassifierParams params = TextClassifierParams(
    text: 'aaj me bahut khush hu',
    modelPath:
    'path/mobilebert.tflite',
    modelType: ModelType.mobileBert,
    delegate: 0,
  ),
);
copied to clipboard

For Example Code #

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

Sample Mobilebert 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.

5
likes
160
points
36
downloads

Publisher

verified publisherdeepanshuchaudhary.com

Weekly Downloads

2024.08.09 - 2025.02.21

A flutter plugin for doing text classification using tflite models.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on tflite_text_classification