SlideShare a Scribd company logo
Building Cognitive Applications
with Watson APIs
CON 3054
@sandhyakapoor9
@frankgreco
Background
 Chairman NYJavaSIG (javasig.com)
 Largest Java UG in NA 8k+ members
 First Java UG ever! Sept 1995
 mail: fgreco@javasig.com
 twitter: @frankgreco yell: “Hey Frank!”
 Developer Advocate – IBM Cloud
 Security Architect – WebSphere AS
 Mail: kapoor@us.ibm.com
 twitter: @sandhyakapoor9
To understand cognitive and machine learning
applications
Why are they important
How to enhance your apps with cognitive services
Review the Watson Java SDK, and discuss how to
enhance your apps with cognitive servives
Goal
What Are We Going to Cover?
 What Problems Are We Trying to Solve?
 Didn’t AI Try This Years Ago?
 Machine Learning
 Use Cases
 The Near Future
 Who are the Players
 What is Cognitive Computing?
 IBM Watson and Cognitive Computing
 Demos
What Problems Need to be Solved?
Many applications are not explicitly programmable…
Cursive writing
translation
Autonomous
Driving
Face recognition
http://vision.ics.uci.edu/images/fun/IMG_1183_augmented_reality_faces1.jpg
https://commons.wikimedia.org/wiki/File:Looped_cursive_sample.jpg
We are Used to Deterministic Solutions
Input Output
Same Input gives us the Same Output
Same Input gives us the Same Output
Same Input gives us the Same Output
…
Most of Us are Not Used to Non-Deterministic Solutions
Output1
Input
Input
Input
Input
Input
InputInput
Imput
Input
Input
Input
Inputt
Output2
Output3
Lots of Noisy Datasets
Sensors, voice, images, video
Many variables with noisy data
Probabilistic Outputs
Uncertainty, noisy
data,
randomness,
ModelA ModelB
ModelC
ModelD
Artificial Intelligence – But Didn’t We Try This Already?
AI had very Broad Scope
“Intelligent agents, first-order logic,
knowledge ontologies, probabilistic
reasoning, learning theory, NLP, robotics,…”
Wha’ Happened?
Funding was erratic due to
lofty goals and missed milestones
And Unfortunate Marketing…
Hey I thought “;” was a Terminator?
I’m Sorry Dave…
But I did Inform You I was a Beta
The Real Problem with AI
Much of historical AI was clever, but much of it
was just conventional programming techniques.
Systems still had to be explicitly programmed…
Machine Learning - ML
“Machine Learning” (1959) – Computers that
learn without being explicitly programmed
AI and ML History
 1956 – Dartmouth Research Project on AI
 1961 – Arthur Samuel Checkers program beats Champion
 1970s – Minimal AI funding and progress
 1980s – Expert Systems
 1990s – Minimal AI funding and progress
 1997 – IBM Deep Blue beats Chess Master Garry Kasparov
 2011 – IBM Watson beats 2 top Jeopardy Champions
 2014 – ML vision recognition surpasses humans (Google,FB)
 2016 – Google AlphaGo beats Go Champ 4 out of 5 games
We are now in accelerated growth era of
ML and Cognitive Computing
Software vs. Humans
Jeopardy
2011
Chess 1997 Go 2016
Already Being Used in Production
USPS Zip Code Scanning
Bank Checks
Image Submissions
Credit Card
Anti Fraud
YouTube
Recommendations
Spam filters Facebook Friend
Face Recognition
Apple Photos Image
Recognition
Amazon
Recommendations
Genome
Discovery
Microsoft Skype
Translation
Anti Terrorism
Patterns
Autonomous Driving
Weather
Prediction
Trading Systems
Natural Language
Processing
Hacker Intrusion
Detection
Why the Growth All of a Sudden?
We are in a Machine Learning “Spring”
No… not *that* Spring...
 Huge advances over the past 10-15 years
 Easy, cheap access to ML software via Services
 Access to OSS frameworks and engines
Watson SDKs, etc.
What’s in the Near Future
 More sophisticated computer vision and image detection
 Widespread video/media/et-al recommendation subsystems
 Separate of multiple voices in a crowd
 Musical instrument detection
 Brain, MRI and other medical pattern analysis
