All Projects → ahmadfaizalbh → Chatbot

ahmadfaizalbh / Chatbot

Licence: mit
Python ChatBot 💬

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Chatbot

Rasa
💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Stars: ✭ 13,219 (+5187.6%)
Mutual labels:  chatbot, bots, chatbots
rivescript-java
A RiveScript interpreter for Java. RiveScript is a scripting language for chatterbots.
Stars: ✭ 60 (-76%)
Mutual labels:  bots, chatbot, chatbots
Rivescript Python
A RiveScript interpreter for Python. RiveScript is a scripting language for chatterbots.
Stars: ✭ 142 (-43.2%)
Mutual labels:  chatbot, bots, chatbots
intelligo.js.org
The official website for Intelligo chatbot framework.
Stars: ✭ 18 (-92.8%)
Mutual labels:  bots, chatbot, chatbots
Rivescript Js
A RiveScript interpreter for JavaScript. RiveScript is a scripting language for chatterbots.
Stars: ✭ 350 (+40%)
Mutual labels:  chatbot, bots, chatbots
Botpress
🤖 Dev tools to reliably understand text and automate conversations. Built-in NLU. Connect & deploy on any messaging channel (Slack, MS Teams, website, Telegram, etc).
Stars: ✭ 9,486 (+3694.4%)
Mutual labels:  chatbot, bots, chatbots
Java Telegram Bot Tutorial
Java Telegram Bot Tutorial. Feel free to submit issue if you found a mistake.
Stars: ✭ 165 (-34%)
Mutual labels:  chatbot, bots, chatbots
intelligo-generator
🛠️ Chatbot generator for Intelligo Framework.
Stars: ✭ 31 (-87.6%)
Mutual labels:  bots, chatbot, chatbots
Chat-Bot
Chatbot – is a computer program that simulates a natural human conversation. Users communicate with a chatbot via the chat interface or by voice, like how they would talk to a real person.
Stars: ✭ 26 (-89.6%)
Mutual labels:  bots, chatbot, chatbots
Poshbot
Powershell-based bot framework
Stars: ✭ 410 (+64%)
Mutual labels:  chatbot, bots, chatbots
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+1045.6%)
Mutual labels:  chatbot, bots, chatbots
Chatbots
Chatbots build with Intelligo Framework.
Stars: ✭ 119 (-52.4%)
Mutual labels:  chatbot, bots
Botkit
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Stars: ✭ 10,555 (+4122%)
Mutual labels:  chatbot, bots
Rasa Chatbot Templates
RASA chatbot use case boilerplate
Stars: ✭ 127 (-49.2%)
Mutual labels:  chatbot, chatbots
Alpha
Craft your own web-based chatbot
Stars: ✭ 113 (-54.8%)
Mutual labels:  chatbot, bots
Framework
Chatbot framework
Stars: ✭ 130 (-48%)
Mutual labels:  chatbot, bots
Eddi
Scalable Open Source Chatbot Platform. Build multiple Chatbots with NLP, Behavior Rules, API Connector, Templating. Developed in Java, provided with Docker, orchestrated with Kubernetes or Openshift.
Stars: ✭ 171 (-31.6%)
Mutual labels:  chatbot, bots
Ai Chatbot Framework
A python chatbot framework with Natural Language Understanding and Artificial Intelligence.
Stars: ✭ 1,564 (+525.6%)
Mutual labels:  chatbot, chatbots
Botonic
Build chatbots and conversational experiences using React
Stars: ✭ 144 (-42.4%)
Mutual labels:  bots, chatbots
Rasatalk
A chatbot framework for Rasa NLU
Stars: ✭ 225 (-10%)
Mutual labels:  chatbot, bots

Downloads PyPI version Upload Python Package CodeQL

ChatBotAI

Python chatbot AI that helps in creating a python based chatbot with minimal coding. This provides both bots AI and chat handler and also allows easy integration of REST API's and python function calls which makes it unique and more powerful in functionality. This AI provides numerous features like learn, memory, conditional switch, topic-based conversation handling, etc.

Demo Clothing assistance Remainder

Installation

Install from PyPI:

pip install chatbotAI

install from github:

git clone https://github.com/ahmadfaizalbh/Chatbot.git
cd Chatbot
python setup.py install

Demo

