DashAI.back.models.OpusMtEnESTransformer

class OpusMtEnESTransformer(model=None, **kwargs)[source]

Pre-trained transformer for english-spanish translation.

This model fine-tunes the pre-trained model opus-mt-en-es.

__init__(model=None, **kwargs)[source]

Initialize the transformer.

This process includes the instantiation of the pre-trained model and the associated tokenizer.

Methods

__init__([model])

Initialize the transformer.

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

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

get_metadata()

Get metadata values for the current 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.

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(x[, y])

Tokenize input and output.

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

DESCRIPTION

DISPLAY_NAME

ICON

TYPE