Building An Intent Recognition Classifier
Learn how to set up a chatbot to categorize customer inquiries using the Cohere SDK.
Chatbots are designed to understand and respond to human language. They need to be able to understand the text they hear and understand the context of the conversation. They also need to be able to respond to people’s questions and comments in a meaningful way. To accomplish this, chatbots must be able to recognize specific intents that people express in conversation.
Here is an example of classifying the intent of customer inquiries on an eCommerce website into Shipping and handling policy, Start return or exchange, or Track order.
Set up
Section titled “Set up”Install the SDK.
$ pip install cohereSet up the Cohere client.
import cohere
co = cohere.Client(api_key)Add examples
Section titled “Add examples”These are the training examples we give the model to show the classes we want it to classify. Each example contains the text itself and the corresponding label, or class. The minimum number of examples required is five per class.