Can You Teach Common Sense?

The Limits of AI

photo by Jose Aljovin , courtesy of Unsplash

One of the most important goals of any chatbot is to seamlessly behave as a real human. Today, we can see how many artificial intelligence applications accomplish this in a range of different scenarios. From diagnosing medical conditions, to enhancing the customer service experience, and even producing art, AI might seem unstoppable.

However, one particularly frustrating hurdle chatbots continue to face is common sense. “Common sense” can be defined as a large pool of background information in regards to how the world works. As people, we do not explicitly learn common sense in school, but rather by living and experiencing different events and circumstances as we grow up.

Unfortunately, developers cannot program the “gut feelings” that we humans use to help us make decisions. While neural networks can train bots to behave in certain ways based off of different scenarios, they simply fail to manufacture the ability to infer what decision to make based on subtle, basic information.

One example of this flaw is witnessed by the deep learning network GPT-2.

In October 2020, GPT-2 was posed this prompt:

What happens when you stack kindling and logs in a fireplace and then drop some matches is that you typically start a …

GPT-2’s response? “Ick.” On another try, GPT-2 responded that the fireplace would cause an “irc channel full of people.”

For any real human like you or I, we can easily recognize that kindling, logs, an matches will create “fire.”

For context, GPT-2 isn’t just any neural network. GPT-2 is considered an extremely advanced program, being able to generate entire paragraphs about a given topic when provided with just a sentence of prompting.

Trending Bot Articles:

1. How Conversational AI can Automate Customer Service

2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

3. Chatbots As Medical Assistants In COVID-19 Pandemic

4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

GPT-2 failed to come up with “fire” as the correct response to this prompt because it essentially required the bot to read between the lines of the question and apply implicit information.

This is why common sense is sometimes referred to as dark matter in the realm of artificial intelligence. When creating a bot, we explicitly train it using all the rules and examples they will encounter to fulfill its specific task. But, common sense is open ended.

One attempt to conquer the common sense dilemma was by interpreting common sense as a database of millions of different rules. Each rule would describe a different way that the bot or the environment would act in a given situation.

In 1984, a project called Cyc set out to construct such a database. However, it was realized that this technique quickly ran into several different problems in practice.

For example, consider a rule that declares: If a person goes outside when it’s raining, they will get wet. If you take just a few seconds to think about this statement, you will realize that there are many exceptions to the rule. If a person wears protective clothing or stands underneath an umbrella, then this statement becomes void.

Even if these exceptions were detailed to a bot, there are further rules that dictate when and how those exceptions work. For example, the bot would need to consider the angle and intensity of the rain along with the texture of the protective clothing. If the person stood underneath an object, the relative position of the object and its width would also be important factors.

Beyond the complexity of every rule, the sheer number of rules is too much to tediously handcraft one at a time. With Cyc, more than 1000 human-years were spent on the project.

Another approach uses deep learning AI systems that are meant to imitate the layers of neurons in human brains. The idea is to allow a bot to learn patterns without requiring the developers to specify the rules in advance. We can see similar applications of this type of pattern recognition in self-driving cars or powerful chess playing bots.

A newer approach incorporates elements of this concept and the Cyc approach, forming the ultimate COMET project. COMET, short for “commonsense transformers”, defines common sense thinking as a way to use reason to create responses to an input. This contrasts with Cyc’s mechanics of making the “perfect” deduction with the help of an enormous database.

COMET’s results show drastic progress. Between these two approaches, about 80% of COMET’s responses were found plausible by a group of human evaluators. That’s less than 10% away from expected human performance.

Still, the apparent flaw in deep learning methods is that numbers, rules, and statistics are not the same as true understanding. In short, a neural network won’t ever comprehend that matches and logs will start a fire or that rain makes people wet. Still, some bots can do a pretty good job of convincing you that they can.

“New Test Reveals AI Still Lacks Common Sense.” ScienceDaily, University of Southern California, 18 Nov. 2020, www.sciencedaily.com/releases/2020/11/201118141702.htm.

Pavlus, John. “Common Sense Comes Closer to Computers.” Quanta Magazine, Quanta Magazine, 30 Apr. 2020, www.quantamagazine.org/common-sense-comes-to-computers-20200430/.

