Katarzyna Stępień
Overview
All work

NLP · B.A. thesis · SWPS University · 2026

Unmasked: catching manipulative UX copy with NLP

Dark patterns live in the words: "Only 2 left!", "43 people are viewing this". I trained a classifier to spot them and shipped it as a Chrome extension that warns you before you buy.

The problem

Manipulative copy is everywhere in e-commerce, and people rarely notice it.

What I did

Trained and compared five classifiers on 2,356 labelled texts, then shipped the best as a Chrome extension.

Result

F1 0.936 and ROC AUC 0.976, running fully offline in the browser.

Pythonscikit-learnTF-IDFJavaScriptChrome extension
Binary F10.936
Binary ROC AUC0.976
By category, macro F10.891

Why it matters

Dark patterns undermine user autonomy and informed consent. The project supports ethical UX design by making deceptive copy visible at the moment it works on you.

CategoryExample
Scarcity"Only 2 left in stock!"
Urgency"Offer ends in 10:00 minutes"
Social proof"43 people are viewing this"
MisdirectionConfusing opt-out wording
Obstruction, sneaking, forced actionPatterns that block, hide or push

Data

2,356 short UX texts from e-commerce sites: the Dark Patterns dataset (Mathur et al., 2019) plus neutral interface texts, balanced 50/50 between dark and non-dark. Each sample has a page id, the text, a label and a pattern category.

Method

Preprocessing

Lowercasing, whitespace trimming and stop-word removal, then TF-IDF with 1–2-grams and up to 5,000 features.

Models compared

Logistic Regression, a linear Support Vector Machine, Random Forest, Naive Bayes and Gradient Boosting, on a binary task (dark or not) and a multiclass task (which pattern).

Results

  • Logistic Regression was the best model on the binary task.
  • Dark patterns have their own vocabulary: urgency ("hurry", "limited"), scarcity ("only", "left", "stock") and social proof ("people", "purchased").
  • Classical models on TF-IDF did surprisingly well; the rare categories suffered from too little data.

From model to extension

The top lexical features of the trained model, such as left, limited, hurry, people and bought, became explicit rules in a JavaScript classifier. The extension scans the text of any page, highlights flagged copy in place with a severity of critical, warning or info, and a popup explains the psychological mechanism behind each one.

Classification runs fully offline, with no API calls. AI-written explanations are optional, with your own OpenAI key.

What could come next

  • Transformer models such as BERT or RoBERTa.
  • Multimodal analysis of text together with the interface visuals.
  • Data augmentation for the under-represented categories.

Stępień, K. (2026). NLP-Based Detection of Manipulative UX Patterns in Web Interfaces. SWPS University, Warsaw.

See all work