Offline-first mood journal PWA with in-browser emotion classification. All data stays private on your device.
0
stars
40
commits
TypeScript
primary language
Jul 1, 2026
updated
Offline-first Progressive Web App (PWA) for multi-label emotion classification and journaling. Emotion classification is powered by a fine-tuned SetFit model using MiniLM embeddings, with inference running entirely client-side via ONNX Runtime Web and Transformers.js
FastAPI serves the web application and model assets; all inference is executed locally in the browser.

Backend/ML: Python, FastAPI, PyTorch, Transformers, ONNX Runtime
Frontend: React, TypeScript, Vite, Tailwind CSS, Workbox
├── apps/
│ ├── api/ # FastAPI backend
│ └── web/ # React/Vite frontend
├── docker/ # Container configuration
├── images/ # README assets
├── ml/
│ ├── config.py # Typed config loader
│ ├── config.yaml # Project configuration
│ ├── data.py # Dataset loading
│ ├── datasets/ # Train/validation/test datasets
│ ├── export.py # ONNX export pipeline
│ ├── inference.py # Document-level inference
│ ├── evaluate.py # Model benchmarking
│ ├── trainer.py # SetFit training
│ └── validate.py # Model evaluation
├── notebooks/ # Experimentation
├── tests/ # Test suite
├── pyproject.toml
└── README.md
| Metric | Score |
|---|---|
| Macro F1 | 0.417 |
| Micro F1 | 0.548 |
| Macro ROC AUC | 0.804 |
| Hamming Loss | 0.176 |
The dataset is highly imbalanced across emotion labels. Despite class rebalancing and hyperparameter optimization, minority classes remain the main source of prediction error.
The underlying classifier predicts a broader set of emotion labels than are exposed in the web app. To improve usability, the web app presents a curated subset of emotions that are most relevant to mood journaling while continuing to predict the full set internally.
01_dataset_exploration.ipynb: Exploratory Data Analysis02_data_preprocessing.ipynb: Data Preprocessing & Class Rebalancing03_hyperparameter_optimization.ipynb: Hyperparameter Optimization (Optuna)04_final_model_evaluation.ipynb: Final Model Evaluationpip install -e ".[api,ml,dev]"
python -m ml.trainer
uvicorn apps.api.main:app --reload
API docs: http://localhost:8000/docs
cd apps/web
npm install
npm run dev
Start locally with docker-compose (models mounted from MODELS_DIR):
export MODELS_DIR=/path/to/models
docker compose up --build -d
Model files from MODELS_DIR are served inside the container at /api/models.
pytest
lemotif (Li & Parikh, arXiv 2019)40 commits
TypeScript
79.0%
Python
15.4%
CSS
4.1%
Offline-first mood journal PWA with in-browser emotion classification. All data stays private on your device.
0
stars
40
commits
TypeScript
primary language
Jul 1, 2026
updated
Offline-first Progressive Web App (PWA) for multi-label emotion classification and journaling. Emotion classification is powered by a fine-tuned SetFit model using MiniLM embeddings, with inference running entirely client-side via ONNX Runtime Web and Transformers.js
FastAPI serves the web application and model assets; all inference is executed locally in the browser.

Backend/ML: Python, FastAPI, PyTorch, Transformers, ONNX Runtime
Frontend: React, TypeScript, Vite, Tailwind CSS, Workbox
├── apps/
│ ├── api/ # FastAPI backend
│ └── web/ # React/Vite frontend
├── docker/ # Container configuration
├── images/ # README assets
├── ml/
│ ├── config.py # Typed config loader
│ ├── config.yaml # Project configuration
│ ├── data.py # Dataset loading
│ ├── datasets/ # Train/validation/test datasets
│ ├── export.py # ONNX export pipeline
│ ├── inference.py # Document-level inference
│ ├── evaluate.py # Model benchmarking
│ ├── trainer.py # SetFit training
│ └── validate.py # Model evaluation
├── notebooks/ # Experimentation
├── tests/ # Test suite
├── pyproject.toml
└── README.md
| Metric | Score |
|---|---|
| Macro F1 | 0.417 |
| Micro F1 | 0.548 |
| Macro ROC AUC | 0.804 |
| Hamming Loss | 0.176 |
The dataset is highly imbalanced across emotion labels. Despite class rebalancing and hyperparameter optimization, minority classes remain the main source of prediction error.
The underlying classifier predicts a broader set of emotion labels than are exposed in the web app. To improve usability, the web app presents a curated subset of emotions that are most relevant to mood journaling while continuing to predict the full set internally.
01_dataset_exploration.ipynb: Exploratory Data Analysis02_data_preprocessing.ipynb: Data Preprocessing & Class Rebalancing03_hyperparameter_optimization.ipynb: Hyperparameter Optimization (Optuna)04_final_model_evaluation.ipynb: Final Model Evaluationpip install -e ".[api,ml,dev]"
python -m ml.trainer
uvicorn apps.api.main:app --reload
API docs: http://localhost:8000/docs
cd apps/web
npm install
npm run dev
Start locally with docker-compose (models mounted from MODELS_DIR):
export MODELS_DIR=/path/to/models
docker compose up --build -d
Model files from MODELS_DIR are served inside the container at /api/models.
pytest
lemotif (Li & Parikh, arXiv 2019)40 commits
TypeScript
79.0%
Python
15.4%
CSS
4.1%