Skip to main content

Overview

For single-label classification, we first define an enum for possible labels and a PHP class for the output.

Example

Let’s start by defining the data structures.

Classifying Text

The function classify will perform the single-label classification.

Testing and Evaluation

Let’s run an example to see if it correctly identifies a spam message.