Stiefel, Michael. “Is Artificial Intelligence Closer to Common Sense?” InfoQ, InfoQ, 19 Oct. 2020, www.infoq.com/articles/AI-Closer-Common-Sense/.

Toews, Rob. “What Artificial Intelligence Still Can’t Do.” Forbes, Forbes Magazine, 1 June 2021, www.forbes.com/sites/robtoews/2021/06/01/what-artificial-intelligence-still-cant-do/?sh=756563ae66f6.

Don’t forget to give us your 👏 !

https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href


Can You Teach Common Sense? was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

The 6 types of chatbots — Which one do you need?

The 6 types of chatbots — Which one do you need?

A chatbot on an eCommerce website would be totally unlike the one for Banking. Just how we contrast in our personality and talents, the same goes for chatbots in their appearance and activities!

In this blog, we’ll be touching upon what are the different types of AI chatbots, the different types of business chatbots, and their applications and their functionalities. This will give you a clear understanding as to how many types of chatbots are there and what would be the ideal chatbot type for your business!

Here are the types of chatbots

1. Menu/button-based chatbots

Menu/button-based chatbots are the most basic type of chatbots currently implemented in the market today. In most cases, these chatbots are glorified decision tree hierarchies presented to the user in the form of buttons. Similar to the automated phone menus we all interact with on almost a daily basis, these chatbots require the user to make several selections to dig deeper towards the ultimate answer.

While these chatbots are sufficient for answering FAQs that make up 80% of support queries; they fall well short in more advanced scenarios in which there are too many variables or too much knowledge at play to predict how users should get to specific answers with confidence. It’s also worth noting that menu/button-based chatbots are the slowest in terms of getting the user to their desired value.‍

2. Linguistic Based (Rule-Based Chatbots)

If you can predict the types of questions your customers may ask, a linguistic chatbot might be the solution for you. Linguistic or rules-based chatbots create conversational flows using if/then logic. First, you have to define the language conditions of your chatbots. Conditions can be created to assess the words, the order of the words, synonyms, and more. If the incoming query matches the conditions defined by your chatbot, your customers can receive the appropriate help in no time.

However, it’s your job to ensure that each permutation and combination of each question is defined, otherwise, the chatbot will not understand your customer’s input. This is why a linguistic model, while incredibly common, can be slow to develop. These chatbots demand rigidity and specificity.‍

3. Keyword recognition-based chatbots

Unlike menu-based chatbots, keyword recognition-based chatbots can listen to what users type and respond appropriately. These chatbots utilize customizable keywords and an AI application — Natural Language Processing (NLP) to determine how to serve an appropriate response to the user.

These types of chatbots fall short when they have to answer a lot of similar questions. The chatbots will start to slip when there are keyword redundancies between several related questions.

It is quite popular to see chatbots that are a hybrid of keyword recognition-based and menu/button-based. These chatbots provide users with the choice to try to ask their questions directly or use the chatbot’s menu buttons if the keyword recognition functionality is yielding poor results or the user requires some guidance to find their answer.‍

Trending Bot Articles:

1. How Conversational AI can Automate Customer Service

2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

3. Chatbots As Medical Assistants In COVID-19 Pandemic

4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

4. Machine Learning chatbots

Ever wondered what is a contextual chatbot? A contextual chatbot is by far the most advanced of the three bots discussed previously. These types of chatbots utilize Machine Learning (ML) and Artificial Intelligence (AI) to remember conversations with specific users to learn and grow over time. Unlike keyword recognition-based chatbots, contextual chatbots are smart enough to self-improve based on what users are asking for and how they are asking it.

For example, a contextual chatbot that allows users to order food, the chatbot will store the data from each conversation and learn what the user likes to order. The result is that eventually when a user chats with this chatbot, it will remember their most common order, their delivery address, and their payment information and merely ask if they’d like to repeat this order. Instead of having to respond to several questions the user just has to answer with ‘Yes’ and the food is ready!

While this food ordering example is elementary, it is easy to see just how powerful conversation context can be when harnessed with AI and ML. The ultimate goal of any chatbot should be to provide an improved user experience over the alternative of the status quo. Leveraging conversation context is one of the best ways to shorten processes like these via a chatbot.‍

5. The hybrid model

