2. Train the classifier
While you wait for the application to restart, you can train the Natural Language Classifier. After you train the service, you will build an application that understands intent in natural language.
These steps do not need your application to be running. Go back to your application listing on Bluemix.
- Select Connections.
- Select your Natural Language Classifier instance.
- Click Access the beta toolkit.
- Click Sign in with Bluemix.
- Confirm the authorization.
- Click Add training data.
You can now train the service.
- Click Add class.
- Name the class
- Press Enter to register your class.
- Repeat the process for two more classes:
- Select the
turn-onThen, click Add text.
- Add a sample sentence for the turn-on Then, click Done.
- Add more sample sentences that you want to be interpreted as the
turn-onclass. For example, add other sample sentences such “Switch on the lighting in my room” and “Can you turn on the lights.”Provide enough examples so that any nouns or objects on which the intent is to act on can be ignored. If the intent is to turn on something, it doesn’t matter where the object is or what the object is.
- Make sure that all the sample texts are marked as the intent
- Repeat the previous steps for the
When you pass phrases through the Natural Language Classifier, the system tries to match against each of its classes and returns a match with the highest confidence even if the confidence level is low.For this reason, it is good practice to have a
not-understoodclass for all the sample phrases that fall outside the domain of this classification.
- Repeat the process for the
After you defined the classes, you need to trigger the system to learn.
- Click Create classifier.
- Enter a name for your classifier.
- Click Create. Then, wait for the training to complete.