Over next 3-5 years,
ML techniques/skills will be in huge demand
Make existing apps more usable -> more usage
Who Are the Players?
Now… What is Cognitive Computing?
“Cognitive computing has been used to refer to
new hardware and/or software that mimics the
functioning of the human brain and helps to
improve human decision-making”
- Wikipedia
Cognitive Computing is Probabilistic
“Cognitive systems are probabilistic. They
generate not just answers to numerical
problems, but hypotheses, reasoned
arguments and recommendations about
more complex — and meaningful — bodies
of data.”
- Dr John E Kelly (IBM)
So… Are There Categories of Cognitive Computing?
Data Enrichment, Augmentation
Translation
Image Recognition
Understanding
unstructured data
Interacting with Humans
Btw, written mostly in Java…
IBM Watson and Cognitive Computing
Cognitive apps are built with Watson APIs
Watson APIs use NLP and various Machine Learning
models/algorithms “under the hood”
Cognitive apps are “mildly” cognitive or “highly” cognitive
IBM Watson and Cognitive Computing
Clever mimicry of the
human brain using
conventional techniques
Apps that use deep
learning ML algorithms
Cognitive Apps
mild high
Watson Services
Java SDK for IBM Watson Services
The Moment You All
Have Been Waiting For…
https://github.com/watson-developer-cloud/java-sdk
https://github.com/watson-developer-cloud/java-sdk
public class Frank {
public static void main(String[] args) {
ToneAnalyzer service =
new ToneAnalyzer(ToneAnalyzer.VERSION_DATE_2016_05_19);
service.setUsernameAndPassword(USER, PSWD);
service.setEndPoint(
"https://gateway.watsonplatform.net/tone-analyzer/api");
// Call the service and get the tone
ToneOptions options =
new ToneOptions.Builder().addTone(Tone.EMOTION)
.addTone(Tone.LANGUAGE)
.addTone(Tone.SOCIAL)
.build();
ToneAnalysis tone =
service.getTone(getInput(), options).execute();
System.out.println(tone);
}
% java Frank
The NullPointers are an awesome band and great musicians
{
"document_tone": {
"tone_categories": [
{
"category_id": "emotion_tone",
"category_name": "Emotion Tone",
"tones": [
{
"tone_id": "anger",
"tone_name": "Anger",
"score": 0.081246
},
…
{
"tone_id": "joy",
"tone_name": "Joy",
"score": 0.811292
},
{
"tone_id": "sadness",
"tone_name": "Sadness",
"score": 0.102273
...
Java one2016 con3054-watsonap-is
https://github.com/watson-developer-cloud/java-sdk
Java one2016 con3054-watsonap-is
Cognitive Application : AskCognitiveCar.mybluemix.net
https://github.com/sandhya9/conversation-enhanced
• Clone - git clone https://github.com/sandhya9/conversation-enhanced.git
• Click on “Deploy to Bluemix” button
• Provide appname
• Provide login credentials
• Click Deploy
Steps to Setup, Build, Deploy and Test Cognitive Application
On Successful Deployment:
On click Edit Code – Your project is setup for Edits & Git Plugin
Build and Deploy Pipeline
Cognitive App bound to Watson services
Conversing : Web Interface
Conversation flow handled by Watson Conversation Service
Flow in Conversation Tool
Conversation handled by Retrieve and Rank
Conversation Flow for answers retrieved from R&R Corpus
Q, A, Rel, A,
Rel..Q, A, Rel, A,
Rel..Q, A, Rel, A,
Rel..Q, A, Rel, A,
Rel..
…
Retrieve
Rank
Q
A
3
A
7
A2
1. Load & Index
content in Solr
2. Train a model
based on
ground truth
3. Query the
service with
Natural
language
4. Return re-
ranked results
based on
machine learning
model
How does R&R work?
Resources
Working with intents
https://www.youtube.com/watch?v=DmvN6ZJrZE4
Working with entities
https://www.youtube.com/watch?v=oSNF-QCbuDc
Working with dialog
https://www.youtube.com/watch?v=3HSaVfr3ty0
Building w/ Watson: Training Watson to Detect User Intent
https://www.youtube.com/watch?v=uYw4Tv1Y5tc
Building with Watson : New Tools for Dialog Scripting
https://www.youtube.com/watch?v=QuR54--vD5o
Ask Technical Questions to NAO Robot and Amazon Echo
See AskDevoxxWatson Cognitive application in action at IBM’s
Keynote on Thursday 9 am – 10:45 am.
Thank You!
@sandhyakapoor9
@frankgreco

More Related Content

PDF
Alchemy api 090915
PPTX
Facebook ads setting up your ad campaign - beekeeper u
PDF
Ads Created for Magazine, Newspaper & Program Placements
PDF
DiVal Safety is a Buffalo Business First Best Place to Work in Western New York
PPTX
ゲーム教育SIG2015年度活動報告
PPT
історичний клуб пошук
PDF
470b_World Trade Symposium_SUMMARY REPORT
PDF
RTS Duštvene mreže talične za biznis
Alchemy api 090915
Facebook ads setting up your ad campaign - beekeeper u
Ads Created for Magazine, Newspaper & Program Placements
DiVal Safety is a Buffalo Business First Best Place to Work in Western New York
ゲーム教育SIG2015年度活動報告
історичний клуб пошук
470b_World Trade Symposium_SUMMARY REPORT
RTS Duštvene mreže talične za biznis

Viewers also liked (12)

PDF
Mirjana gomilanovic Wannabe intervju
PDF
Mortgage industry explained-maria arrua
PDF
Tutorial mail merge office 2007
PDF
DiVal Events - Creative Marketing Assets and Event Aesthetics
PDF
Mobile greenhouse
PPTX
Running blogger relations campaigns d1 11.6.13(2)
PPTX
Presentation angelica c. mawili
PPT
Hodgkins Lymphoma
PDF
Physics for Game: Part1 - Basics
PPTX
Digraj ppt 130304koukai
PDF
Game salad 07
PDF
エコからサステイナブル社会へ
Mirjana gomilanovic Wannabe intervju
Mortgage industry explained-maria arrua
Tutorial mail merge office 2007
DiVal Events - Creative Marketing Assets and Event Aesthetics
Mobile greenhouse
Running blogger relations campaigns d1 11.6.13(2)
Presentation angelica c. mawili
Hodgkins Lymphoma
Physics for Game: Part1 - Basics
Digraj ppt 130304koukai
Game salad 07
エコからサステイナブル社会へ
Ad

Similar to Java one2016 con3054-watsonap-is (20)

PPTX
"An Introduction to AI and Deep Learning"
PDF
Steve Mills - Your Cognitive Future
PPTX
Introduction to Deep Learning for Non-Programmers
PDF
Chatbots in 2017 -- Ithaca Talk Dec 6
PDF
IBM Watson & Cognitive Computing - Tech In Asia 2016
PDF
Big, Open, Data and Semantics for Real-World Application Near You
PPTX
ARTIFICIAL INTELLLLIGENCEE modul11_AI.pptx
PPTX
Metadata in a Crowd: Shared Knowledge Production
PPTX
unleshing the the Power Azure Open AI - MCT Summit middle east 2024 Riyhad.pptx
PDF
AI in Finance: Moving forward!
PPTX
ARTIFICIAL INTELLIGENCE-New.pptx
PPTX
Webinar on AI in IoT applications KCG Connect Alumni Digital Series by Rajkumar
PPTX
Synergy of Human and Artificial Intelligence in Software Engineering
PDF
HKOSCon18 - Chetan Khatri - Open Source AI / ML Technologies and Application ...
PDF
"Methods for Understanding How Deep Neural Networks Work," a Presentation fro...
PDF
SBQS 2013 Keynote: Cooperative Testing and Analysis
PPT
Machine Learning ICS 273A
PPT
Machine Learning ICS 273A
PPTX
Demystifying AI
"An Introduction to AI and Deep Learning"
Steve Mills - Your Cognitive Future
Introduction to Deep Learning for Non-Programmers
Chatbots in 2017 -- Ithaca Talk Dec 6
IBM Watson & Cognitive Computing - Tech In Asia 2016
Big, Open, Data and Semantics for Real-World Application Near You
ARTIFICIAL INTELLLLIGENCEE modul11_AI.pptx
Metadata in a Crowd: Shared Knowledge Production
unleshing the the Power Azure Open AI - MCT Summit middle east 2024 Riyhad.pptx
AI in Finance: Moving forward!
ARTIFICIAL INTELLIGENCE-New.pptx
Webinar on AI in IoT applications KCG Connect Alumni Digital Series by Rajkumar
Synergy of Human and Artificial Intelligence in Software Engineering
HKOSCon18 - Chetan Khatri - Open Source AI / ML Technologies and Application ...
"Methods for Understanding How Deep Neural Networks Work," a Presentation fro...
SBQS 2013 Keynote: Cooperative Testing and Analysis
Machine Learning ICS 273A
Machine Learning ICS 273A
Demystifying AI
Ad

Recently uploaded (20)

PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Business Analytics and business intelligence.pdf
PPTX
Computer network topology notes for revision
PDF
Foundation of Data Science unit number two notes
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
IB Computer Science - Internal Assessment.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PDF
annual-report-2024-2025 original latest.
PPTX
Supervised vs unsupervised machine learning algorithms
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Introduction to Knowledge Engineering Part 1
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Galatica Smart Energy Infrastructure Startup Pitch Deck
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Business Analytics and business intelligence.pdf
Computer network topology notes for revision
Foundation of Data Science unit number two notes
oil_refinery_comprehensive_20250804084928 (1).pptx
Introduction-to-Cloud-ComputingFinal.pptx
Fluorescence-microscope_Botany_detailed content
IB Computer Science - Internal Assessment.pptx
.pdf is not working space design for the following data for the following dat...
annual-report-2024-2025 original latest.
Supervised vs unsupervised machine learning algorithms
ISS -ESG Data flows What is ESG and HowHow
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Introduction to Knowledge Engineering Part 1
Miokarditis (Inflamasi pada Otot Jantung)
STUDY DESIGN details- Lt Col Maksud (21).pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg

Java one2016 con3054-watsonap-is

  • 1. Building Cognitive Applications with Watson APIs CON 3054 @sandhyakapoor9 @frankgreco
  • 2. Background  Chairman NYJavaSIG (javasig.com)  Largest Java UG in NA 8k+ members  First Java UG ever! Sept 1995  mail: fgreco@javasig.com  twitter: @frankgreco yell: “Hey Frank!”  Developer Advocate – IBM Cloud  Security Architect – WebSphere AS  Mail: kapoor@us.ibm.com  twitter: @sandhyakapoor9
  • 3. To understand cognitive and machine learning applications Why are they important How to enhance your apps with cognitive services Review the Watson Java SDK, and discuss how to enhance your apps with cognitive servives Goal
  • 4. What Are We Going to Cover?  What Problems Are We Trying to Solve?  Didn’t AI Try This Years Ago?  Machine Learning  Use Cases  The Near Future  Who are the Players  What is Cognitive Computing?  IBM Watson and Cognitive Computing  Demos
  • 5. What Problems Need to be Solved? Many applications are not explicitly programmable… Cursive writing translation Autonomous Driving Face recognition http://vision.ics.uci.edu/images/fun/IMG_1183_augmented_reality_faces1.jpg https://commons.wikimedia.org/wiki/File:Looped_cursive_sample.jpg
  • 6. We are Used to Deterministic Solutions Input Output Same Input gives us the Same Output Same Input gives us the Same Output Same Input gives us the Same Output …
  • 7. Most of Us are Not Used to Non-Deterministic Solutions Output1 Input Input Input Input Input InputInput Imput Input Input Input Inputt Output2 Output3 Lots of Noisy Datasets Sensors, voice, images, video Many variables with noisy data Probabilistic Outputs Uncertainty, noisy data, randomness, ModelA ModelB ModelC ModelD
  • 8. Artificial Intelligence – But Didn’t We Try This Already? AI had very Broad Scope “Intelligent agents, first-order logic, knowledge ontologies, probabilistic reasoning, learning theory, NLP, robotics,…” Wha’ Happened? Funding was erratic due to lofty goals and missed milestones
  • 9. And Unfortunate Marketing… Hey I thought “;” was a Terminator? I’m Sorry Dave… But I did Inform You I was a Beta
  • 10. The Real Problem with AI Much of historical AI was clever, but much of it was just conventional programming techniques. Systems still had to be explicitly programmed…
  • 11. Machine Learning - ML “Machine Learning” (1959) – Computers that learn without being explicitly programmed
  • 12. AI and ML History  1956 – Dartmouth Research Project on AI  1961 – Arthur Samuel Checkers program beats Champion  1970s – Minimal AI funding and progress  1980s – Expert Systems  1990s – Minimal AI funding and progress  1997 – IBM Deep Blue beats Chess Master Garry Kasparov  2011 – IBM Watson beats 2 top Jeopardy Champions  2014 – ML vision recognition surpasses humans (Google,FB)  2016 – Google AlphaGo beats Go Champ 4 out of 5 games We are now in accelerated growth era of ML and Cognitive Computing
  • 14. Already Being Used in Production USPS Zip Code Scanning Bank Checks Image Submissions Credit Card Anti Fraud YouTube Recommendations Spam filters Facebook Friend Face Recognition Apple Photos Image Recognition Amazon Recommendations Genome Discovery Microsoft Skype Translation Anti Terrorism Patterns Autonomous Driving Weather Prediction Trading Systems Natural Language Processing Hacker Intrusion Detection
  • 15. Why the Growth All of a Sudden?
  • 16. We are in a Machine Learning “Spring” No… not *that* Spring...  Huge advances over the past 10-15 years  Easy, cheap access to ML software via Services  Access to OSS frameworks and engines Watson SDKs, etc.
  • 17. What’s in the Near Future  More sophisticated computer vision and image detection  Widespread video/media/et-al recommendation subsystems  Separate of multiple voices in a crowd  Musical instrument detection  Brain, MRI and other medical pattern analysis Over next 3-5 years, ML techniques/skills will be in huge demand Make existing apps more usable -> more usage
  • 18. Who Are the Players?
  • 19. Now… What is Cognitive Computing? “Cognitive computing has been used to refer to new hardware and/or software that mimics the functioning of the human brain and helps to improve human decision-making” - Wikipedia
  • 20. Cognitive Computing is Probabilistic “Cognitive systems are probabilistic. They generate not just answers to numerical problems, but hypotheses, reasoned arguments and recommendations about more complex — and meaningful — bodies of data.” - Dr John E Kelly (IBM)
  • 21. So… Are There Categories of Cognitive Computing? Data Enrichment, Augmentation Translation Image Recognition Understanding unstructured data Interacting with Humans
  • 22. Btw, written mostly in Java…
  • 23. IBM Watson and Cognitive Computing Cognitive apps are built with Watson APIs Watson APIs use NLP and various Machine Learning models/algorithms “under the hood”
  • 24. Cognitive apps are “mildly” cognitive or “highly” cognitive IBM Watson and Cognitive Computing Clever mimicry of the human brain using conventional techniques Apps that use deep learning ML algorithms Cognitive Apps mild high
  • 26. Java SDK for IBM Watson Services The Moment You All Have Been Waiting For…
  • 29. public class Frank { public static void main(String[] args) { ToneAnalyzer service = new ToneAnalyzer(ToneAnalyzer.VERSION_DATE_2016_05_19); service.setUsernameAndPassword(USER, PSWD); service.setEndPoint( "https://gateway.watsonplatform.net/tone-analyzer/api"); // Call the service and get the tone ToneOptions options = new ToneOptions.Builder().addTone(Tone.EMOTION) .addTone(Tone.LANGUAGE) .addTone(Tone.SOCIAL) .build(); ToneAnalysis tone = service.getTone(getInput(), options).execute(); System.out.println(tone); }
  • 30. % java Frank The NullPointers are an awesome band and great musicians { "document_tone": { "tone_categories": [ { "category_id": "emotion_tone", "category_name": "Emotion Tone", "tones": [ { "tone_id": "anger", "tone_name": "Anger", "score": 0.081246 }, … { "tone_id": "joy", "tone_name": "Joy", "score": 0.811292 }, { "tone_id": "sadness", "tone_name": "Sadness", "score": 0.102273 ...
  • 34. Cognitive Application : AskCognitiveCar.mybluemix.net https://github.com/sandhya9/conversation-enhanced
  • 35. • Clone - git clone https://github.com/sandhya9/conversation-enhanced.git • Click on “Deploy to Bluemix” button • Provide appname • Provide login credentials • Click Deploy Steps to Setup, Build, Deploy and Test Cognitive Application
  • 37. On click Edit Code – Your project is setup for Edits & Git Plugin
  • 38. Build and Deploy Pipeline
  • 39. Cognitive App bound to Watson services
  • 40. Conversing : Web Interface
  • 41. Conversation flow handled by Watson Conversation Service
  • 43. Conversation handled by Retrieve and Rank
  • 44. Conversation Flow for answers retrieved from R&R Corpus
  • 45. Q, A, Rel, A, Rel..Q, A, Rel, A, Rel..Q, A, Rel, A, Rel..Q, A, Rel, A, Rel.. … Retrieve Rank Q A 3 A 7 A2 1. Load & Index content in Solr 2. Train a model based on ground truth 3. Query the service with Natural language 4. Return re- ranked results based on machine learning model How does R&R work?
  • 46. Resources Working with intents https://www.youtube.com/watch?v=DmvN6ZJrZE4 Working with entities https://www.youtube.com/watch?v=oSNF-QCbuDc Working with dialog https://www.youtube.com/watch?v=3HSaVfr3ty0 Building w/ Watson: Training Watson to Detect User Intent https://www.youtube.com/watch?v=uYw4Tv1Y5tc Building with Watson : New Tools for Dialog Scripting https://www.youtube.com/watch?v=QuR54--vD5o
  • 47. Ask Technical Questions to NAO Robot and Amazon Echo See AskDevoxxWatson Cognitive application in action at IBM’s Keynote on Thursday 9 am – 10:45 am.