Businesses love the sophistication of AI-chatbots, but don’t always have the talents or the large volumes of data to support them. So, they opt for the hybrid model. The hybrid model offers the best of both words- the simplicity of the rules-based chatbots, with the complexity of the AI-bots.‍

6. Voice bots

To make conversational interfaces even more vernacular, businesses are now beginning to use voice-based chatbots or voice bots. Voice bots have been on the rise for the last couple of years, with Apple’s Siri, to Amazon’s Alexa, and why? Because of the convenience they bring. It’s much easier for a customer to speak rather than type. Voice bots bring frictionless experiences directly to the customer.

So, which type of chatbot is right for you?

While deciding if a chatbot is right for you, place yourself in the shoes of your users and think about the value they’re trying to receive. Is conversational context going to significantly impact this value? If not, then it is probably not worth the time and resources to implement at the moment.

Another thing to consider is your target user base and their UX preferences. Some users may prefer to have the chatbot guide them with visual menu buttons rather than an open-ended experience where they’re required to ask the chatbot questions directly. All the more reason to have users extensively test your chatbot before you fully commit and push it live.

The right chatbot is the one that best fits the value proposition you’re trying to convey to your users. In some cases, that could require enterprise-level AI capabilities; however, in other instances, simple menu buttons may be the perfect solution.

‍What are some applications of Chatbots?

1. Appointment scheduling or Booking bots

Appointment scheduling or booking bots are the kinds of bots you usually find in the Healthcare, airline, and Hotel industries. These bots help customers book slots for appointments with the enterprise they communicate with.

Appointment bots are often linked to Google calendar, so when a customer books an appointment with you, it automatically gets stored in the calendar, creates an event, and sends reminders to both the customer and the business representative. The HR team also uses HR chatbots to schedule interviews for recruitment purposes.

Phia — An intelligent HR chatbot for appointment scheduling

‍So if you have a business that requires a lot of booking and scheduling, this bot serves the purpose! Some of the types of chatbots under this category are-

  • HR Bot for scheduling meetings and interviews
  • Healthcare Bot for booking appointments
  • Travel Bot for flight bookings
  • Number of active users
  • Hotel Booking Bot to book rooms and services
  • Number of active users
Global Village’s chatbot for tourism

Global Village’s chatbot for tourism

  • Appointment Slot Booking can be integrated with any type of business
  • Cinema Bot to book movie tickets
  • Service Bots for automotive businesses
  • And so on…

2. Customer support chatbots

This must be the most popular use-case of chatbots! When someone says the word ‘chatbot’, the first thing to pop up in our mind is that one time we spoke to a chatbot for customer care. These types of chatbots perform all tasks a customer support representative would do. And it does them real good!‍

Poppy’s chatbot for retail engagement

‍Features such as 24/7 hour availability, quick and easy solutions, instant replies, and live chat facilities make chatbots the ideal tool to improve customer service. It not only improves communication between businesses and clients but also builds a rapport with them to earn customer loyalty. They also gather customer feedback and send it to your team so that you can work on the shortcomings.

They allow your customers to easily interact with your business through stimulating conversations and also play their part in increasing sales.

Some of the bot templates under this type of chatbots are-

  • Retail Support Bot
    To handle queries related to your retail product line. It’s also used to sell products directly
  • Telecom Bot
    To provide customers the convenience of checking their bill, make a payment, recharge plan, change plan, change number etc directly through the bot. It also procures any customer queries related to your service
  • Techdesk Bot
    To helps employees connect to the internal technical support team for issues related to the system and access to services/Applications. The bot is also used to send confirmation to the customer through email.
  • Banking Bot
    Caters to your banking needs in an interactive manner. It provides account related information, ongoing offers, helps you get an update on your checkbook, and also takes you to travel booking facilities
  • Orders, deliveries, and logistics Bot
    Order issues help handle issues with food delivery orders
Bandhan bank’s service desk chatbot

‍3. Marketing and sales chatbots

Marketing and sales are the next most popular use-case of chatbots after customer support. So these intelligent bots are able to personalize the customer experience, have a larger engagement capacity, reach a wider audience, analyze customer feedback and data, sends relevant notifications, and moves customers seamlessly through the sales funnel.

