Skip to content

Experiment settings: Text classification

Besides having certain common experiment settings with other problem types, the specific settings for a text classification experiment are listed and described below.

Dataset Settings

Text Column

Defines the column name with the input text that H2O Hydrogen Torch will use during model training.

Tokenizer Settings

Lowercase

Grid search hyperparameter

Determines whether to transform to lower case the text that H2O Hydrogen Torch will observe during the experiment. This setting is turned Off by default.

Note

When turned On, the observed text will always be lowercased before training and prediction. Tuning this setting can potentially lead to a higher accuracy value for certain types of datasets.

Max Length

Grid search hyperparameter

Defines the maximum length of the input sequence H2O Hydrogen Torch will use during model training. In other words, this setting specifies the maximum number of tokens an input text is transformed to for model training.

Note

A higher token count will lead to higher memory usage that will slow down training while increasing the probability of obtaining a higher accuracy value.

Architecture Settings

Backbone

Grid search hyperparameter

Defines the backbone neural network architecture to train the model.

Note

H2O Hydrogen Torch provides several backbone state-of-the-art neural network architectures for model training. H2O Hydrogen Torch accepts backbone neural network architectures from the Hugging Face library (enter the architecture name).

Tip

Usually, it is good to use simpler architectures for quicker experiments and larger models when aiming for the highest accuracy.

Pool

Grid search hyperparameter

Defines the global pooling method before the final fully connected layer that H2O Hydrogen Torch will use in the model architecture. Instead of adding a fully connected layer on top of the feature maps, global pooling is applied to each feature map beforehand.

Gradient Checkpointing

Determines whether H2O Hydrogen Torch will activate gradient-checkpointing (GC) when training the model, starting GC reduces the video random access memory (VRAM) footprint at the cost of a longer runtime (an additional forward pass). Turning On GC will enable it during the training process.

Note

Gradient checkpointing is an experimental setting that is not compatible with all backbones. If a backbone is not supported, the experiment will fail, and H2O Hydrogen Torch will inform through the logs that the selected backbone is not compatible with gradient checkpointing. To learn about the backbone setting, see Backbone.

Tip

Activating GC comes at the cost of a longer training time; for that reason, try training without GC first and only activate when experiencing GPU out-of-memory (OOM) errors.

Custom Intermediate Dropout

Determines whether to enable a custom dropout rate for intermediate layers in the transformer model. When turned Off, H2O Hydrogen Torch will use the pre-trained backbone's usual 0.1 default dropout rate. See Intermediate Dropout to learn how to define a custom dropout rate.

Intermediate Dropout

Defines the custom dropout rate H2O Hydrogen Torch will use for intermediate layers in the transformer model.

Dropout

Grid search hyperparameter

This setting defines the dropout rate between the backbone and neck of the model H2O Hydrogen Torch will apply during model training. The dropout rate helps the model generalize better by randomly dropping a share of the neural network connections.

Training Settings

A text classification experiment does not have specific training settings besides those specified in the training settings section of the common experiment settings page.

Prediction Settings

Probability Threshold

Define a threshold for threshold-dependent Classification Metrics (e.g. F1). For multi-class classification argmax will be used.

Note

This threshold is used as a default threshold when showing all other threshold-dependent metrics in the validation plots.

Environment Settings

A text classification experiment does not have specific environment settings besides those specified in the environment settings section of the common experiment settings page.

Logging Settings

Number of Texts

This setting defines the number of texts to show in the experiment Insights tab.


Back to top