Have a question? Connect with the community at the TensorFlow Forum Visit Forum

tflite_model_maker.text_classifier.AverageWordVecSpec

A specification of averaging word vector model.

Used in the notebooks

Used in the tutorials

num_words Number of words to generate the vocabulary from data.
seq_len Length of the sequence to feed into the model.
wordvec_dim Dimension of the word embedding.
lowercase Whether to convert all uppercase character to lowercase during preprocessing.
dropout_rate The rate for dropout.
name Name of the object.
default_training_epochs Default training epochs for training.
default_batch_size Default batch size for training.
model_dir The location of the model checkpoint files.

Methods

convert_examples_to_features

Converts examples to features and write them into TFRecord file.

create_model

Creates the keras model.

gen_vocab

Generates vocabulary list in examples with maximum num_words words.

get_config

Gets the configuration.

get_default_quantization_config

Gets the default quantization configuration.

get_name_to_features

Gets the dictionary describing the features.

load_vocab

Loads vocabulary from vocab_filename.

preprocess

Preprocess the text for text classification.

run_classifier

Creates classifier and runs the classifier training.

save_vocab

Saves the vocabulary in vocab_filename.

select_data_from_record

Dispatches records to features and labels.

PAD '<PAD>'
START '<START>'
UNKNOWN '<UNKNOWN>'
compat_tf_versions [2]
convert_from_saved_model_tf2 False
need_gen_vocab True