A real-time web application for text sentiment analysis with visualization capabilities.
This dashboard analyzes text sentiment in real-time, classifying input as positive, negative, or neutral. It provides comprehensive visualization of results through interactive charts, word clouds, and time-based analytics. The application stores all analyses in a database to track sentiment patterns over time.
- Real-time Sentiment Analysis: Immediate feedback on text sentiment
- Multi-class Classification: Positive, negative, and neutral detection with confidence scores
- Interactive Visualizations:
- Sentiment distribution pie chart
- Score distribution bar chart
- Word clouds for each sentiment category
- Time trend analysis
- Day/hour heatmap
- Responsive Design: Mobile-friendly interface
- Flask: Web framework
- Transformers (Hugging Face): NLP model for sentiment analysis
- NLTK: Text preprocessing
- SQLite: Data storage
- WordCloud: Word cloud generation
- HTML/CSS/JavaScript: Core web technologies
- Chart.js: Simple charts (pie, bar)
- ECharts: Advanced visualizations (time series, heatmap)
- Clone the repository
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install flask transformers nltk wordcloud torch
- Run the application:
python app.py
- Access at
http://localhost:5000
- Enter text in the input area
- Click "Analyze Sentiment"
- View results and automatically updated visualizations
Root endpoint for static files.
Analyzes text sentiment.
Request: {"text": "Text to analyze"}
Response: {"status": "success", "data": {"result": {"label": "POSITIVE", "score": 0.95}}}Retrieves visualization data.
Generates a word cloud for the specified sentiment.
Lists recent analyses.
- Multi-language support
- User accounts and authentication
- Data export functionality
- Custom model training
- Aspect-based sentiment analysis
- Batch processing
Mainly use HTML, CSS, JavaScript for building the interface. This application provides sentiment analysis of text input and displays various analytics through interactive charts and visualizations. The dashboard includes:
- Real-time sentiment analysis of user input
- Pie chart showing overall sentiment distribution
- Bar chart displaying score distributions for both positive and negative sentiments
- Time-series chart showing sentiment trends over time
- Day vs. Hour heatmap visualization of sentiment patterns
- Word clouds for both positive and negative sentiment words
The dashboard can input text and get the output, if it is a positive or negative sentiment. The procedure is simple; the user needs to enter the text that they want to analyze, and can have the output immediately with confidence level and type of sentiment

There are several charts we use to analyze the sentiments.
This chart presents the overall positive, negative, and neutral sentiments. We used different colours for better understanding and user interaction. Legends are also provided for the identification of the chart.
This showcases the number of analyses for each sentiment score range. The ranges are 0.5-0.6,0.6-0.7,0.7-0.8,0.8-0.9,0.9-1.0. Charts also represent positive and negative scores at the same time.
Word cloud used to present positive, neutral, and negative words according to frequency.
The chart shows that the positive and negative sentiment fluctuates over time. The user can observe individual positive and negative sentiment behaviour by selecting filters.
By this chart, we can identify potential user behaviour. When analyzing this chart, we can get a brief idea of which days and which hours are mostly active with sentiment entries.
- Frontend Structure
- html - Main dashboard UI
- JavaScript - for charts and interactions
- CSS - CSS styling files
- Contribution
- HSS Hewage- contribute to the front end and provide support for app.py
- GLS Chamaka- contribute to the app.py and provide support for the front end
- MSS Piyarathne- Contribution to the app.py and building the database




