1. Learn
  2. /
  3. Courses
  4. /
  5. Building Chatbots in Python

Exercise

Intent classification with sklearn

An array X containing vectors describing each of the sentences in the ATIS dataset has been created for you, along with a 1D array y containing the labels. The labels are integers corresponding to the intents in the dataset. For example, label 0 corresponds to the intent atis_flight.

Now, you'll use the scikit-learn library to train a classifier on this same dataset. Specifically, you will fit and evaluate a support vector classifier.

Instructions

100 XP
  • Import the SVC class from sklearn.svm.
  • Instantiate a classifier clf by calling SVC with a single keyword argument C with value 1.
  • Fit the classifier to the training data X_train and y_train.
  • Predict the labels of the test set, X_test.