ohjho / chatbot_guide

A Starter Guide to Chatbot Engineering

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚀 A Starter Guide to Chatbot Engineering

made-with-python MIT license tested-on-osx

Readings

  • Chatbot Fundamentals by Liza Daly, former CTO at Safari; it's an interactive guide with hands-on coding experience to teach some of the methods and tools useful for building a rule-based open domain chatbot (Brobot).
  • Building a Simple Chatbot from Scratch in Python, uses and explains a lot of concepts in NLP like tokenization, stemming, bag-of-words, tf-idf, and cosine similarity to build a very simple rule-based chatbot.
  • Writing a Google API MapBot from scratch and deploying on Facebook Messenger, talks about how to use the StanfordCoreNLP, SK-Learn, MySQL, and GoogleMapsAPI and FacebookMessengerAPI to build a simple rule-based task-orientated chatbot. It provides a nice example on how to design dialog.
  • Conversational AI, gives a brief history of chatbot, explains the basic concepts, compares Dialogflow vs Rasa, and an example of how to build a task-orientated chatbot with companion source code.

Libraies

  • Dialogflow ask API.AI: a closed-source Google-owned API that uses NLP and Machine Learning to provide an end-to-end Chatbot model. It can easily integrate with 3rd party platforms, making deployment simple.
    • Here is a demo on how someone used API.AI to build a food ordering chatbot on Slack.
    • And here someone built a movie chatbot.
  • Rasa NLU + Core: an open-source library. The NLU module provides NLP tools for intent classification and entity extraction. While the Core module handles dialogures and fulfillment.
  • ChatterBot: an open-source python library that uses a selection of machine learning algo to produce different types of responses
  • TextBlob: an API for diving into common NLP tasks (e.g. POS tagging, noun phrase extraction, sentiment analysis, classification, translation, etc.)
  • spaCy: another NLP API built in CPython that excels at large-scale information extraction, aka Speed.

Interesting Projects

A Very Brief Intro to Chatbots

Task-orientated vs Open Domain

Task-orientated

image of task-orientated chatbot

Fits most real-world business needs and trained in a specific domain to handle a few particular tasks.

Open Domain

Where the conversation can go anywhere on an infinite number of topics. mitsuku and DeepQA are two examples.

Rule-based vs Self learning

Rule-based

Answers are generated based on rules that it's been trained on. This type of bots can handle simple queries but fail at complex ones

Self-learning

Uses Machine Learning approach that's more efficient than rule-based and are of two types...

Retrieval Based vs Generative
  • Retrieval: using heuristic to select a response from a library of predefined responses
  • Generative: bots generate original answers

Recurrent Neural Network (RNN)

image of RNN

Context is important in language, which is why RNN, networks with embedded loops that allow pass information to persist, is a good match for training Chatbots.

Siraj, the Youtube Star, explained how to use TensorFlow to build an RNN based Chatbot in this video with the companion source code.

Long Short Term Memory Networks (LSTMs)

LSTMs are a special kind of RNN that has preformed particular well because it excels at retaining long-term memory of the dialog flow. Understanding LSTM Networks by Chris Olah, a Google Brain Research Scientist, talks in depth about how they work.

Sequence to Sequence Learning (Seq2Seq)

image of seq2seq

Seq2Seq models consist of two RNNs: an encoder RNN and a decoder RNN. The encoder reads the input sentence and is responsbile for emitting a context. Based on the context, the decoder generates the output sequence. This github repo have some sample code on building a Seq2Seq chatbot.

Portfolio

  1. A translation Chatbot
  2. A HK home price prediction Chatbot
  3. A trading assistant Chatbot
  4. A traditional chinese Chatbot from scratch

About

A Starter Guide to Chatbot Engineering