17
Building an App Using the Natural Language Classifier

Building with Watson - Interpreting Language Using the Natural Language Classifier API

Embed Size (px)

Citation preview

Page 1: Building with Watson - Interpreting Language Using the Natural Language Classifier API

Building an App Using the Natural Language Classifier

Page 2: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Housekeeping Items

• Webinar slides, live recording and Q&A will be emailed

• Ask questions at any time during the presentation - Use chat window on the webinar panel - We're on Twitter: @IBMWatson #BuildingWithWatson

©  2015  International  Business  Machines  Corporation

Page 3: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Our Expert: Rahul A. Garg

©  2015  International  Business  Machines  Corporation

Strategy and Offering Management, Watson Solutions

Page 4: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

What will be covered today?

• Overview• Sample Calls• Parameters• Q&A

©  2015  International  Business  Machines  Corporation

Page 5: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Overview• Watson Natural Language Classifier interprets

and classifies natural language with confidence.

• NLC is tuned and tailored to short text (1000 characters or less) and can be trained to function in any domain or application.

• Variety of uses such as Q&A

©  2015  International  Business  Machines  Corporation

Page 6: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Usage Examples

• Tackle common questions • Classify SMS texts • Classify tweets

©  2015  International  Business  Machines  Corporation

Page 7: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson©  2015  International  Business  Machines  Corporation

Page 8: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Sample Application: Questions on the NLC

• This application shows how to build a question-and-answer application

©  2015  International  Business  Machines  Corporation

Page 9: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Preparing Data• Train the NLC using data in comma-separated value (CSV) format.• Rows vs. Columns - Row: Example record - Columns: Based on the number of records; contains representative text to

classify and classes that apply to the text

©  2015  International  Business  Machines  Corporation

CSV file with four records. Each record in this sample includes the text input and one class, which are separated

by a comma.

Page 10: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Creating and Training Classifier• $ curl -i -u "<username>":"<password>" \• -F training_data=@<path_to_file>/weather_data_train.csv \• -F training_metadata= "{\"language\":\"en\",\"name\”

:\"TutorialClassifier\"}" \"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers"

• Reference

©  2015  International  Business  Machines  Corporation

Page 11: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Sample Response• { • "name": "TutorialClassifier", • "language": "en", • "status": "Training", • "url": "https://gateway.watsonplatform.net/natural-language-

classifier/api/v1/classifiers/10D41B-nlc-1", • "classifier_id": "10D41B-nlc-1", • "created": "2015-05-28T18:01:57.393Z", • "status_description": "The classifier instance is in its training phase, not yet

ready to accept classify requests" • }

©  2015  International  Business  Machines  Corporation

Page 12: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Classifying Text• $ curl -G -u "<username>":"<password>" \

"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/<classifier_id>/classify" \ --data-urlencode "text=How hot will it be today?"

©  2015  International  Business  Machines  Corporation

Page 13: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Sample Response• {• "classifier_id": "10D41B-nlc-1", • "url": "https://gateway.watsonplatform.net/natural-language-

classifier/api/v1", • "text": "How hot will it be today?", • "top_class": "temperature", • "classes": [ • { "class_name": "temperature", "confidence": 0.9998201258549781 }, • { "class_name": "conditions", "confidence": 0.00017987414502176904 }

] }

©  2015  International  Business  Machines  Corporation

Page 14: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson

Are you ready to get started?

• Watson App Gallery• Getting Started Docs• Toolkit for NLC• API Explorer• API Reference Guide

©  2015  International  Business  Machines  Corporation

Page 15: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson©  2015  International  Business  Machines  Corporation

Q&A

Page 16: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson©  2015  International  Business  Machines  Corporation

What’s next?• Look out for a follow up email with a link to the on-demand version of the webinar,

presentation slides and Q&A recap

• The series continues bi-weekly on Wednesdays @ 12pm ET / 9am PT

• Wednesday, December 2, 2015 • Optimize Conflicting Decisions with the Tradeoff Analytics API

Page 17: Building with Watson - Interpreting Language Using the Natural Language Classifier API

#BuildingWithWatson©  2015  International  Business  Machines  Corporation

Thank you for attending!

Contact usPhone: 1-877-253-0308

Email: [email protected]: Watson Developer Cloud