Skip to content

jayeshgit65/EmotionIQ-AI-Powered-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmotionIQ – AI-Powered Sentiment Analysis

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.


Features

  • 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

Notes on URL Analysis

  • When analyzing website content, EmotionIQ scrapes raw text from the page using requests and BeautifulSoup.

  • To prevent overly long processing, the text is sliced to the first ~5000 characters if large.

    • This is why char_count often appears around 5000 for web pages.
  • Scripts, styles, and HTML elements are removed for cleaner sentiment analysis.


Requirements

  • Python 3.8+
  • Flask, Flask-CORS
  • TextBlob, NLTK (punkt, stopwords)
  • VADER Sentiment (vaderSentiment)
  • PyPDF2, python-docx
  • Requests, BeautifulSoup4
  • ReportLab

Installation

  1. Clone the repository
git clone https://github.com/jayeshgit65/EmotionIQ-AI-Powered-Sentiment-Analysis.git
cd EmotionIQ-AI-Powered-Sentiment-Analysis
  1. Install dependencies
pip install -r requirements.txt
  1. Download NLTK data (once)
python -m nltk.downloader punkt stopwords

Usage

  1. Start the Flask server
python app.py
  1. Open in browser
http://localhost:5000
  1. Perform analysis
  • Enter text directly
  • Upload a .txt, .pdf, or .docx file
  • Enter a website URL
  1. View results
  • Sentiment, emotion, confidence, word count, character count
  • Text preview and confidence bar chart
  1. Download PDF Report
  • Click "Download PDF Report" to save the analysis

Project Structure

.
├── 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

API Endpoints

  • GET / – Home page
  • POST / – Process sentiment analysis from text, file, or URL
  • GET /results – View sentiment analysis results
  • GET /download – Download sentiment analysis report as PDF

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors