3. Test the services

In this section, you test the language classifications that you trained to see how the Natural Language Understanding service interprets your phrases.

  1. Be sure that your Node-RED application on Bluemix is running
  2. Select the application link to open your Node-RED application.
  3. Open the Node-RED flow editor.
  4. Create a new flow tab. Then, drag an input inject node onto the canvas.
  5. Drag a Watson natural language classifier node onto the canvas.
  6. Drag an output debug node onto the canvas.
  7. Double-click the natural language classifier node to configure it to list the classifiers. Then, click Done.
  8. Wire the nodes together. Then, deploy the flow.
  9. Initiate the flow by clicking the tab on the timestamp
    You should see your classifier.
  10. Make a note of the classfier_id.
  11. Drag another inject and natural language classifier node onto the canvas.
  12. Configure the inject node to send a sample phrase. Name the node Car AC.
  13. Configure the natural language classifier node:
    1. Name the node IOT – Classification.
    2. Set the mode to Classify.
    3. Set the Classifier ID to your classifier_id that you noted in a previous step.
  14. Wire the nodes together.
  15. Initiate the new flow. Then, note the output. The classifier reports with a confidence level against each of the three classes in your classifier.
  16. Drag a debug node and a natural language understanding node onto the canvas.
  17. Open the natural language understanding node to specify which items are extracted. Select the following check boxes:
    • Entities
    • Keywords
    • Semantic Roles
    • Semantic Entities
    • Semantic keywords

  18. Configure the debug node and set the Output field to features.
  19. Wire the nodes together.

You should see the keywords being identified.

The online JavaScript compressor will help you optimize your scripts for a faster page loading.