Skip to content

Repository files navigation

LiveEmot logo

LiveEmot

Explore emotion signals in context.

Explore seven emotion signals and the phrases that move them with a model that runs inside your browser. No app installation required.

Launch LiveEmot · Architecture · Brand system · Contributing

LiveEmot browser emotion and phrase analysis

A private writing-analysis lab

LiveEmot turns a piece of English writing into seven independent model signals: Joy, Surprise, Fear, Sadness, Disgust, Anger, and Neutral. Its contextual phrase lab then tests how contiguous unigrams, bigrams, and trigrams influence those signals.

The analysis runs in a Web Worker using a quantized ONNX model. There is no inference server and no account. The browser downloads the model only after an explicit click, stores it in Cache Storage, and exposes a control that removes the cached files.

LiveEmot is an experimental lens on wording, not a lie detector, diagnostic tool, or reading of a person's internal state.

First useful result

There is no application to install. Open the page and use it directly. The first analysis still requires one explicit browser download of the model weights.

  1. Open the live application.
  2. Select Download model to this browser. The quantized download is approximately 125 MB.
  3. Write or paste text. The seven-signal map updates in the browser.
  4. Select Analyze phrase influence to run contextual removal experiments and explore the interactive contribution, terrain, and heatmap views.
  5. Use Remove stored model whenever you no longer want the model in browser storage.

Returning users can load the cached model without downloading it again.

What it can do

Surface What it shows
Live signal map Seven independent broad emotion estimates that update as wording changes
Phrase influence Signed score changes after removing contextual one-, two-, and three-word phrases
Contribution chart The strongest supporting and suppressing phrases for a selected emotion
Influence terrain Where influential phrases occur across the source text
Cross-emotion heatmap How the same phrase moves several model outputs
Writing statistics Word count, sentence count, lexical diversity, sentence length, reading time, and n-gram counts
Storage controls Download status, cached size when available, and explicit model removal

Why phrase influence uses context

Classifying isolated words would misrepresent the model. The GoEmotions data contains short comments rather than word-level labels. LiveEmot therefore:

  1. divides text into passages of up to 30 words;
  2. scores each untouched passage;
  3. removes one contiguous candidate phrase;
  4. scores the changed passage;
  5. reports the signed difference for each broad signal.

A positive influence means removing the phrase lowered that signal. A negative influence means removing it raised the signal. These are model-removal experiments, not causal explanations. Overlapping phrases share evidence, and removing text can change grammar.

To keep browsers responsive, the worker evaluates at most 180 candidates on WebGPU and 72 on the WebAssembly compatibility path. Larger candidate sets are sampled evenly across the text.

Privacy and data flow

Data or resource Where it goes
Text being analyzed React state and an in-browser inference Web Worker
Model and tokenizer files Downloaded from Hugging Face and cached by the browser
Model outputs Returned from the worker to the current page
Accounts, analytics, API keys Not used

The application code does not send analyzed text to an inference API. The browser still contacts GitHub Pages to load the application and Hugging Face to download model assets. Browser storage persistence is requested when available but is not guaranteed; the browser may still evict cached files.

See Architecture for trust boundaries, worker flow, backend selection, and caching details.

Model and interpretation

LiveEmot uses:

The model was trained for multi-label classification on the English GoEmotions dataset. LiveEmot maps the 28 outputs to seven broad directions and uses the strongest fine-grained output in each direction. The displayed values are independent model estimates; they are not required to sum to 100%.

Supported environments

The current release has been manually verified on:

  • Arc on macOS using WebGPU;
  • Chrome on Android using the single-threaded WebAssembly fallback;
  • responsive layouts down to a 320 px viewport.

WebGPU is used only after the browser returns a real GPU adapter. If adapter or session creation fails, LiveEmot starts a clean worker and explicitly loads the WebAssembly backend. Other modern browsers may work but have not yet been claimed as verified.

GitHub Pages cannot provide the cross-origin isolation headers required for multi-threaded WebAssembly, so the compatibility path intentionally uses one WASM thread.

Limits

  • The downloaded model is English-only. Browser word and sentence segmentation is locale-aware, but that does not make the classifier multilingual.
  • Input is capped at 4,000 characters.
  • Sarcasm, implicit context, identity, culture, mixed languages, and unusual domains can produce poor estimates.
  • Some fine-grained GoEmotions labels are substantially less reliable than others.
  • Broad categories use a hand-documented mapping and the maximum fine-label score; they are not a retrained seven-class model.
  • Phrase removal is an approximation. It does not provide gradients, causal attribution, or a human explanation.
  • Results should not be used for diagnosis, hiring, moderation enforcement, surveillance, or high-stakes decisions.

Local development

Prerequisite: Node.js >=22.13.0.

git clone git@github.com:ari-abb/LiveEmot.git
cd LiveEmot
npm ci
npm run dev

The development server prints the local URL. The first model download is origin-specific, so a model cached on the production site is not shared with localhost.

Validate a change

npm test
npm run lint
npm run build

Production deployment

.github/workflows/deploy-pages.yml runs tests, builds dist/, and deploys the artifact to GitHub Pages after a push to main.

Project status

LiveEmot is an early-stage open-source NLP experiment. Contributions and technical discussion are welcome.

License

LiveEmot is available under the MIT License. The model, dataset, and dependency licenses remain their respective authors' work.

About

Sentiment analysis for your text, locally in your Browser.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages