What it takes to develop a good AI

A robot's face silhouette with a text box inside it.
Summary
  • The author developed a virtual attendant in Portuguese (PT-BR) to teach users how to create a Project Model Canvas through conversation.
  • Initial attempts with IBM Watson Conversation and Google DialogFlow failed due to issues with short answers, context flow, and lack of Portuguese Machine Learning support.
  • The solution was building a custom virtual attendant using a relational database for phrases, intentions, entities, and context flow, combined with Levenshtein queries.
  • The author emphasizes that the corpus is the most critical factor for AI quality, requiring dedication, filtering, and supervision rather than relying solely on machine learning.

We are living in the era of Artificial Intelligence since everyone is talking so much about how it will revolutionize our market and our lives. Well, I want to share today a use case in which I worked directly: creating a virtual attendant that teaches the end user to create a “Project Model Canvas” through conversations in Portuguese (PT-BR).

There are several tools on the market – the famous Chat Bots – that you can think of. The easier option would probably be paying for one of these services, but keep in mind that maintaining a flow of context, recognizing the user’s back and forth in the conversation, and understanding referrals are something these tools currently do not do.

They act as an IVR (Interactive Voice Response) and guide the user’s conversation being active, such as: “What are you going to eat today? Pizza or Hot dog? “ is very different from “What are you going to do today?”, where the customer is free to speak innumerable different answers.

First attempts

The first attempt was to use IBM’s Watson Conversation and insert several models of conversations. The first impact was to treat short answers – such as a simple “yes” – in the dialog models in multiple instances. The user’s response would be simpler or equal to other places, and realized that the flow of context was not followed by the AI.

The following attempt was DialogFlow from Google, which gave support to create the context flow (in this case, called intentions). The thing is, Google does not have any of its Machine Learning enabled for Portuguese.  A simple extra comma, or the lack of it, and the AI couldn’t correctly recognize the user’s intention.

The conclusion was that this world of artificial intelligence for conversation was still a bit immature since there are many things to be tackled yet.

The corpus is the most important!

How could this problem be solved? Creating our own virtual attendant! It started by making a relational database to store the phrases, intentions, entities, and context flow. By using some queries with Levenshtein, we realized in a few lines that our result was achievable.

Let’s clog this database with examples of conversations and see where it gets. Clog with examples? Where can I find examples of conversations that are exactly what the attendant AI should respond to? The answer is:  stop writing code and go generate – or find – a corpus.

And this is what I consider the biggest difference and the biggest obstacle in any intelligence to develop/apply: the corpus that the AI ​​will use to train. The better your corpus, the smarter your AI will be. And in most cases, it is not enough to just put some initial data and then use “Machine Learning” to take the data somewhere.

Take the famous case of “Tay” as an example: Microsoft AI that, in less than 24 hours, was already causing terror on Twitter with its controversial statements and was taken off the air. Training requires dedication, filtering, supervision, and follow-up.

Talk is cheap, show me the AI!

In the end, the goal was achieved even without using the most famous API in the market, but I don’t think it was easy. To start with AI, you need to know programming, but if you ever want to develop it further, you need to know more about data mining, math, and a few other things.

If you have questions or are  interested in knowing more about the whole process and the code, do not hesitate to contact me: natam.oliveira@ckl.io

FAQ

What was the use case described in the post?

Creating a virtual attendant that teaches the end user to create a 'Project Model Canvas' through conversations in Portuguese (PT-BR).

Why weren't existing chatbot tools sufficient for this project?

Existing tools do not maintain a flow of context, recognize the user's back and forth in the conversation, or understand referrals. They act like an IVR (Interactive Voice Response), guiding the user's conversation actively rather than allowing free-form responses.

What issues were found with IBM Watson Conversation and Google DialogFlow?

With IBM Watson Conversation, short answers like 'yes' were treated in multiple instances and the flow of context was not followed by the AI. With Google DialogFlow, while it supported context flow (called intentions), Google did not have Machine Learning enabled for Portuguese, so a simple extra comma or its absence prevented the AI from correctly recognizing user intentions.

How was the custom virtual attendant built?

It started with a relational database to store phrases, intentions, entities, and context flow. Using queries with Levenshtein, the result was achievable in a few lines, and the database was filled with examples of conversations.

What is considered the most important factor when developing AI?

The corpus that the AI will use to train. The better the corpus, the smarter the AI will be. Training requires dedication, filtering, supervision, and follow-up — the case of Microsoft's 'Tay,' which was taken off the air in less than 24 hours due to controversial statements on Twitter, illustrates why.

About the author.

Natam Oliveira
Natam Oliveira

VP of Engineering at Cheesecake Labs - IA / IoT enthusiast. Go bravely where no one have never gone before!