ToneLeaf
Privacy-Conscious Sentiment & Emotional-Language Analysis
Built an explainable NLP application that analyzes sentiment and emotional-language signals locally, with privacy safeguards, visible cues, offline-model support, and reproducible evaluation.
System Architecture
Local-first NLP architecture and evaluation design documented in ToneLeaf.
Private text input
User text enters a stateless analysis request without creating an application history.
Local NLP processing
Negation, intensifiers, phrases, threats, and distress-related language are evaluated locally.
Separated analysis paths
Sentiment, directed threats, and self-distress signals remain distinct to prevent false equivalence.
Visible evidence cues
The interface exposes influential words, phrases, signal labels, and limitations.
Reproducible evaluation
An 81-case labelled suite and 745-sentence regression audit exercise deterministic behavior.
Explainable sentiment and emotional-language signals with a local privacy boundary.
Project Overview
ToneLeaf is a sentiment and emotional-language analysis application that combines a calm Next.js interface with a Python NLP engine for positive, neutral, negative, supportive, and distress-related language signals.
The system is designed around privacy and explainability: text can be processed entirely on-device, analysis is stateless, request bodies are not logged, and results expose the words and phrases that influenced each signal.
A deterministic fallback engine handles negation, intensifiers, phrases, insults, threats, and distress-related language. An optional Hugging Face transformer can run strictly from local model files without downloading data during analysis.
The project includes an executed evaluation notebook, a curated 81-example labelled suite, and a broader 745-sentence regression audit. These results measure coverage of the included test cases rather than universal real-world accuracy.
Problem
Many sentiment tools send sensitive text to third-party services or return opaque labels without explaining which language signals influenced the result.
Solution
Developed a local-first NLP workflow with explainable scoring, separate distress-language screening, optional offline transformer inference, privacy headers, and reproducible evaluation suites.