MLNLPAdvanced

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.

81/81
Labelled Cases
745/745
Audit Cases
Local
Privacy Mode
Detailed workflow

System Architecture

Local-first NLP architecture and evaluation design documented in ToneLeaf.

Verify on GitHub
01 · Text1

Private text input

User text enters a stateless analysis request without creating an application history.

02 · Language2

Local NLP processing

Negation, intensifiers, phrases, threats, and distress-related language are evaluated locally.

03 · Signals3

Separated analysis paths

Sentiment, directed threats, and self-distress signals remain distinct to prevent false equivalence.

04 · Explain4

Visible evidence cues

The interface exposes influential words, phrases, signal labels, and limitations.

05 · Audit5

Reproducible evaluation

An 81-case labelled suite and 745-sentence regression audit exercise deterministic behavior.

Quality gates
No persistent text history
Separate distress screening
81 + 745 case audits
Validated output

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.

Project Snapshot

81/81
Labelled Cases
745/745
Audit Cases
Local
Privacy Mode