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.

  1. Select Connections.
  2. Select your Natural Language Classifier instance.
  3. Click Access the beta toolkit.
  4. Click Sign in with Bluemix.
  5. Confirm the authorization.
  6. Click Add training data.
    You can now train the service.
  7. Click Add class.
  8. Name the class turn-on.
  9. Press Enter to register your class.
  10. Repeat the process for two more classes: turn-off and not-understood.
  11. Select the turn-on Then, click Add text.
  12. Add a sample sentence for the turn-on Then, click Done.
  13. Add more sample sentences that you want to be interpreted as the turn-on class. 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.
  14. Make sure that all the sample texts are marked as the intent turn-on.
  15. Repeat the previous steps for the turn-off class.
    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-understood class for all the sample phrases that fall outside the domain of this classification.
  16. Repeat the process for the not-understood
    After you defined the classes, you need to trigger the system to learn.
  17. Click Create classifier.
  18. Enter a name for your classifier.
  19. Click Create. Then, wait for the training to complete.