AIFETransformerMaker | R Documentation |
R6
class for transformer creationThis class was developed to make the creation of transformers easier for users. Pass the transformer's
type to the make
method and get desired transformer. Now run the create
or/and train
methods of the new
transformer.
The already created aife_transformer_maker object of this class can be used.
See p.3 Transformer Maker in Transformers for Developers for details.
See .AIFEBaseTransformer class for details.
make()
Creates a new transformer with the passed type.
AIFETransformerMaker$make(type)
type
string
A type of the new transformer. Allowed types are bert, roberta, deberta_v2, funnel, longformer, mpnet. See
AIFETrType list.
If success - a new transformer, otherwise - an error (passed type is invalid).
clone()
The objects of this class are cloneable with this method.
AIFETransformerMaker$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other Transformer:
AIFETrType
,
aife_transformer_maker
# Create transformer maker
tr_maker <- AIFETransformerMaker$new()
# Use 'make' method of the 'tr_maker' object
# Pass string with the type of transformers
# Allowed types are "bert", "deberta_v2", "funnel", etc. See aifeducation::AIFETrType list
my_bert <- tr_maker$make("bert")
# Or use elements of the 'aifeducation::AIFETrType' list
my_longformer <- tr_maker$make(AIFETrType$longformer)
# Run 'create' or 'train' methods of the transformer in order to create a
# new transformer or train the newly created one, respectively
# my_bert$create(...)
# my_bert$train(...)
# my_longformer$create(...)
# my_longformer$train(...)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.