DashAI.back.models.DistilBertTransformer
- class DistilBertTransformer(model=None, **kwargs)[source]
Pre-trained transformer DistilBERT allowing English text classification.
DistilBERT is a small, fast, cheap and light Transformer model trained by distilling BERT base. It has 40% less parameters than bert-base-uncased, runs 60% faster while preserving over 95% of BERT’s performances as measured on the GLUE language understanding benchmark [1].
References
[1] https://huggingface.co/docs/transformers/model_doc/distilbert
- __init__(model=None, **kwargs)[source]
Initialize the transformer model.
The process includes the instantiation of the pre-trained model and the associated tokenizer.
Methods
__init__
([model])Initialize the transformer model.
fit
(x_train, y_train)Fine-tune the pre-trained model.
get_schema
()Generates the component related Json Schema.
load
(filename)Restores an instance of a model.
predict
(x_pred)Predict with the fine-tuned model.
save
(filename)Store an instance of a model.
tokenize_data
(dataset)Tokenize the input data.
validate_and_transform
(raw_data)It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Attributes
COMPATIBLE_COMPONENTS
TYPE