Back to Tensorflow

Module: tflite_model_maker.text_classifier

tensorflow/lite/g3doc/api_docs/python/tflite_model_maker/text_classifier.md

2.21.02.0 KB
Original Source

page_type: reference description: APIs to train a text classification model.

<link rel="stylesheet" href="/site-assets/css/style.css"> <!-- DO NOT EDIT! Automatically generated file. --> <div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tflite_model_maker.text_classifier" /> <meta itemprop="path" content="Stable" /> </div>

Module: tflite_model_maker.text_classifier

<!-- Insert buttons and diff --> <table class="tfo-notebook-buttons tfo-api nocontent" align="left"> <td> <a target="_blank" href="https://github.com/tensorflow/examples/blob/tflmm/v0.4.2/tensorflow_examples/lite/model_maker/public/text_classifier/__init__.py">
View source on GitHub
</a> </td> </table>

APIs to train a text classification model.

Task guide:

<a href="https://www.tensorflow.org/lite/tutorials/model_maker_text_classification">https://www.tensorflow.org/lite/tutorials/model_maker_text_classification</a>

Classes

class AverageWordVecSpec: A specification of averaging word vector model.

class BertClassifierSpec: A specification of BERT model for text classification.

class DataLoader: DataLoader for text classifier.

class TextClassifier: TextClassifier class for inference and exporting to tflite.

Functions

MobileBertClassifierSpec(...): Creates MobileBert model spec for the text classification task. See also: <a href="../tflite_model_maker/text_classifier/BertClassifierSpec"><code>tflite_model_maker.text_classifier.BertClassifierSpec</code></a>.

create(...): Loads data and train the model for test classification.