Leverage technology.

Picture: Andy Kelly on Loosen

In recent years, chatbots have affected several industries resale, banking, Finance, healthcare, energy, investment have skyrocketed.

What made me think, to expand my knowledge in the field of artificial intelligence and chat robots, what problems can I solve with the power of technology?

See, mental health awareness chatbot.

Before we start the technical specification of chatbot, I actually want to give some mental health context.

Picture: Nik Shuliahin on Loosen

First, mental disorders and problems affect those assessed 792 million people global.

It is basically one of the top ten people worldwide.

In Canada, where I come from, the problem is even worse, with one in five Canadians experiencing a mental health or addiction problem each year, and one in two experiencing one by the time he or she reaches the age of 40.

70% of mental health problems have also started in childhood or adolescence, and young people experience other age groups the most. The reason this is such a big problem is that mental health can reduce life expectancy by 10 to 20 years.

In Canada alone, the negative economic impact is estimated at about $ 51 billion per year due to “health care costs, lost productivity, and declining 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 existing problems can be considered to be related to:

  • lack of access to services (lack of funding, lack of availability / lack of inadequate care)
  • a mental health stamp that makes it impossible to express concerns and prevents people from getting the help they need
  • lack of systems for those in need of support and assistance

In my project, I decided to address the last 2 of the 3 root causes and try to develop a solution to fill the gaps.

That’s how I did it.

👋 Step 0: Preparation and learning resources

These were absolutely golden and very useful along the way.

Once I had properly understood the theoretical perspectives, I began to divide the project into a few key steps, which are broken down in detail below.

Phase 1: Transforming discussion purposes and definitions into a Pytorch model
Step 2: Building a chatbot framework for processing a response
Step 3: Creating a graphical user interface

Once the theoretical understanding was in place, I started by opening the Visual Studio Code and creating a few kernel files that I knew I needed.

  • app.py (graphical user interface)
  • chat.py (for building a chatbot frame)
  • intents.json (helps the computer understand the purposes)
  • model.py (a few lines of code integrating in-depth learning components)
  • nltk_utils.py (for handling natural language with nltk and other libraries)
  • train.py (for the program itself!)

If you want to check the code, the entire archive can be found on Github by following this link!

1. How chat technology can automate customer service

2. Automated vs. live chats: what does the future of customer service look like?

3. Chatbots as a medical assistant in the COVID-19 pandemic

4. Chatbot vs. Smart Virtual Assistant – what’s the difference and why treatment?

🚇 Step 1: The purpose and definitions of the discussion are converted to a Pytorch model

Each purpose includes:

  • tag (label / name of your choice)
  • patterns (sentence characters for neural network classifier)
  • answers (the answer you want the machine to give when it is ready)

Now that we have processed all the conversations through the intents.json file, we can move on to the next step where we will deal with the initial preprocessing of NLP.

The first thing is to bring the essential.

Once done, the next task is to organize the documents, words, and classification categories.

Throughout the process, I created a list of sentences that can then be further broken down into a list arm words, and each sentence is related to a purpose (category).

Once the natural language processing was taken care of, I followed the curriculum and continued to build in-depth learning with Pytorch. For more information on Pytorch’s operations and the Deep Learning concepts it can apply, see this series of articles.

Once the model was built, I continued the tutorial to continue and build the training code as shown below.

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

Now that the hard part is done, we move on to the next partition where I break down the chatbot response frame.

🏗 Step 2: Create a chatbot frame to process the response

Based on the tutorial and other resources I used, I built the code and wrote my model in a way that solved the classification problem to collect the intention from the user’s intention through classification (the identifier to which the expression belongs and thus selects the answer from it).

💻 Step 3: Create a graphical user interface

Finally, I wanted to end a few quick cries Darien Schettler, Victor Sami, winner falleiros, Bryan Horowitzand Afshin nensi, who were all very helpful throughout the process, giving feedback on my work and / or sharing some of their thoughts on the mental chatbot.

The whole video is coming really soon, so keep your eyes out for it!

LEAVE A REPLY

Please enter your comment!
Please enter your name here