Single-label text classification / cheat sheet

Use this cheat sheet

If your the text samples in your dataset can belong to one class.

Example use cases

Positive v.s. negative

(👍v.s.👎)

Sentiment analysis

(😃 or 😱 or 😡 or 😍 or …​)

Data preparation

Structure of imported csv

Datasets with text for text classification need to include:

  • 1 column with text to be used as input

  • 1 column as label to be used as predicted category in the Target block.

Dataset view changes

In the Datasets view, set the encoding of the text feature to Text and the label feature to Categorical.

Example:
If you use the Quora questions dataset Quora train.csv, unzip it and upload it to the Platform. Make sure to set the encoding for question_text feature as Text. Set the target feature as Categorical.

Modeling

Use the Experiment wizard to build a model.

Run experiment

When you’ve created an experiment with the Experiment wizard, a ready-to-run model will populate the Modeling canvas. Everything needed will be set, input and target feature, weights (if you wanted those), loss function, activation, runtime settings, i.e., batch size, learning rate, number of epochs.

You can still edit/add/remove anything on the Modeling canvas or override all the existing choices, delete blocks, and add a new ones.

The only thing left to do is to press the Run button on the upper right corner to start the training process.

Run button

Evaluation

You want to have as low loss scores as possible, and you want the training error to be slightly lower than test error.
Read more on how to evaluate your model in Classification loss metrics.

Deployment

Click New deployment.

Select your experiment and epoch for deployment.

Click Enable to make the deployment accessible through the Peltarion Deployment API for forward pass queries.

Enable button

Text classifier web app

To make it easier to test your model, we have provided a web app.

Click Open web app.

Open web app button
Was this page helpful?
YesNo