Preprocessor for a BERT-based classifier.
mediapipe_model_maker.text_classifier.preprocessor.BertClassifierPreprocessor(
seq_len: int, do_lower_case: bool, uri: str
)
Attributes |
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
get_vocab_file() -> str
Returns the vocab file of the BertClassifierPreprocessor.
preprocess
View source
preprocess(
dataset: mediapipe_model_maker.text_classifier.Dataset
) -> mediapipe_model_maker.text_classifier.Dataset
Preprocesses data into input for a BERT-based classifier.
Args |
dataset
|
Stores (text, label) data.
|
Returns |
Dataset containing (bert_features, label) data.
|