Podar Education chatbot to engage parents
  • eCommerce bot
    Browse through products directly from your chatbot. You can send your customers images through carousels and link your website for purchases
  • Education-course bot
    This bot allows prospective students to browse through various course offerings by an educational institution. The chatbot also provides details on course fees, duration, and admission mode per course
  • Automotive Lead Generation bot
    Allows customers to get details on cars, features, prices, etc, along with booking service
  • Real Estate bot
    Collect requirements from your customers on what they are looking for
  • Quiz bot for market research
    Generates a quiz around the market research. It comes with attractive wallpaper and button color customizations. Saves the answers provided by the user, calculates their score, and also sends an email to the user letting them know their score
  • Social media marketing bot
    A lead generation chatbot template for social media marketing agencies. Which notify the admin whenever a new lead is generated
  • Lead generation
    Google helps you take user information and save it in google sheets. So the prospects that are already on your product have strong leads. So this bot will help you store that information which can be used to market products to these customers or provide support to convert these leads
  • Lead generation with Salesforce
    Helps you take user information and save it in Salesforce. Prospects already on your product are strong leads this bot will help you store that information which can be used to market products to these customers or provide customer support to convert these leads

4. Entertainment bots

Entertainment bots are made for entertainment and media purposes. These bots include-

  • The tv show guide
    A simple yet powerful chatbot to help track channels as per category for a service provider
  • The go-karting bot
    The ideal chatbot template for booking go-karting services. The bot also shows some information about tracks and karts
  • Quiz bot
    Serves a quickfire round of questions to those interested in a little harmless fun dose of quiz questions. It ends with giving a quick score based on the correct answers
  • Riddle bot
    To engage your customers through games to keep them coming back to your website
  • News and media bot
    To help users access news from different categories. So the bot flow leads the user to news categories where they can select the desired category to access news and can also subscribe to a category
  • Cinema bot
    Lets your customer’s book movie tickets, read reviews, browse through different genres
  • The entertainment factor
    A bot that assists users with everything at their favorite getaway location. Adding ease to their fun!
  • Youtube channel bot
    Deploy a chatbot using this template anywhere to use it as your new social media channel to share your youtube content
  • The podcast bot
    Helps the user learn about the universe with the help of podcasts or become a VIP member to get updates!

These are just to name a few among the wide range of templates we offer! Register with Engati to build an ideal chatbot for your business and browse through 200 bot templates in the Bot Marketplace that caters to every business need of yours.

Also, to gain a little more insight on chatbot technology, read up on some of these blogs!

Happy Botting!

Don’t forget to give us your 👏 !

https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href


The 6 types of chatbots — Which one do you need? was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

6 Cool Tips for Branding Shopify Chatbot

A name plays a major role in the success of a thing, whether you are naming your newborn baby or a chatbot for your e-commerce store. The name has to be relevant to the subject and the purpose of its activities and it should also align with your Shopify Branding. There are many factors to consider when someone wants to introduce a chatbot to his/her online customers.

The kind of store, the products you sell, and the target demographic are a few of the factors that play a major role in determining the name of your very own bot.

1. What is your industry?

Whether you are birthing a real baby or launching a chatbot on your site, you must choose the right name. If you were to name your daughter Bill, would it work? Absolutely not!

So, you are trying to come up with a catchy name for your chatbot and as well for branding your Shopify store. Ask yourself a few questions. What kind of functions does your chatbot perform? Is it supportive, informative, transactional or does it provide recommendations? Keeping the function in mind, you may choose the name of a human, robot, or give a clever twist to it.

  • A human name, like Cindy or Evelyn. These types of bot names are often a good choice for enterprises. They could be used as chatbots for banking, taxes, medical, or law. They offer a bit more formality and don’t distract from the purpose.
  • A robot name, like iBolt or Alpha. Such names like these make it clear that the user is chatting with a bot rather than a human. Hence it helps avoid any confusion. You might consider a robot name if you’re in the tech industry.
  • A descriptive name, like “Calorie-TrackBot”, helps users develop healthy eating habits. A chatbot name such as “Book Club Bot” for one that offers book recommendations. The advantage of such a naming style is that the user already understands the purpose of the bot before engaging in an interaction with it. Although these names aren’t always quite as personable or approachable, the clarity they offer serves the purpose, and serves it well!
  • A clever name, like Penny for a personal finance advice chatbot, or Pam for a bot that provides prayer and meditation tips. Such a type of chatbot name is best for enterprises in industries such as travel, fitness, food, or beauty. It reflects a more casual, fun, and witty style. A clever name will also ensure that your chatbot stands out, and is likely to endear users to your brand and topic rather easily.
