Master’s Research

Cross-Domain Affective Analysis of Large-Scale Textual Data Using Transformer-Based NLP Models

Sentiment distribution across four text domains, with topic-level emotion overlaid — the thesis’s central comparison

Overview

My Master’s thesis, completed in 2025 in the MEng in Big Data Analytics program at Arcada University of Applied Sciences, asked what happens when a single pretrained transformer pipeline is pointed at four fundamentally different kinds of text — global news, financial reporting, social media chatter, and consumer reviews.

The unifying question across the thesis: when one off-the-shelf sentiment and emotion model is deployed across radically different registers of language, does the output reflect real, interpretable domain differences — or is it just noise dressed up as insight?

What the Thesis Covered

Large-scale news sentiment on Common Crawl News

Built the foundational pipeline on CC-News, over 700,000 English-language articles scraped from more than 60,000 domains (2016–2019). Used a multilingual BERT model (nlptown/bert-base-multilingual-uncased-sentiment) to classify sentiment at scale, then examined both source-level bias across the top 20 publishing domains and how sentiment drifted over time.

Extension to finance, social media, and reviews

Re-ran the identical pipeline on the Financial PhraseBank, a Social Media Popularity corpus, and a Kaggle consumer sentiment dataset — three domains with sharply different formality, length, and emotional volatility — to test whether the affective patterns found in news were domain-specific or general.

Topic modeling with BERTopic

Generated dense document embeddings with all-MiniLM-L6-v2, reduced them to five dimensions with UMAP, and clustered with HDBSCAN to surface latent topics in each corpus. Topic clusters were then named using zero-shot classification (facebook/bart-large-mnli) against domain-specific candidate label sets, turning opaque cluster IDs into readable categories like Politics, Banking, or Support Interaction.

Emotion classification by topic

Layered a DistilBERT emotion model (bhadresh-savani/distilbert-base-uncased-emotion) on top of the named topics to see not just whether a topic skewed positive or negative, but which specific emotion — anger, fear, joy, sadness — dominated its representative text.

Scaling the pipeline on HPC infrastructure

Sentiment inference on CC-News failed to complete on a local CPU machine even after 24 hours, repeatedly crashing on memory. Rebuilding preprocessing around Dask and moving inference to Puhti — CSC’s HPC cluster in Finland — with GPU-accelerated batching cut the same job to under two hours on two NVIDIA V100s.


Methodological Background

Transformer-Based NLP Multilingual Sentiment Classification Emotion Detection Topic Modeling Zero-Shot Classification Dimensionality Reduction (UMAP) Density-Based Clustering (HDBSCAN) Cross-Domain NLP Evaluation

Technical Skills Earned

Hugging Face Transformers PyTorch BERTopic Dask (Distributed Preprocessing) GPU-Accelerated Batch Inference HPC / Puhti (CSC) NLTK Data Visualization

Datasets Used

  1. Common Crawl News (CC-News) — ~708,000 articles, 60,000+ domains, 2016–2019, via Hugging Face Datasets
  2. Financial PhraseBank — 4,840 hand-labeled financial statements (Malo et al. 2014)
  3. Social Media Popularity Dataset — ~32,000 high-engagement Twitter/Reddit posts
  4. Kaggle Sentiment Corpus — ~30,000 movie and product reviews

This project extends the same instinct that shaped my earlier training in physics and systems biology into a new register: looking for signal amid noise, structure amid variation, and stability amid change — whether the system in question is a pendulum, a genome, or a hundred thousand news articles.