>>> from chatbot import demo
>>> demo()
Hi, how are you?
> i'm fine
Nice to know that you are fine  
> quit
Thank you for talking with me.
>>> 

Sample Code (with wikipedia search API integration)

from chatbot import Chat, register_call
import wikipedia


@register_call("whoIs")
def who_is(session, query):
    try:
        return wikipedia.summary(query)
    except Exception:
        for new_query in wikipedia.search(query):
            try:
                return wikipedia.summary(new_query)
            except Exception:
                pass
    return "I don't know about "+query

first_question="Hi, how are you?"
Chat("examples/Example.template").converse(first_question)

For Detail on how to build Facebook messenger bot checkout Facebook Integration.ipynb

For Jupyter notebook Chatbot checkout Infobot built using NLTK-Chatbot

Sample Apps

  1. A sample facebook messenger bot built using messengerbot, Django and NLTK-Chatbot is available here Facebook messenger bot
  2. A sample microsoft bot built using Microsoft Bot Connector Rest API - v3.0, Django and NLTK-Chatbot is available here Micosoft Chatbot

List of feature supported in bot template

  1. Memory
  2. Get matched group
  3. Recursion
  4. Condition
  5. Change Topic
  6. Interact with python function
  7. REST API integration
  8. Topic based group
  9. Learn
  10. To upper case
  11. To lower case
  12. Capitalize
  13. Previous

Memory

Set Memory

{ variable : value }

In think mode

{! variable : value }

Get Memory

{ variable }

Get matched group

for grouping in regex refer Python regular expression docs

Get Nth matched group of client pattern

%N

Example to get first matched

%1

Get matching named group of client pattern

%Client_pattern_group_name

Example to get matching named group person

%person

Get Nth matched group of bots message pattern

%!N

Example to get first matched

%!1

Get matching named group of bots message pattern

%!Bot_pattern_group_name

Example to get matching named group region

%!region

Recursion

Get response as if client said this new statement

{% chat statement %}

It will do a pattern match for statement

Condition

{% if condition %} do this first {% elif condition %} do this next {% else %} do otherwise {% endif %}

Change Topic

{% topic TopicName %}

Interact with python function

In python
@register_call("functionName")
def function_name(session, query):
    return "response string"
In template
{% call functionName: value %}

REST API integration

In API.json file

{
   "APIName":{
       "auth" : {
           "url":"https://your_rest_api_url/login.json",
           "method":"POST",
           "data":{
               "user":"Your_Username",
               "password":"Your_Password"
           }
       },
       "MethodName" : {
           "url":"https://your_rest_api_url/GET_method_Example.json",
           "method":"GET",
           "params":{
               "key1":"value1",
               "key2":"value2",
               ...
           },
           "value_getter":[order in which data has to be picked from json response]
       },
       "MethodName1" : {
           "url":"https://your_rest_api_url/GET_method_Example.json",
           "method":"POST",
           "data":{
               "key1":"value1",
               "key2":"value2",
               ...
           },
           "value_getter":[order in which data has to be picked from json response]
       },
       "MethodName2" : {
           ...
       },
       ...
   },
   "APIName2":{
       ...
   },
   ...
}

If authentication is required only then auth method is needed.The data and params defined in pi.json file acts as defult values and all key value pair defined in template file overrides the default value.value_getter consistes of list of keys in order using which info from json will be collected.

In Template file

[ APIName:MethodName,Key1:value1 (,Key*:value*) ]

you can have any number of key value pair and all key value pair will override data or params depending on method, if method is POST then it overrides data and if method is GET then it overrides params.

Topic based group

{% group topicName %}
  {% block %}
      {% client %}client says {% endclient %}
      {% response %}response text{% endresponse %}
  {% endblock %}
  ...
{% endgroup %}

Learn

{% learn %}
  {% group topicName %}
    {% block %}
        {% client %}client says {% endclient %}
        {% response %}response text{% endresponse %}
    {% endblock %}
    ...
  {% endgroup %}
  ...
{% endlearn %}

To upper case

{% up string %}

To lower case

{% low string %}

Capitalize

{% cap string %}

Previous

{% block %}
    {% client %}client's statement pattern{% endclient %}
    {% prev %}previous bot's statement pattern{% endprev %}
    {% response %}response string{% endresponse %}
{% endblock %}

Chatbot AI flow Diagram

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].