EmotionIQ is a Flask-based web application that performs sentiment analysis on text input, uploaded files (TXT, PDF, DOCX), or web pages. It uses TextBlob and VADER to provide a reliable sentiment classification with confidence levels and emotion mapping. Users can also download a detailed PDF report of the analysis.
-
Multiple Input Sources
- Direct text entry
- File uploads (
.txt,.pdf,.docx) - Website URLs
-
Multimodal Sentiment Detection
- TextBlob polarity and subjectivity
- VADER compound score
- Combined confidence calculation
-
Emotion Mapping
- Positive → Joy / Satisfaction
- Negative → Anger / Sadness
- Neutral → Calm / Neutral
-
PDF Report Generation
- Detailed sentiment report with preview, word & character counts
- Downloadable for sharing or documentation
-
Real-Time Analysis
- Instant feedback via Flask session management
-
Secure File Handling
- Only allows TXT, PDF, DOCX
- Files automatically deleted after processing
-
CORS Support
- Ready for frontend integration or external calls
-
When analyzing website content, EmotionIQ scrapes raw text from the page using
requestsandBeautifulSoup. -
To prevent overly long processing, the text is sliced to the first ~5000 characters if large.
- This is why
char_countoften appears around 5000 for web pages.
- This is why
-
Scripts, styles, and HTML elements are removed for cleaner sentiment analysis.
- Python 3.8+
- Flask, Flask-CORS
- TextBlob, NLTK (
punkt,stopwords) - VADER Sentiment (
vaderSentiment) - PyPDF2, python-docx
- Requests, BeautifulSoup4
- ReportLab
- Clone the repository
git clone https://github.com/jayeshgit65/EmotionIQ-AI-Powered-Sentiment-Analysis.git
cd EmotionIQ-AI-Powered-Sentiment-Analysis- Install dependencies
pip install -r requirements.txt- Download NLTK data (once)
python -m nltk.downloader punkt stopwords- Start the Flask server
python app.py- Open in browser
http://localhost:5000
- Perform analysis
- Enter text directly
- Upload a
.txt,.pdf, or.docxfile - Enter a website URL
- View results
- Sentiment, emotion, confidence, word count, character count
- Text preview and confidence bar chart
- Download PDF Report
- Click "Download PDF Report" to save the analysis
.
├── app.py # Main Flask application
├── templates/
│ ├── index.html # Home page input UI
│ └── results.html # Results page with sentiment display and chart
├── uploads/ # Temporary file uploads (auto-cleaned)
├── requirements.txt # Python dependencies
└── README.md # Project documentation
GET /– Home pagePOST /– Process sentiment analysis from text, file, or URLGET /results– View sentiment analysis resultsGET /download– Download sentiment analysis report as PDF
MIT License