Attention: This MediaPipe Solutions Preview is an early release. Learn more.

mediapipe_model_maker.text_classifier.preprocessor.BertClassifierPreprocessor

Stay organized with collections Save and categorize content based on your preferences.

Preprocessor for a BERT-based classifier.

seq_len Length of the input sequence to the model.
vocab_file File containing the BERT vocab.
tokenizer BERT tokenizer.

Methods

get_vocab_file

View source

Returns the vocab file of the BertClassifierPreprocessor.

preprocess

View source

Preprocesses data into input for a BERT-based classifier.

Args
dataset Stores (text, label) data.

Returns
Dataset containing (bert_features, label) data.