SkillAgentSearch skills...

ChatBot

An open source, API centric chat bot platform in Django Rest framework developed with python chatterbot and NLTK packages.

Install / Use

/learn @Surendhar95/ChatBot
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CHAPTER-1

INTRODUCTION

A chatbot is a computer application that can mimic a human-like conversation in natural language. The concept of chatbot has evolved so much since its inception in 1960s.Chatbots have transformed into an intelligent conversational agents from just an interface to communicate with the users.

CHAPTER-2

REVIEW


2.1 HOW CHATBOTS WORK

Today chatbots are integrated into systems that provide users with entertainment, learning experience, information retrieval and online support. In the present scenario, chatbots are perceived as an interface that can greatly facilitate in information retrieval through Human Computer Interaction(HCI) since the chatbot application can reduce many levels of the program flow by interacting with an user to fetch the exact results, an user wants from the system. For example, consider a pizza delivery website that takes orders from customers using a chatbot interface integrated into their application. Suppose,a customer visiting the website to place order that comprises a large pizza with extra cheese and a pepsi, he has to type in the details of the order in the chatbot interface. A typical conversation with the chatbot could be like this:

Bot : "Welcome. How can I help you? "

Customer : "I would like to place an order"

Bot : "Okay sure , when you are ready"

Customer : "Get me a large pizza with extra cheese"

Bot : "Done. Can I get anything else for you. Would you like a pepsi along with this, most people prefer this combo"

Customer : "Ok then, add a pepsi too"

Bot : "Thank you sir/mam.Your order is placed. Please pay Rs.486 in payment page you will be redirected now."

As you can see the usual path an user follows to place an order is greatly simplified by using the chatbot interface in the place. This reduction in the usual program flow attributes to the importance and the gaining popularity of the chatbot in recent times.

2.2 HOW TO DEVELOP A CHATBOT

A typical chatbot application consists of an interface for input and output, a core machine learning model (may include AI), storage adapter. When Building AI and ML for your Chatbot, you basically have two main options at this time.You can use a third party tool which will take care of the AI/Conversational part of the Chabot or you can make your own using Machine Learning. The second options sounds overwhelming, but quite a few developers are choosing to go this route and many companies are trying to democratize Machine Learning.

Machine learning approach

You can build your own NLP/NLU by using Machine Learning. One of the first things to consider will be the type of model you want to build.-Retrieval Based Model or a Generative Model.

Retrieval-based models are easy to understand and work on. They usually work with a source of predefined and available responses and eventually get and a good command over context and content. The retrieval-based models contain some good configuration of Machine Learning but they are not configured to generate any new text, they just pick the appropriate text from a predefined class and set of texts and project the one that matches the intent of a question or a statement. Retrieval based models will go perfect will those chatbots that just perform a task and nothing else. You will have a set of answers and your chatbot will answer to user according to them and the keywords

Generative models are hard to understand and setup they do not rely on the predefined class and generate text of their own according to the understandings of a giving question or statement. Generative models work with Machine Translation and translate the content and context to the machine. They generate brand new responses from the scratch and put them in front of the user. If you want to go big, this model is for you. It can be a direct jump in the AI playground but it will make mistakes so you should prepare yourself for them. You will have a feel that you are talking to a human.

Using an NLP/NLU Platforms

Natural Language Processing (NLP) and Natural Language Understanding (NLU) platforms attempt to solve the problem by parsing language into entities, intents and a few other categories. Different NLP platforms may have different names however the essence is more so the same. Here are categories:

Agents correspond to applications. Once you train and test an agent, you can integrate it with your app or device.

Entities : represent concepts that are often specific to a domain as a way of mapping natural language phrases to canonical phrases that capture their meaning.

Intents represent a mapping between what a user says and what action should be taken by your software.

Actions correspond to the steps your application will take when specific intents are triggered by user inputs. An action may have parameters for specifying detailed information about it.

Contexts are strings that represent the current context of the user expression. This is useful for differentiating phrases which might be vague and have different meaning depending on what was spoken previously.

Examples of such platforms are IBM's Watson, Facebook's 'Bot for messenger',wix.ai, Pandorabots etc.

2.3 API CENTRIC CHATBOT

In this work, we emphasized to build a chatbot platform that is capable of machine learning and natural language processing using python's Chatterbot library and NLTK – Natural Language ToolKit. The core model of ML used is Retrieval based model. The platform is language independent, can be easily trained and integrated with other applications.

ChatterBot is a Python library that makes it easy to generate automated responses to a user's input. ChatterBot uses a selection of machine learning algorithms to produce different types of responses. This makes it easy for developers to create chat bots and automate conversations with users. NLTK is a leading platform for building Python programs to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, and tagging, parsing, and semantic reasoning, wrappers for industrial-strength NLP libraries.

An API-Centric or API-Driven Web Application is a web application that basically executes most, if not, all its functionality through API calls. In an API-Centric web application, front-end communicates with backend using just APIs.There are a number of advantages of developing an API-centric web application, namely,

  1. Easy consumption on multiple devices. RESTful APIs provide a lightweight integration model that significantly helps in creating mobile applications.
  2. Business logic is well contained with individual APIs.
  3. Ease of application development as focus of application in on the front end user interaction.
  4. Forces Reuse, as APIs developed can be used by multiple application on multiple form factors.

This project uses Django REST framework to develop RESTful APIs which can be used to hook the frontend of applications with the chatbot platform to use the features of the platform typically get an output statement for an input statement.

CHAPTER-3

MACHINE LEARNING IN CHATBOT

One of the main components of a chatbot application is machine learning model. The first step in developing a chatbot starts with deciding the model of learning because it is the core that determines the kind of chatbot you will develop. This chapter describes how machine learning is used in this project so that the chatbot is able to acquire new knowledge while interacting with the user.

3.1 MACHINE LEARNING MODELS

Retrieval-based models are easy to understand and work on. They usually work with a source of predefined and available responses and eventually get and a good command over context and content. The retrieval-based models contain some good configuration of Machine Learning but they are not configured to generate any new text, they just pick the appropriate text from a predefined class and set of texts and project the one that matches the intent of a question or a statement. Retrieval based models will go perfect will those chatbots that just perform a task and nothing else. You will have a set of answers and your chatbot will answer to user according to them and the keywords

Generative models are hard to understand and setup they do not rely on the predefined class and generate text of their own according to the understandings of a giving question or statement. Generative models work with Machine Translation and translate the content and context to the machine. They generate brand new responses from the scratch and put them in front of the user. If you want to go big, this model is for you. It can be a direct jump in the AI playground but it will make mistakes so you should prepare yourself for them. You will have a feel that you are talking to a human.

3.2 TRAINING

The vast majority of production systems today are retrieval-based, or a combination of retrieval-based and generative. Google's Smart Reply is a good example. Generative models are an active area of research, but we're not quite there yet. If you want to build a conversational agent today your best bet is most likely a retrieval-based model. A retrieval based model needs some amount of data to start with so that it can return expected results by retrieving the known data that satisfies some rules. The process of adding predefined datasets to implement a retrieval based model is called Training.

ChatterBot includes tools that help simplify the process of training a chatbot instance. ChatterBot's training process involves

View on GitHub
GitHub Stars11
CategoryCustomer
Updated2y ago
Forks11

Languages

Python

Security Score

60/100

Audited on Dec 11, 2023

No findings