How to turn Shopify Store Visits into $$$$

2. What is your bot’s personality?

Chatbots are highly customizable, but you can only have a few options when giving it the right name. As humans, we tend to give inanimate objects names. We base these names on certain characteristics that we see in them. Since website visitors and customers will find a personality in your chatbot anyway, you should give it a good descriptive name.

Giving your chatbot a character will make it more pleasant for customers and visitors to speak to. The lack of personality will make your bot boring and less engaging. If you have already assigned the bot a role and have developed its tone and speech, you will be familiar with the way your bot interacts. So, if your bot is assisting visitors at a shopping site, then a shopping assistant like Cynthia would be a good name.

Say, you have a spectacle and eye lens store on Shopify, then you could very well name your chatbot IRIS. So, are you getting the hang of naming your chatbot based on what you sell? another fun way in branding your Shopify store.

3. What does your chatbot do?

Another effective way to name your bot is by assigning its name based on the service it offers. So, what does your bot actually do? What is its purpose? What does it help its users do?

For example, TranslateBot could be a good name for a chatbot that automatically translates the content you send to it. On the other hand, Fitness Guru is a suitable name for a bot that keeps you motivated at staying fit. It would work for official websites of gymnasiums, trust me?

Trending Bot Articles:

1. How Conversational AI can Automate Customer Service

2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

3. Chatbots As Medical Assistants In COVID-19 Pandemic

4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

4. Avoid brand names

Avoid getting too specific with your choice of bot names else it will hurt your Shopify store branding. Here’s what you should never do. Never give your bot the name of a brand. So, if you have a denim online store named John England, please refrain from giving your bot a name like JohnEngland Bot. It clearly lacks inspiration. Moreover, it is clearly out of the question if you try to use a brand name you do not own unless you want to get sued.

Example (of what not to do): BotteryBarn for a bot that assists you in finding home furniture. It is a play on a reputed furnishing brand called Pottery Barn.

5. Avoid being too descriptive

Now, I know it may seem like I am contradicting my previous to last point, but this is important. Nothing seems more boring to a visitor than a super-descriptive chatbot name. It is useful to use what your chatbot does as a starting point. However, just don’t make that the chatbot name, c’mon!

Example (of what not to do): Shopping assistant bot, a bot that assists customers while shopping. The only thing you might get from your visitors is a big yawn.

Generating traffic and expanding the reach of your shopping site depends on whether you can get the pulse of the customer or not. Practically everyone has a hard time every once in a while. Some kids might have fared poorly in a test, or a woman might have had a hard day at work. In such a scenario, adding a bit of humor to their day during the time they visit your site will create a lasting impact on your shopping site traffic. It is because everyone likes to feel good, and what is even better is feeling great while shopping.

At Quickreply.ai, we believe that the aim is to have fun with naming our chatbots (unless your bot is something super serious like a lawyer site, medical or tax-related). Most of your users will have their very first chatbot experience with your online store. Hence, we make their experience enjoyable and helps you branding your Shopify store.

Start for FREE today and present the creative side of your business right in front of your customers.

Don’t forget to give us your 👏 !

https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href


6 Cool 😎 Tips for Branding Shopify Chatbot was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

13 Fun Slack Bots to Bring the Human Connection to Your Workspace

Photo by Priscilla Du Preez on Unsplash

Finding new ways for teams to motivate and connect?

Here are 13 Slack bots that will bring fun and build a human connection to your workspace.

1. Trivia

Trivia helps teams forge stronger connections by enabling people to conduct team-building activities and games and feel more productive. Trivia brings together teams to play real-time games and virtual water coolers right inside Slack, Microsoft Teams, and Google Chat.

2. EngageWith

EngageWith is an employee recognition and rewards tool that enriches your company culture. It virtually brings recognition and fun within your Slack and MS Teams workspace.

3. Meme Bot

Tired of copy-pasting memes from google search? Use this Meme Bot with the /meme-list and /meme commands to generate instant memes from slack and be a meme hero.

4. Spoiler

