Watson

The Five-Minute, Barebones News Chatbot

Share this post:

Build a simple news chatbot with IBM Cloud

Do you have five minutes and want to build a really simple news chatbot? I tried this yesterday with IBM Cloud and the Watson Assistant and Discovery services. The result is on GitHub in my repository watson-chatbot-discovery-news. It utilizes the CLI tool from my previous blog post as a user interface and for testing. Here are the details.

Let’s talk news

The chatbot core is a simple dialog in Watson Assistant. A dialog node “client-side news” reacts to a detected “news” intent. The search phrase for the news items needs to be quoted and is defined as a pattern-based entity.

What are the headlines for “IBM acquires Red Hat”?
Any news on “gift ideas technology gadgets”?

Within the dialog node for news, a client call action channels all relevant information to the client and waits for the result. That result is then used within the response in the child node.

Dialog nodes for news chatbot

Dialog nodes for news chatbot

Discover news and gadgets

A simple Python function retrieves news from the Discovery service. It is invoked as client action by the CLI-based chatbot. The news items are then added to the defined context variable and fed back into Watson Assistant to form the message response. The tool as chatbot client then prints the response and ask for the next user input. See the code and instructions on GitHub for more details on the setup.

And, if you are curious about the gift ideas, there are some top 10 and top 25 lists for technology gadgets in the news. Moreover, some news sites discuss security implications of those gadgets. As a security-minded person, I only provide the links to the gadget news covering security. For everything else, you need to try out the five-minute chatbot.

Please enter your input message:
any news on “gift ideas technology gadgets”

>>> processing client actions…

Response:
[
“This is what I found: Christmas Gift Guide 2018: 25 gadget gift ideas for tech kids // 10 Cool Tech Toys For Kids 2018 | Toy Gift Ideas on Amazon // 20+ Top Tech Gift 2018 – Best Ideas for Cool Technology Gifts // Holiday gift guide 2018: CNET editors\u2019 top picks \u2013 Breaking tech // Is your gift secretly spying? Mozilla ranks tech security in holiday shopping list // Some great holiday gift ideas for beloved seniors // The Best Holiday Gifts for Tech Lovers // Mozilla ranks dozens of popular \u2018smart\u2019 gift ideas on creepiness and security \u2013 Tech Media Magazine // DUETTO – precious earbuds with professional services // 25 Tech Gifts Under $100 That Are Totally Ideal For Your Brother, Dad, or Boyfriend”
]

Related resources

Want to learn more? Here are my recommendations for your reading list:

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.

Technical Offering Manager / Developer Advocate

More Watson stories
May 1, 2019

Two Tutorials: Plan, Create, and Update Deployment Environments with Terraform

Multiple environments are pretty common in a project when building a solution. They support the different phases of the development cycle and the slight differences between the environments, like capacity, networking, credentials, and log verbosity. These two tutorials will show you how to manage the environments with Terraform.

Continue reading

April 26, 2019

Analyze Logs and Monitor the Health of a Kubernetes Application with LogDNA and Sysdig

This post is an excerpt from a tutorial that shows how the IBM Log Analysis with LogDNA service can be used to configure and access logs of a Kubernetes application that is deployed on IBM Cloud.

Continue reading

April 24, 2019

How To Use IBM Cloud Object Storage with Veeam

As you may have heard, Veeam 9.5u4 now includes an integration with IBM Cloud Object Storage. This integration can result in up to 10x savings on long-term data retention and an overall reduction in IT and primary storage costs.

Continue reading