DEV Community

Zsuzsanna Horváth
Zsuzsanna Horváth

Posted on

RASA: a Newbie's Journey

Part1: Chatbot Begins

I did something stupid. And it was awesome.

High diving with a horse
After my exceptionally ambitious feats of coding, like:

  • Calculator
  • Shopping list creator
  • Guess the Number: The Game

I decided to make a chatbot.

I am documenting my journey and what I learned in the process.

Basically I am expressing what I would say to myself 2 months ago.
After a smack on the head.

TL;DR:

  • Create a chatbot, it is the most rewarding way to learn Python and NLP (among other things).
  • Use RASA, the framework that gathers all the NLP and machine learning goodness for you, and can be tamed with Python. You just need to feed it data to grow healthy and strong.
  • Installing might be a heroic achievement, but the whole internet will come together to help you.

Why is it in fact a good idea to make a chatbot as your first real project?

Not because secretly it is easy, sorry. It is not, even with the proper framework (and there is a lot of those). But because it will drag you through a lot of things in small doses (NLP, Machine Learning, using API-s, Bash scripting, UX, even marketing, if you are into that), and will teach you to think about how these things link to each other.
Chatbots are also versatile, you can bend them to fit your territory, it is a good opportunity to learn to use tools from various fields.
And in the end you will create a personality that will actually answer you (they will be your, preprogrammed answers, but you may be in for a surprise).

Why RASA?

RASA is well documented:

It is written in Python, you can check the source here.
It runs fully on your computer, no need to register anywhere.
You own your data, yet you can integrate your stuff to the cloud.
You can hack the pipeline any step of the way, but the default options will get you results.

So how do we start?

I have found two tutorials made by RASA a simple one and a more complex, they are a bit outdated, but informative.
Tutorials are not the best solution, they never show the obstacles their creators had to overcome, so the sooner you can switch to reading documentations the better. But they are good to get you started. First of all, they show that it can be done, give you a process to follow, and help you keep on track even after you spent days on manually installing and configuring tensorflow (which may or may not have happened to me and my old laptop, don't ask).

Can we finally install the thing?

Your best friend here is requirements.txt, a file that, as the name suggests, lists all the software requirements. This is mine that I have merged from the ones I found on the remote repositories of the RASA project.

Use pip to install:

pip install -r path/to/requirements.txt

If you want to use a specific version of Python and pip doesn't seem to respect that wish, run pip as a Python script:

python3 -m pip install -r path/to/requirements.txt

Just substitute the number with the Python version you want to use.

It is a long list, so be prepared, you may need to dig deep into the packages of your system, dependencies have dependencies, you have your own things, a lot of opportunities are there for trouble. I cannot help you much with this, as I am not the one to live on your system.
Most problems I faced were solvable by beginner methods:

  • Search the error message (common error messages in Python)
  • Search for the problem on Stack Exchange or Stack Overflow (or blog posts, or Linux forums, or Github threads or...), again, using your favorite search engine as a hub.

With pip you get standard python backtraces, so at least you might feel at home.

Sometimes, if pip is not cooperative, you can try to install some packages with the native package manager of your system.

You may want to consider using virtual environments, which I did not, because this is my first actual project, and there is such a thing as too many abstractions at once.

Good luck, and see you at Part 2!

Top comments (1)

Collapse
 
socr102 profile image
Eric

Interesting
I want to see your part 2 quickly
I am too interested in Rasa Framework
I hope we discuss about the Rasa in the future