Code Monkey home page Code Monkey logo

aiml_chatbot's Introduction

AIML_Chatbot

Table of Contents

Demo

Application demo image

Pasted Graphic 13

Summary

This is a part of the CS F407 Artificial Intelligence Course at BITS Pilani Hyderabad Campus. In this assignment, a messenger bot is created which can provide intelligent dialog conversations with the user, similar to ELIZA or ALICE.

Features

  • AIML is used for the core of the chatbot.
  • The messenger bot uses a knowledge base with multiple random responses exchanged between the user and the bot.
  • The bot is able to give replies to multiple interactions and stores the conversations in a database. These persistent copies of the interactions can be retrieved the next time user chats with the bot.
  • The bot interacts with web services and recommends students healthy food options by web scraping.
  • The bot can tell the current weather by interacting with a web API.
  • the whole project is based on keyword matching and intent recognition.

Architecture

Artificial Intelligence Markup Language (AIML) is used for creating the core of the chatbot. The frontend is developed using Android and backend using Python. The back end is in Python and front end is created using Android. The app has been tested locally on Android Studio and not on an Android Phone.

The database information is stored in MySQL database on a local machine. For viewing and updating databases, contains the appropriate code.

A database named user_chats should be created in the mysql system first. 2 tables named chats and faculty are used for persistent storage.

The chats table stores the timestamp,userid, bot query and bot response in that order. Basic commands required to create/navigate through the db have been provided in a seperate file "mysql.txt"

Setup

Before starting ensure that you have mysql on your machine.

  • Create a database named user_chats
  • Create table namely chats
  • Change the username and the password in the python files app & conversation

Make sure to install the dependecies

pip install AIML
pip install beautifulsoup4
pip install urllib2

make sure to update the python time library, there is a common issue while using with the AIML library FIX Available here: https://stackoverflow.com/questions/58569361/attributeerror-module-time-has-no-attribute-clock-in-python-3-8

The backend server has to be run first on port 8000.

The backend server can be run simply via

$ python app.py 

(Python v3.9 was used for development) Pasted Graphic 1

The front end Android part can be run in Android Studio.

  • Set up Android Studio,and install an emulator for testing/running the app.
  • Open the MyApplication folder in Android Studio.
  • Press the Play button to run the app.
  • This code was run on Pixel 3A device.

aiml_chatbot's People

Contributors

ritulmohan avatar

Watchers

 avatar

Forkers

pralhad03012002

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.