{"id":28719919,"url":"https://github.com/aniket-16-s/chatbot-with-tensorflow","last_synced_at":"2026-04-10T11:32:39.079Z","repository":{"id":298856280,"uuid":"1000932315","full_name":"Aniket-16-S/Chatbot-with-Tensorflow","owner":"Aniket-16-S","description":"A simple and powerful chatbot made with deep-learning using tensorflow feedforward neural network. Uses RESTful API and Streamlit for ease of use. A smple solution for small scale business or anyone who needs AI chatbot ready to use/ integrate in apps / websites.","archived":false,"fork":false,"pushed_at":"2025-06-13T08:10:40.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-13T09:26:00.168Z","etag":null,"topics":["chatbot","chatbot-application","chatbot-framework","deep-learning","deep-neural-networks","fastapi","json","keras","neural-network","nlp","pydantic","rest-api","restful-api","streamlit","tensorflow","uvicorn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aniket-16-S.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T14:42:14.000Z","updated_at":"2025-06-13T08:10:43.000Z","dependencies_parsed_at":"2025-06-13T09:26:26.615Z","dependency_job_id":"569e3afe-6c15-4be3-b0e5-504937d35f49","html_url":"https://github.com/Aniket-16-S/Chatbot-with-Tensorflow","commit_stats":null,"previous_names":["aniket-16-s/chatbot-with-tensorflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aniket-16-S/Chatbot-with-Tensorflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-16-S%2FChatbot-with-Tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-16-S%2FChatbot-with-Tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-16-S%2FChatbot-with-Tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-16-S%2FChatbot-with-Tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aniket-16-S","download_url":"https://codeload.github.com/Aniket-16-S/Chatbot-with-Tensorflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-16-S%2FChatbot-with-Tensorflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259929973,"owners_count":22933536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chatbot-application","chatbot-framework","deep-learning","deep-neural-networks","fastapi","json","keras","neural-network","nlp","pydantic","rest-api","restful-api","streamlit","tensorflow","uvicorn"],"created_at":"2025-06-15T06:06:09.141Z","updated_at":"2026-04-10T11:32:39.074Z","avatar_url":"https://github.com/Aniket-16-S.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chatbot with TensorFlow\n\n*Your intelligent conversational assistant, powered by TensorFlow neural network and designed for easy customization.*\n--\n## Table of Contents\n\n* [About the Project](#about-the-project)\n* [Features](#features)\n* [Technologies Used](#technologies-used)\n* [Project Structure](#project-structure)\n* [Getting Started](#getting-started)\n    * [Prerequisites](#prerequisites)\n    * [Cloning the Repository](#cloning-the-repository)\n    * [Installation](#installation)\n    * [Running the Chatbot](#running-the-chatbot-server)\n    * [Using the Dashboard](#using-the-dashboard)\n* [How it Works](#how-it-works)\n* [Customizing and Training](#customizing-and-training)\n* [Contributing](#contributing)\n\n## About the Project\n\nThis project provides a robust and flexible chatbot solution built with `TensorFlow` and Natural Language Toolkit (`NLTK`) for `natural language processing`.\nIt's designed to be easily trainable with your custom FAQ data,making it ideal for small-scale businesses or anyone needing a simple, self-trainable conversational AI for their website or application.\nThe system includes a `FastAPI` server for seamless API interaction and a Streamlit dashboard for managing unanswered queries.\n\n## Features\n\n* **TensorFlow-Powered NLP :** Utilizes a feedforward neural network for efficient and accurate intent classification.\n* **Customizable Training Data :** Easily train the chatbot with your own JSON-formatted question-answer pairs without modifying core code.\n* **FastAPI Integration :** Provides a high-performance `RESTful API` for sending queries and receiving chatbot responses.\n* **Streamlit Dashboard :** A user-friendly web interface to review and answer previously unrecognized queries, improving the chatbot's knowledge base.\n* **Scalable \u0026 Simple :** Designed for straightforward deployment and management, suitable for various small-scale applications.\n\n## Technologies Used\n\n* **Python**\n* **TensorFlow**\n* **Keras**\n* **RESTful API**\n* **NLTK (Natural Language Toolkit)**\n* **FastAPI**\n* **Pydantic**\n* **Streamlit**\n\n## Project Structure\n\n* `dashboard.py`: Contains the Streamlit application for managing unanswered queries.\n* `ChatBot.py`: Core chatbot logic, including NLP preprocessing, TensorFlow model definition, training, and prediction.\n* `main.py`: Sets up and runs the FastAPI server for the chatbot API.\n* `faq.json`: Contains training data of your chatbot.\n* `models/`: Saves a trained model for fast startup time.\n* `requirements.txt`: (Will list all necessary Python dependencies)\n\n## Getting Started\n\nFollow these steps to get your chatbot up and running.\n\n### Prerequisites\n\nEnsure you have Python 3.9+ installed on your system. (3.12 recommended)\nIt's recommended to use a virtual environment.\n\n### Cloning the Repository\n\n```bash\ngit clone https://github.com/Aniket-16-S/Chatbot-with-Tensorflow.git\n```\nchange cwd\n```bash\ncd Chatbot-with-Tensorflow)\n```\n### Installation\n\nIt's highly recommended to create and activate a virtual environment before installing dependencies:\n\nInstall the required packages :\n```bash\npip install -r requirements.txt\n```\n### Running the Chatbot\nRunning in CLI for chatting\n```bash\npython ChatBot.py\n```\nRunning the Chatbot ( Server only )\n```bash\npython main.py\n```\nThis will typically start the FastAPI server at `http://127.0.0.1:8000`. You can then interact with the chatbot via its API (e.g., using POST requests to send queries).\nGoto following url for testing the server\n```bsah\nhttp://127.0.0.1:8000/docs\n```\nUsing the Dashboard\nTo manage unanswered queries, run the Streamlit dashboard:\n```bash\nstreamlit run dashboard.py\n```\nThis will open the dashboard in your web browser, usually at `http://localhost:8501`\n\n## How it Works\nThe chatbot uses a deep learning model to classify user intents. When a query is received:\n\n- **Preprocessing** : NLTK is used to tokenize and stem the input query.\n- **Vectorization** : The preprocessed query is converted into a numerical representation (bag of words).\n- **Prediction** : The TensorFlow model predicts the intent (tag) of the query.\n- **Response** : A predefined response associated with the predicted intent is returned.\n\nThe core TensorFlow model architecture :\nThis is a ***feedforward neural network*** *( F N N )*, also known as a *Multi-Layer Perceptron* (MLP), built with TensorFlow/Keras.\nnote : Initial startup may take around 30 to 40 seconds to build the model and save it.\n\n## Key characteristics:\n\n- **Architecture** : It has two hidden layers with ReLU activation, each followed by a dropout layer for regularization (to prevent overfitting). The output layer uses a softmax activation function, typical for multi-class classification.\n- **Input** : It takes a numerical input (likely a bag-of-words or TF-IDF representation of text) with a dimension equal to len(train_x[0]).\n- **Output** : It outputs probabilities for len(train_y[0]) different classes (intents).\n- **Training** : It's compiled with categorical_crossentropy loss (suitable for multi-class classification where outputs are one-hot encoded), optimized using the Adam algorithm, and trained for 200 epochs with a batch size of 8.\n\n## Contributing\nWe welcome contributions to make this chatbot even better! If you have suggestions, bug reports, or want to contribute code, please follow these steps:\n\n- Fork the repository.\n- Create a new branch (git checkout -b feature/your-feature-name).\n- Make your changes and commit them (git commit -m 'Add new feature').\n- Push to your branch (git push origin feature/your-feature-name).\n- Open a Pull Request (PR) to the main branch of this repository.\n- Please ensure your code adheres to good practices and includes relevant documentation or comments.\n\n## Other Projects \nPlease feel free to check out my other projects. [GitHub profile](https://github.com/Aniket-16-S)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniket-16-s%2Fchatbot-with-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faniket-16-s%2Fchatbot-with-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniket-16-s%2Fchatbot-with-tensorflow/lists"}