Spaces:
Configuration error
Configuration error
WhatsApp Chat Analyzer
A comprehensive tool for analyzing WhatsApp chat exports with sentiment analysis capabilities.
Table of Contents
System Overview
The WhatsApp Chat Analyzer is a Python-based application that processes exported WhatsApp chat data to provide:
- Message statistics and metrics
- Temporal activity patterns
- User engagement analysis
- Content analysis (words, emojis, links)
- Sentiment analysis capabilities
- Topics analysis in the group chats
Built with Streamlit for the web interface, it offers an interactive way to explore chat dynamics and analyze sentiment.
Architecture
The system follows a modular architecture with clear separation of concerns:
Raw WhatsApp Chat → Preprocessing → Analysis → Visualization
Key architectural decisions:
- Modular Design: Components are separated by functionality
- Pipeline Processing: Data flows through discrete processing stages
- Interactive UI: Streamlit enables real-time exploration
Components
1. App Module (app.py
)
- Responsibility: User interface and visualization
- Key Features:
- File upload handling
- User selection interface
- Visualization rendering
- Interactive controls
2. Preprocessor (preprocessor.py
)
- Responsibility: Data cleaning and structuring
- Key Features:
- Handles multiple date/time formats
- Extracts messages and metadata
- Filters system messages
- Creates structured DataFrame
3. Helper Module (helper.py
)
- Responsibility: Analytical computations
- Key Features:
- Statistical metrics
- Temporal analysis
- Content analysis
- Visualization data preparation
4. Notebook (whatsAppAnalyzer.ipynb
)
- Responsibility: Prototyping and experimentation
- Key Features:
- Initial pattern development
- Data exploration
- Algorithm testing
Data Flow
- Input: User uploads WhatsApp chat export (.txt)
- Preprocessing:
- Raw text is parsed using regex patterns
- Messages are categorized and timestamped
- Structured DataFrame is created
- Analysis:
- Selected metrics are computed
- Temporal patterns are identified
- Content features are extracted
- Visualization:
- Results are displayed in interactive charts
- User can explore different views
Installation
Prerequisites
- Python 3.8+
- pip package manager
Steps
Clone the repository:
git clone [repository-url] cd whatsapp-analyzer
Install dependencies:
pip install -r requirements.txt
Run the application:
streamlit run srcs/app.py
Usage
- Launch the application
- Upload a WhatsApp chat export file
- Select a user or "Overall" for group analysis
- Explore the various analysis tabs:
- Statistics
- Timelines
- Activity Maps
- Word Clouds
- Emoji Analysis
Analysis Capabilities
1. Basic Statistics
- Message counts
- Word counts
- Media shared
- Links shared
2. Temporal Analysis
- Daily activity patterns
- Monthly trends
- Hourly distributions
3. User Engagement
- Most active users
- User participation rates
- Message distribution
4. Content Analysis
- Most common words
- Emoji usage
5. Sentiment Analysis
- Message sentiment scoring
- Sentiment trends over time
- User sentiment comparison
5. Topics Analysis
- Topic modeling
- Common topics over time
- User interests