About MoodLens
Understanding the science behind your mood tracking.
What is MoodLens?
MoodLens is a personal mood journaling application that helps you track and understand your emotional well-being over time. Write about your day, and MoodLens will analyse your text using a built-in sentiment analysis engine to provide insights into your mood patterns.
How Sentiment Analysis Works
MoodLens uses a lexicon-based approach to sentiment analysis. No external AI APIs are called — everything runs locally:
- Tokenization — Your text is converted to lowercase, punctuation is removed, and words are separated.
- Sentiment Scoring — Each word is matched against a curated lexicon of 120+ positive and negative words, each with a weight between -1.0 and 1.0.
- Negation Handling — Words like "not", "never", and "hardly" flip the sentiment of the following word.
- Intensifiers — Words like "very", "extremely", and "incredibly" amplify the weight of the next sentiment word.
- Emotion Detection — Words are matched against 7 emotion categories (joy, sadness, anger, fear, love, surprise, calm) with confidence scores.
- Mood Labelling — The aggregate score is mapped to five labels: very negative, negative, neutral, positive, very positive.
Emotion Categories
Joy — happiness, excitement, delight
Sadness — grief, loneliness, melancholy
Anger — frustration, irritation, fury
Fear — anxiety, worry, panic
Love — affection, caring, warmth
Surprise — astonishment, wonder, shock
Calm — peace, serenity, balance
Privacy
All your journal entries are stored locally in a SQLite database on the server. No data is sent to external services. Your thoughts remain private and secure.
Technology
- Backend: Python, Flask 3.0
- Database: SQLAlchemy + SQLite
- Validation: Pydantic 2.5
- Sentiment: Custom lexicon engine (no external APIs)
- Charts: HTML5 Canvas API
- Testing: pytest + pytest-cov