Skip to content

Natural Language Classifier

buraksofu edited this page Feb 13, 2017 · 3 revisions

What is Natural Language Processing?

Natural Language means humans spoken language and Natural Language Processing (NLP) algorithms are a subject of Artificial Intelligence research in Computer Science. NLP is related to human-computer interaction, enables computers to understand and classify human natural language with increasing accuracy.

IBM Watson's Natural Language Classifier API

IBM Watson API using deep learning methods to learn from training data and then succesfully classify given natural language input to desired classes. Works with high precision and gets better as the training grows. It's mainly used with small text input such as Twitter posts, SMS's, news, emails and so on.

It can also be combined with other Watson APIs like Speech-to-Text to classify voice questions and route them to appropriate sections.

How to use it?

Explanation

Example Usage

An example usage would be about weather questions. We can provide a training data with questions like:

  • How hot is it today?
  • Will it be sweltering?
  • What's the current temperature in Celcius/Fahrenheit?

This questions should be tagged under "temperature" class.

  • Will it be cloudy?
  • Will there be sun outside?
  • Will it rain?

This questions are all about Weather-condition and should be tagged accordingly.

Training data can get bigger and diversified. After training with this kind of question-tag pairs, we can query our classifier with a question like:

Will it snow today?

Result would be:

Natural Language Classifier is 99% confident that the question submitted is talking about conditions.

And resulting JSON response:

{
  "classifier_id": "004a12x110-nlc-3450",
  "url": "https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/004a12x110-nlc-3450",
  "text": "Will it snow today?",
  "top_class": "conditions",
  "classes": [
    {
      "class_name": "conditions",
      "confidence": 0.9931282955046498
    },
    {
      "class_name": "temperature",
      "confidence": 0.0068717044953501725
    }
  ]
}

Sources

Clone this wiki locally