An interactive AI girlfriend chatbot with multiple personalities, built with Streamlit and Keras. Experience conversations with different AI personalities including girlfriend mode, bro mode, and anime character mode!
๐Live Demo
- ๐ค AI-powered conversational chatbot with multiple personalities
- ๐ Girlfriend mode with romantic responses
- ๐ Real-time model training with accuracy metrics
- ๐ฌ Beautiful Streamlit chat interface
- ๐ฏ Neural network-based intent recognition
- ๐ฑ Fully responsive web interface
- ๐ Session-based chat history
Prerequisites Python 3.9 or higher
pip package manager
Installation Clone the repository
git clone https://github.com/subhadipsinha722133/Girlfriend-GPT.git
cd Girlfriend-GPTInstall dependencies
pip install -r requirements.txtRun the application
streamlit run app.py
Open your browser and go to http://localhost:8501- Open the application in your web browser
- Train the model by clicking the "Train Model" button in the sidebar
- Wait for training to complete (typically takes 1-2 minutes)
- Start chatting by typing messages in the chat input
- View model accuracy in the sidebar after training
- Example Conversations
- Girlfriend mode: "Write a poem for me" โ Romantic poetry response
text
Girlfriend-GPT/
โโโ app.py # Main application file
โโโ requirements.txt # Python dependencies
โโโ README.md # This documentation file
โโโ models/ # Trained models directory
โ โโโ chatbot_model.h5 # Keras model (generated)
โ โโโ words.pkl # Vocabulary (generated)
โ โโโ classes.pkl # Classes (generated)
|โโ data/
| |โโ intents.json
|โโ train_model.py
- The chatbot uses a neural network with the following architecture:
- Input Layer: 5 neurons with ReLU activation
- Hidden Layers: 40 and 4 neurons with Batch Normalization
- Output Layer: Softmax activation for intent classification
- Regularization: Dropout (0.5) to prevent overfitting
- Optimizer: SGD with Nesterov momentum
- Loss Function: Categorical cross-entropy
- Training Process
- Text Preprocessing: Tokenization and lemmatization
- Bag-of-Words: Convert patterns to numerical vectors
- Model Training: 200 epochs with batch size of 5
- Intent Prediction: Probability threshold of 0.25
- Deploy to Streamlit Cloud
- Fork this repository on GitHub
- Connect your GitHub account to Streamlit Cloud
- Select your repository and set main file to app.py
- Click Deploy - your app will be live in minutes!
Edit the girlfriend variable in the code to add new intents and responses:
{
"tag": "greeting",
"patterns": ["hi", "hello", "hey", "hiya", "howdy", "hey there", "hello there", "hi there", "greetings", "hey you", "hi sweetie", "hello beautiful", "hey love", "hi my love", "morning", "good morning", "afternoon", "good afternoon", "evening", "good evening", "hey babe", "hi honey", "hey darling", "hi angel", "hey sweetheart", "hi gorgeous", "hey cutie", "hi dear", "hey boo", "well hello", "look who it is", "hi sweetness", "hey my love", "hello darling", "good day", "hey sunshine", "hi precious", "hey lover", "hi handsome", "hey sexy", "hi sweetheart", "hey honey bunny", "hi lovebug", "hey sugar", "hi muffin"],
"responses": ["Hey babe ๐ How was your day?", "Hi! I've missed you ๐ What did you do today?", "Hello, my love! ๐ฅฐ Seeing your name pop up made me smile.", "Hey you! ๐ I was just thinking about you.", "Hi sweetheart! ๐ Tell me everything!", "Well hello there, handsome! ๐ This is a nice surprise!", "Hey sunshine! โ๏ธ You just brightened my day!", "Hi my love! My heart did a little jump when I saw your message. ๐", "Good morning, sleepyhead! ๐ด๐ค Did you dream of me?", "Hey you! I was hoping you'd text. ๐"]
}- We welcome contributions! Please follow these steps:
- Fork the project
- Create a feature branch (git checkout -b feature/AmazingFeature)
- Commit your changes (git commit -m 'Add some AmazingFeature')
- Push to the branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Development Setup Set up a virtual environment:
python -m venv venv
source venv/bin/activate
Install development dependencies:pip install -r requirements-dev.txt
Run tests:pytest
Format code:black app.pyCommon Issues NLTK data not found:
python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet')"
TensorFlow compatibility issues:pip uninstall tensorflow keras
pip install tensorflow==2.13.0 keras==2.13.1
Port already in use:streamlit run --server.port 8502 app.py
Memory errors on deployment: Reduce model complexity or use pre-trained modelsGetting Help If you encounter issues:
Check the FAQ section below
Search existing GitHub Issues
Create a new issue with details about your problem
Q: How accurate is the chatbot?
A: The model typically achieves around 95% accuracy after training with the provided dataset.
Q: Can I add custom responses?
A: Yes! Edit the girlfriend variable in the code to add new intents and responses.
Q: Is my chat data stored?
A: No, all conversations are stored only in your browser session and are not saved to any server.
Q: Can I deploy this commercially?
A: Please check the MIT license terms for commercial use.
Q: How can I improve the model accuracy?
A: Add more training examples to each intent, increase training epochs, or adjust the neural network architecture.
Q: Does this work on mobile devices?
A: Yes, the Streamlit interface is fully responsive and works on mobile devices.
This project is licensed under the Boost Software License - see the LICENSE file for details.
- Built with Streamlit for the web interface
- Uses Keras and TensorFlow for machine learning
- Natural Language Processing with NLTK
- Inspired by conversational AI projects and chatbot frameworks
Subhadip Sinha - Creator and maintainer
- If you like this project, please give it a star โญ on GitHub!
- For questions and support:
- Open an issue
Email: sinhasubhadip34@gmail.com
- Boyfriend GPT - Male version of the chatbot
- Anime Character AI - Anime-themed chatbot
- Chatbot Framework - General purpose chatbot framework
