--- title: Email Performance Predictor emoji: 📧 colorFrom: indigo colorTo: green sdk: gradio sdk_version: "4.25.0" app_file: app.py pinned: false --- # 🚀 Email Performance Predictor - Forks Over Knives An AI-powered email marketing tool that predicts email performance and provides actionable recommendations based on historical campaign data. ## 🎯 Features - **Performance Prediction**: Predict open rates, click rates, and unsubscribe rates - **Sentiment Analysis**: Analyze email sentiment using DistilBERT - **Content Classification**: Categorize emails as engaging, promotional, informative, etc. - **Smart Recommendations**: Get actionable tips to improve email performance - **Real-time Analysis**: Instant feedback on your email content ## 📊 Model Performance The app uses machine learning models trained on 311 email campaigns: - **Click Rate Model**: Ridge Regression (R² = 0.28) - **Open Rate Model**: Random Forest (R² = -0.06) - **Unsubscribe Rate Model**: Random Forest (R² = -0.02) *Note: Models show varying performance. Click rate predictions are most reliable.* ## 🛠️ How to Use 1. **Subject Line**: Enter your email subject line 2. **Preview Text**: Add preview text (optional) 3. **Campaign Name**: Enter your campaign name 4. **Day of Week**: Select when you plan to send 5. **Email List**: Choose your target audience 6. **Send Time**: Specify send time (e.g., "9:00 AM") 7. **Recipients**: Enter total recipient count 8. **Target Metric**: Choose what you want to optimize for ## 📈 What You Get - **Performance Score**: 0-100 score based on predicted metrics - **Sentiment Analysis**: Positive/negative sentiment with confidence - **Content Classification**: How your email is categorized - **Recommendations**: Specific tips to improve performance - **Email Details**: Summary of key metrics ## 🔧 Technical Details ### Models Used - **Sentiment**: DistilBERT (Hugging Face) - **Classification**: BART-large-MNLI (Zero-shot) - **Performance**: Custom trained models on campaign data ### Features Extracted - Text length and word count - Punctuation usage (!, ?) - Emoji and number counts - Capitalization ratio - Send timing - Audience segmentation ## 📝 Example Predictions **High-performing email:** - Subject: "Wrap Up Your Monday with Flavor 🌯🥑" - Predicted Click Rate: ~1.24% - Score: 85/100 **Low-performing email:** - Subject: "Newsletter Update" - Predicted Click Rate: ~0.3% - Score: 45/100 ## ⚠️ Limitations - Models trained on limited dataset (311 campaigns) - Performance varies by metric type - Predictions are estimates based on historical patterns - Best used as guidance alongside marketing expertise ## 🚀 Deployment This app is designed for Hugging Face Spaces. Upload all files and it will automatically deploy. ### Required Files - `app.py` - Main application - `requirements.txt` - Dependencies - `*.pkl` files - Trained models and preprocessors ## 📞 Support For questions about the model or improvements, refer to your campaign data analysis and model training logs. --- *Built with Gradio, Transformers, and Scikit-learn*