{"id":24497417,"url":"https://github.com/arnie1x/medical_chatbot","last_synced_at":"2026-05-11T02:50:10.498Z","repository":{"id":256142179,"uuid":"822973611","full_name":"Arnie1x/medical_chatbot","owner":"Arnie1x","description":"This project implements an AI-powered medical chatbot using a neural network model and serves it through a Flask web application.","archived":false,"fork":false,"pushed_at":"2024-07-05T06:19:39.000Z","size":3329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T21:36:00.437Z","etag":null,"topics":["ai","chatbot","keras","medical","nlp","nltk","python","tensorflow"],"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/Arnie1x.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}},"created_at":"2024-07-02T07:30:52.000Z","updated_at":"2024-09-09T05:39:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6f6fcbb-91a5-44f2-ba15-bce74e537dfe","html_url":"https://github.com/Arnie1x/medical_chatbot","commit_stats":null,"previous_names":["arnie1x/medical_chatbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnie1x%2Fmedical_chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnie1x%2Fmedical_chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnie1x%2Fmedical_chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnie1x%2Fmedical_chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arnie1x","download_url":"https://codeload.github.com/Arnie1x/medical_chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243693853,"owners_count":20332486,"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":["ai","chatbot","keras","medical","nlp","nltk","python","tensorflow"],"created_at":"2025-01-21T21:33:45.656Z","updated_at":"2026-05-11T02:50:05.461Z","avatar_url":"https://github.com/Arnie1x.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Medical AI Chatbot with Flask\n\nThis project implements an AI-powered medical chatbot using a neural network model and serves it through a Flask web application.\n\n## Table of Contents\n\n1. [Project Overview](#project-overview)\n2. [Installation](#installation)\n3. [Project Structure](#project-structure)\n4. [Model Architecture](#model-architecture)\n5. [How It Works](#how-it-works)\n6. [Usage](#usage)\n7. [Screenshots](#screenshots)\n\n## Project Overview\n\nThis AI chatbot uses natural language processing and machine learning techniques to understand user input and generate appropriate responses. The core of the system is a neural network model trained on predefined intents, which is then served through a Flask web application for easy interaction.\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/Arnie1x/medical_chatbot.git\ncd medical_chatbot\n```\n\n2. Create a virtual environment (optional but recommended):\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows, use venv\\Scripts\\activate\n```\n\n3. Install the required packages:\n\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\n1. Train the model (this will also download the necessary NLTK Data):\n\n```bash\npython model.py\n```\n\n2. Run the Flask Application:\n\n```\npython chatbot.py\n```\n\n3. Open a web browser and navigate to localhost at http://127.0.0.1:5000 to interact with the chatbot.\n\n## Project Structure\n\n- `chatbot.py`: Main Flask application file\n- `model.py`: Script for training the neural network model\n- `intents.json`: JSON file containing predefined intents and responses\n- `words.pkl`: Pickle file storing processed vocabulary\n- `classes.pkl`: Pickle file storing intent classes\n- `chatbot_model.h5`: Trained neural network model\n- `requirements.txt`: List of Python dependencies\n- `templates/index.html`: HTML template for the chatbot interface (not provided in the given files)\n\n## Model Architecture\n\nThe chatbot uses a feed-forward neural network with the following architecture:\n\n1. Input Layer: Dense layer with 256 neurons (ReLU activation)\n2. Dropout Layer: 50% dropout for regularization\n3. Hidden Layer: Dense layer with 128 neurons (ReLU activation)\n4. Dropout Layer: 50% dropout for regularization\n5. Output Layer: Dense layer with neurons equal to the number of intent classes (Softmax activation)\n\nThe model is compiled using:\n\n- Loss function: Categorical Cross-Entropy\n- Optimizer: Stochastic Gradient Descent (SGD) with learning rate 0.01 and momentum 0.9\n- Metric: Accuracy\n\n## How It Works\n\n### Data Preprocessing:\n\n- The `intents.json` file is parsed to extract patterns and their corresponding intents.\n- Words are tokenized, lemmatized, and converted into a bag-of-words representation.\n\n\n### Model Training (`model.py`):\n\n- The preprocessed data is used to train the neural network.\n- The model is trained for 200 epochs with a batch size of 5.\n- Trained model and processed data are saved for later use.\n\n\n### Chatbot Implementation (`chatbot.py`):\n\n- The Flask application loads the trained model and preprocessed data.\nUser input is processed using the same preprocessing steps as during training.\n- The model predicts the most likely intent for the input.\n- A response is selected randomly from the predicted intent's responses.\n\n\n### Web Interface:\n\n- Flask serves an HTML page with a chat interface.\n- User messages are sent to the server via POST requests.\n- The chatbot's responses are displayed in the chat interface.\n\n## Screenshots\n![Medical Chatbot interface](assets/medical_chatbot.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnie1x%2Fmedical_chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnie1x%2Fmedical_chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnie1x%2Fmedical_chatbot/lists"}