Giter Site home page Giter Site logo

chatbot_with_rest_api's Introduction

Chatbot with REST API service

Chatbot, which uses a REST API layer to provide its services, which allows to isolate the chatbot interface from the trainded chatbot model.

Install environmet for running and developing

pip install -r requirements.txt

also install the nltk libraries

import nltk nltk.download('all')

Creating and traing the chatbot model

  1. Add the data for models/intents.json

The format for adding one sample enry :

{

"tag": "goodbye",

"patterns": ["Bye, bye","Bye", "See you later", "Goodbye", "Nice chatting to you, bye", "Till next time"],

"responses": ["Bye, cant wait i see you soon!","See you!", "Have a nice day", "Bye! Come back again soon."],

"context": [""]

}

This entry must insert to the intents.json file

  1. Train the chatbot model

    python train_chatbot.py

    After traing the model will be saved into models directory (chatbot_model.h5)

Start the REST API service

python start api_bot.py will start the RST API service on localhost at port 5000

To configure REST API service change api_bot.py last line where the Flask server is started.

  • Serving Flask app "api_bot" (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

Start the chatbot

When the REST API service is started the chatbot is ready!

python chatbot.py

you: hey!

bot: Hi there, how can I help?

you: what is the meaning of life?

bot: 42

you:

chatbot_with_rest_api's People

Contributors

asiaat avatar

Watchers

 avatar

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.