Skip to content

kudos07/MentalHealth-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mental Health Chatbot

Overview

The Mental Health Chatbot is an AI-powered support tool designed to provide empathetic, personalized, and evidence-based guidance for mental health concerns. Built using cutting-edge technologies like Streamlit, FAISS, and Google's Generative AI, this chatbot delivers a secure and tailored experience for users seeking mental well-being support.

Features

  • Personalized Support: Tailored responses based on user age group and specific concerns (e.g., work stress, anxiety, sleep).
  • Secure Data Handling: Uses encryption to securely store user concerns and maintains HIPAA-level privacy compliance.
  • Context-Aware Responses: Integrates previous user interactions and "Your Previous Concerns" to provide consistent, context-driven replies.
  • Few-Shot Learning: Leverages examples to improve chatbot accuracy and understand nuanced questions.
  • FAQ Integration: Includes a dynamic FAQ section for quick answers to common mental health queries.
  • User Data Management: Users can save their concerns and delete their data at any time, ensuring complete control over personal information.

Project Structure

mental_health_chatbot/
│
├── app/                   # Application code
│   ├── chatbot_logic.py   # Core chatbot logic and processing
│   ├── config.py          # Configuration and prompt definitions
│   ├── data_loader.py     # Resource loading and setup
│   └── main.py            # Streamlit interface
│
├── data/                  # Data files and resources
│   ├── counselchat_with_embeddings.pkl
│   ├── faiss_index.bin
│   ├── faqs.csv
│   ├── encryption_key.key
│   └── user_memory.json
│
├── setup.py               # Setup script for easy installation
├── requirements.txt       # Python dependencies
├── .env                   # Environment variables
├── README.md              # Project documentation
└── .gitignore             # Ignored files

Technologies Used

  • Streamlit: User-friendly web interface for real-time chatbot interactions.
  • FAISS: Fast and efficient retrieval of contextually similar responses.
  • Sentence Transformers: For generating embeddings from user input.
  • Google Generative AI (Gemini): To generate empathetic and helpful responses.
  • Encryption (Fernet): Ensures secure storage of sensitive user data.
  • Few-Shot Learning: Enhances the chatbot's performance with example-based learning.

How It Works

User Interaction

  • Users provide their name, age group, and specific concerns.
  • Previous interactions are retrieved for context.

Query Processing

  • User input is processed and embedded using Sentence Transformers.
  • FAISS retrieves relevant responses from a dataset of mental health exchanges.

Response Generation

  • A tailored prompt is constructed using user details, retrieved responses, and few-shot examples.
  • Google Generative AI generates a context-aware, empathetic response.

Secure Data Handling

  • Encrypted Data: User concerns are encrypted before storage.
  • Data Access: Data is easily accessible and deletable by the user.

Getting Started

Prerequisites

  • Python 3.9 or later
  • Required Python libraries (in requirements.txt)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/mental_health_chatbot.git
cd mental_health_chatbot
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up your environment variables in a .env file:
GEMINI_API_KEY=your_api_key_here
DATA_PATH=data/
  1. Run the chatbot:
streamlit run app/main.py

Security and Privacy

  • Encrypted Data: User concerns are encrypted using the Fernet symmetric encryption mechanism.
  • Data Deletion: Users can delete their data via the chatbot interface.
  • Compliance: Designed to follow privacy best practices and HIPAA-level compliance.

chat5_page-0001

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages