Chapter 3b: Classification

"Classification" is a machine learning problem where you input text and get back a label.

Similar to summarization, classification also used to require machine learning expertise, data samples, and formal evaluations.

Now, using LLMs, anybody can build a classifier in no time.

Here is a classifier:

async function classifier(ticket) {
    const botResponse = await sendPost("https://acme-ai.com/v1/chat", {
        sender: "user",
        message: `
            ${ticket}

            classify the above ticket. return a single word chosen from the following labels: feature, bug, research, support, architecture
        `
    })

    return botResponse.message;
}