GithubHelp home page GithubHelp logo

muhammedazhar / projectchatbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.21 MB

This is college main project that I submitted for my Bachelor of Computer Application course.

Python 39.47% JavaScript 13.71% HTML 19.95% SCSS 2.11% CSS 24.76%
chatbot nltk-python webapp

projectchatbot's Introduction

ProjectChatbot

  1. training.py: This file is responsible for training the chatbot model. It preprocesses the data, creates training samples, sets up the neural network model architecture, defines hyperparameters, and trains the model using the DataLoader. After training, it saves the model's state, input, hidden, and output sizes, along with vocabulary and tags, to a file named "data.pth".

  2. model.py: This file contains the definition of the neural network model used for the chatbot. It defines a class called NeuralNet that inherits from torch.nn.Module. The model consists of three linear layers with ReLU activation functions between them.

  3. chatbot.py: This file is responsible for loading the trained model and generating responses to user queries. It loads the preprocessed data and the trained model state from the "data.pth" file. Then, it defines a function called get_response(msg) that tokenizes the user's message, converts it into a bag of words, feeds it into the model, and returns a response generated by the model.

  4. app.py: This file sets up a Flask web application for hosting the chatbot. It defines routes for handling HTTP GET requests to render the index page and POST requests to predict responses to user messages. When a POST request is received with a user message, it calls the get_response() function from chatbot.py to generate a response. It also logs the chat history to a JSON file named "chat_history.json".

projectchatbot's People

Contributors

muhammedazhar 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.