This is an interactive Streamlit chatbot application that guides users through building a CNN-based text classification model using a dataset they upload. The app leverages OpenAI's GPT-4o for intelligent guidance and performs data preprocessing, model training, and confusion matrix evaluation—all in a user-friendly, conversational format.
├── .gitignore # Ignore saved models, temporary files, etc.
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
- ✅ Upload CSV dataset
- 🧹 Text preprocessing with customizable options
- 🔠 Tokenization & label encoding for CNN input
- 🧠 Dynamic CNN model training with adjustable architecture
- 📊 Confusion Matrix visualization after training
- 💾 Model download (as
.zip) post training - 🤖 OpenAI GPT-4o integration for interactive guidance
git clone https://github.com/yourusername/cnn-text-classifier-chatbot.git
cd cnn-text-classifier-chatbotpython -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`pip install -r requirements.txtYou can either:
- Export it in your terminal:
export OPENAI_API_KEY=your_openai_api_key- Or modify
app.pyto hardcode it temporarily:
api_key = "your_openai_api_key"streamlit run app.py-
Upload a CSV file via the sidebar.
-
Select the text and label columns.
-
Follow the chatbot's guidance to:
- Explore data
- Clean and preprocess it
- Prepare it for CNN training
- Configure and train the model
-
Visualize the confusion matrix.
-
Download the trained model.
The CNN model is built dynamically based on user-defined layers (Conv1D, MaxPooling1D, Dense, Dropout, etc.). Users can customize:
- Number of layers
- Kernel sizes, filters
- Activation functions
- Optimizer, learning rate, and more
Major libraries:
streamlitopenaipandas,numpy,matplotlibtensorflow,sklearn
Full list in requirements.txt
Upload a dataset of product reviews labeled as "positive" or "negative", clean the data, define a CNN model, train it, and visualize classification performance—all via a conversational assistant.
MIT License (or your own if different)