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.

calculate_metrics([split, level, log_index, ...])

Calculate and save metrics for a given data split and level.

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.

prepare_dataset(dataset[, is_fit])

Apply the model transformations to the dataset.

prepare_output(dataset[, is_fit])

Hook for model-specific preprocessing of output targets.

save(filename)

Store an instance of a model.

tokenize_data(dataset)

Tokenize the input data.

train(x_train, y_train, x_validation, ...)

Train the model with the provided 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

COLOR

COMPATIBLE_COMPONENTS

DISPLAY_NAME

TYPE