Spoiler is a free Slack add-in to warn your team of possible spoilers. Want to discuss The Force Awakens but a certain someone has not gotten around to it yet? Be the courteous one and warn your team that a spoiler lies ahead.

5. Decision Bot

Need to make a team decision? Who makes the next coffee, where to go for lunch or who’s going to answer the phone. Use Decision Bot to get an instant decision. Use /coinflip or /diceroll to get an instant decision.

Trending Bot Articles:

1. How Conversational AI can Automate Customer Service

2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

3. Chatbots As Medical Assistants In COVID-19 Pandemic

4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

6. Dog Facts

Add this app to your team’s Slack and use the available slash command (A Slack slash command /dogfact) to retrieve a fun fact about dogs!

7. Booky

​Booky lets you quickly share books read with your team. by using /booky you can search for books and post their descriptions allowing you and your team to add it to your Goodreads shelves right there in Slack!

8. Good Today

​Good Today is the easiest way for teams to making giving apart of their company culture. Engage, educate, and empower your employees to have a say in where your company’s charitable dollars go.

9. Yarn

Find video clips from your favorite movies, TV, and music videos. Enter a quote or lyric and Yarn automatically returns a short video clip that matches.

10. CoDo

CoDo for Slack is a social motivation tool to help persistent daily and weekly achievement by making group challenges, tracking, and celebrating the progress with colleagues.

11. Lunch Buddies

This app helps build strong team connections by scheduling participants into random groups for lunch. To initiate the process, invite the Lunch Buddies bot to any channel and say @Lunch Buddies create.

12. Snack

Snack is a 100% opt-in, distraction-free way for remote teams to have virtual coffee breaks. Distributed teams use Snack to build authentic relationships, promote collaboration and share knowledge within Slack.

13. ChatFox

Remote teams that only engage through projects, tasks and deadlines do not foster a culture around shared values and goals. Use ChatFox to incentivize your team to have more meaningful conversations based on shared values.

Do you have any other fun slack bots? Please share here.

Don’t forget to give us your 👏 !

https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href


13 Fun Slack Bots to Bring the Human Connection to Your Workspace was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

Building a Chatbot for Mental Health Awareness and Education

Let’s leverage technology for good.

Photo by Andy Kelly on Unsplash

💬 Chatbots have exploded in growth over the past few years, and for good reason.

According to Forbes, around 60% of millennials have used chatbots, and over 70% of them had a positive experience. On top of that, Accenture reported that 57% of their surveyed executives noticed that chatbots had huge Returns on Investment with minimal effort. Lastly, chatbots have huge potential for scale, and personalized experiences.

In recent years, chatbots have impacted several industries from retail, banking, finance, healthcare, to energy, investment has skyrocketed.

Which got me thinking, to broaden my knowledge within the realm of AI and chatbots, what problems can I solve using the power of tech?

Lo and behold, a mental health awareness chatbot.

Before we get started with the technical breakdown of the chatbot, I actually want to first provide some context on mental health specifically.

🧠 Here’s Why Mental Health Matters.

Photo by Nik Shuliahin on Unsplash

For starters, mental health disorders and problems affect an estimated 792 million people worldwide.

That’s basically 1 in 10 people globally.

In Canada, where I’m from, the problem is even worse, as 1 in 5 Canadians experience a mental illness or addiction problem every single year, with 1 in 2 experiencing one by the time that they reach the age of 40.

70% of the mental health problems also begun during childhood or adolescence, and youth experiencing the highest rates than any other age group. The reason that this is such a big problem is that mental illness can reduce life expectancy by 10–20 years.

Furthermore, the negative economic effect in Canada alone is estimated to be around $51 billion CAD/year attributed to the “healthcare costs, lost productivity, and reductions in health-related quality of life.” [3]

At the end of the day, based on my analysis and research, some of the root causes of the problems that exist can be attributed to:

  • the lack of access to services (due to the lack of funding, lack of accessibility w/ not enough adequate care)
  • the stigma associated with mental health, creating an inability to voice concerns and preventing people from getting the help that they need
  • the lack of systems to support those that need help and assistance

For my project, I decided to tackle the last 2 out of the 3 root causes and attempt to develop a solution to fill the gaps.

Here’s how I did it.

👨‍💻 Technical Breakdown

👋 Step 0: Preparation and Learning Resources

