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.

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

Tokenize input and output.

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