Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Level up your Bot with Watson

Level up your Bot with Watson

The Watson Services by IBM combine 20+ services you can use to enhance your bot, from Natural Language Processing to Image Analytics and beyond.

Sebastian

June 24, 2016
Tweet

More Decks by Sebastian

Other Decks in Programming

Transcript

  1. Bot ingredients Application Platform “Bot” • Facebook • Telegram •

    Slack • ... • NLP • Machine Learning • API • Database
  2. Bot ingredients Application Platform “Bot” • Facebook • Telegram •

    Slack • ... • NLP • Machine Learning • API • Database
  3. blitzlicht Improve communication by asking simple questions. 1. Ask one

    question 2. Have people answer in their own words 3. Get insights
  4. Watson API example { "status": "OK", "language": "english", "text": "I

    love bots so much" "docEmotions": { "anger": "0.147255", "disgust": "0.041646", "fear": "0.090144", "joy": "0.50019", "sadness": "0.259973" } }
  5. Code example Future emotion(String text) { String uri = '/calls/text/TextGetEmotion';

    String parameters = 'apikey=${apiKey}&text=${text}&outputMode=json'; return http.get(Watson.baseUrl + uri + '?' + parameters).then((data) { Map response = JSON.decode(data.body); if (response['status'] == 'ERROR') { throw new WatsonException(response['statusInfo']); } return response; }); }
  6. Code example watson.emotion(answer.text).then((Map response) { response['docEmotions'].forEach((String key, String value) {

    if (double.parse(value) > 0.5) { // The text has a pretty clear overall emotions } }); });