Since I was new to building chatbots, to get myself started, I consulted a few key resources:

These were absolutely golden and extremely helpful along the way.

After I had a decent understanding of the theoretical standpoints, I started to break down the project into a few key steps, which are broken down in detail down below.

Step 1: Transforming Conversational Intents and Definitions to a Pytorch Model
Step 2: Building a Chatbot Framework for Response Processing
Step 3: Creating a Graphical Interface

With the theoretical understanding in place, I got started by opening Visual Studio Code and created a few core files that I knew that I’d need.

  • app.py (for the graphical user interface)
  • chat.py (for building a chatbot framework)
  • intents.json (helping the computer understand the intents)
  • model.py (a few lines of code integrating the deep learning components)
  • nltk_utils.py (for the natural language processing with nltk and other libraries)
  • train.py (for the training of the program itself!)

If you’d like to check out the code, the full repository can be found on Github by following this link!

Trending Bot Articles:

1. How Conversational AI can Automate Customer Service

2. Automated vs Live Chats: What will the Future of Customer Service Look Like?

3. Chatbots As Medical Assistants In COVID-19 Pandemic

4. Chatbot Vs. Intelligent Virtual Assistant — What’s the difference & Why Care?

🚇 Step 1: Transforming Conversational Intents and Definitions to a Pytorch Model

A chatbot framework requires structures where conversational intents are defined. A simple and clean way to go about this is to use a JSON file:

https://medium.com/media/b13288483ef5c1d7e8f1fc3b4dd2458c/href

Every intent contains:

  • a tag (a label/name that you choose)
  • patterns (sentence patterns for the text classifier in the neural network)
  • responses (the answer that you would like the machine to give when done)

Now that we’ve handled all of the conversational intents through the intents.json file, we can move towards the next step, where we handle the initial NLP pre-processing.

https://medium.com/media/a32a4cd3f00118056d0b0f9444b253b2/href

The first thing to do is import the essentials.

Once that’s taken care of, the next task is organizing the documents, words and classification classes.

Throughout that process, I created a list of sentences that could then be broken down further into a list of the stemmed words, with each sentence associated with an intent (a class).

After the natural language processing is handled, I followed the tutorial and proceeded with building out the deep learning model, with Pytorch. For more information on how Pytorch works and the Deep Learning concepts, it’s able to apply, check out this article series.

https://medium.com/media/f9a4eed9b5529bd33cc4fce701f3d9de/href

After the model was built, I continued the tutorial to proceed and build out the training code as shown down below.

The purpose of this code down below is to load the intents.json file, apply the natural language processing code, create the training data, and begin training the model.

https://medium.com/media/718e6e610a3ea9a3423054fb1866ec27/href

Now that the hard part’s done, let’s move towards the next section where I break down the chatbot response framework.

🏗 Step 2: Building a Chatbot Framework for Response Processing

The next step is to build out the framework for the chatbot, with the code displayed down below:

https://medium.com/media/ae4d0a6cbb6e5a9ed6d71fdea43c0fd8/href

Based on the tutorial and other resources I consulted, I then structured the code and wrote my model the way I did to solve the classification problem of gathering the intent from the user intent, through classification (of the tag that the statement falls under, and thus picks a response from that).

💻 Step 3: Creating a Graphical Interface

Lastly, as a bonus, the final piece of the puzzle involved creating a quick graphic interface with Python, and Tkinter, connecting the code with a place that the user could directly click to open.

https://medium.com/media/6f33e2d1db5e4769f6c591d2a0b115c0/href

🔚 Final Thoughts

While this was one of my first Natural Language Processing projects, this was definitely a blast! I was able to play around with my new virtual friend Aura a few times, and I definitely want to build upon this, hopefully turning this into an actual startup to solve the huge gaps within mental health.

Lastly, to end off, I wanted to provide a few quick shoutouts to Darien Schettler, Victor Sami, Vitor Falleiros, Bryan Horowitz, and Afshin Nensi, who were all extremely helpful throughout the process, by providing feedback on my work, and/or sharing some of their thoughts surrounding the mental health chatbot space.

The full video is coming really soon, so keep your eyes peeled for that!

Don’t forget to give us your 👏 !

https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href


Building a Chatbot for Mental Health Awareness and Education was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.