# π³π¬ Naija Sentiment v2
> Real-time Twitter sentiment analysis for Nigerian political parties β APC & ADC
Built with VADER + Nigerian political lexicon, Google Gemini AI summaries, and a dark-mode Streamlit dashboard.
---
## What's new vs v1
| Feature | v1 | v2 |
|---|---|---|
| Sentiment engine | TextBlob (movie review corpus) | VADER + Nigerian slang lexicon |
| Nigerian language support | β | β
Pidgin, political slang, key terms |
| Dashboard design | Basic | Dark mode, Plotly charts, animations |
| AI summaries | Gemini | Gemini (improved prompt) |
| Demo mode | β | β
Works without any API keys |
| Comparison tab | β | β
Head-to-head APC vs ADC |
| Score distribution | β | β
Histogram + timeline |
| Tweet feed | Basic | Filterable, sorted by score |
---
## Quickstart
```bash
# 1. Clone
git clone
github.com
cd naija-sentiment
# 2. Install dependencies
pip install -r requirements.txt
# 3. Set up environment variables
cp .env.example .env
# Edit .env with your API keys
# 4. Run the dashboard
streamlit run app.py
```
### No API keys? No problem.
The dashboard has a built-in demo mode with realistic mock tweets.
In the sidebar β Controls β **Use demo data** β **Load Demo Data**.
---
## API Keys
### Twitter Bearer Token
- Go to developer.twitter.com
- Create a project and app (free tier = Basic, ~$0/month for limited access)
- Copy your **Bearer Token** into `.env`
### Google Gemini API Key
- Go to ai.google.dev
- Free tier available, no credit card needed
- Copy your key into `.env`
---
## Project Structure
```
naija-sentiment/
βββ app.py # Main Streamlit dashboard
βββ src/
β βββ scraper.py # Twitter API v2 fetcher (Tweepy)
β βββ sentiment.py # VADER + Nigerian lexicon analyzer
β βββ summarizer.py # Gemini AI summarizer
β βββ mock_data.py # Demo data generator
βββ data/
β βββ apc_tweets.json # Fetched/cached APC tweets
β βββ adc_tweets.jso β¦