Skip to main content
QUICK REVIEW

[Paper Review] MoralBERT: A Fine-Tuned Language Model for Capturing Moral Values in Social Discussions

Vjosa Preniqi, Iacopo Ghinassi|arXiv (Cornell University)|Mar 12, 2024
Hate Speech and Cyberbullying DetectionComputer Science7 citations
TL;DR

MoralBERT is a fine-tuned BERT model trained on Twitter, Reddit, and Facebook data annotated for Moral Foundations Theory; it achieves strong in-domain moral value prediction, with mixed out-of-domain performance and a domain-adversarial variant that helps mainly in single-label setups.

ABSTRACT

Moral values play a fundamental role in how we evaluate information, make decisions, and form judgements around important social issues. Controversial topics, including vaccination, abortion, racism, and sexual orientation, often elicit opinions and attitudes that are not solely based on evidence but rather reflect moral worldviews. Recent advances in Natural Language Processing (NLP) show that moral values can be gauged in human-generated textual content. Building on the Moral Foundations Theory (MFT), this paper introduces MoralBERT, a range of language representation models fine-tuned to capture moral sentiment in social discourse. We describe a framework for both aggregated and domain-adversarial training on multiple heterogeneous MFT human-annotated datasets sourced from Twitter (now X), Reddit, and Facebook that broaden textual content diversity in terms of social media audience interests, content presentation and style, and spreading patterns. We show that the proposed framework achieves an average F1 score that is between 11% and 32% higher than lexicon-based approaches, Word2Vec embeddings, and zero-shot classification with large language models such as GPT-4 for in-domain inference. Domain-adversarial training yields better out-of domain predictions than aggregate training while achieving comparable performance to zero-shot learning. Our approach contributes to annotation-free and effective morality learning, and provides useful insights towards a more comprehensive understanding of moral narratives in controversial social debates using NLP.

Motivation & Objective

  • Motivate analysis of moral narratives in social media and quantify moral values in text using Moral Foundations Theory (MFT).
  • Develop and compare a BERT-based model (MoralBERT) trained on diverse, annotated social media data to detect moral foundations.
  • Evaluate in-domain and out-of-domain performance for single-label (moral value presence) and multi-label (multiple values) settings, including a domain-adversarial variant.
  • Benchmark against lexicon-based and Word2Vec+ML baselines to assess gains from fine-tuned language representations.

Proposed method

  • Fine-tune a BERT-base sequence classifier on combined Twitter, Reddit, and Facebook data annotated for MFT categories.
  • Experiment with a domain-adversarial extension that learns domain-invariant representations and includes a gradient reversal layer.
  • Incorporate L2 regularization on the domain-invariant projection and a reconstruction loss to stay close to original BERT embeddings, with hyperparameter grid search for loss weights.
  • Address class imbalance with weighted losses following King and Zeng (2001) and employ one-vs-rest (single-label) vs. multi-label setups.
  • Preprocess text (URLs removed, @user for mentions, emojis mapped to text, non-ASCII removed) and set max sequence length to 150; evaluate with 5-fold cross-validation (in-domain) and cross-domain testing (out-of-domain).
  • Compare MoralBERT against baselines MoralStrength (lexicon-based) and Random Forest with Word2Vec embeddings.
Figure 1: Moral label distribution from the MFTC data.
Figure 1: Moral label distribution from the MFTC data.

Experimental results

Research questions

  • RQ1Can MoralBERT accurately detect presence/absence of moral foundations in text from multiple social media platforms?
  • RQ2Does domain-adversarial training improve cross-domain generalization for moral value prediction, and does it differentially affect single-label vs. multi-label settings?
  • RQ3How do in-domain and out-of-domain performances compare across moral foundations (Care, Fairness, Loyalty, Authority, Purity) and across data sources (Twitter, Reddit, Facebook)?

Key findings

  • MoralBERT (single-label) improves F1 by about 32% over baselines in-domain.
  • MoralBERT (multi-label) improves F1 by about 29% over baselines in-domain.
  • In out-of-domain tests, single-label MoralBERT with domain-adversarial training generally boosts performance, while multi-label with adversarial training underperforms compared to MoralBERT.
  • Across all three domains, domain adversarial training did not consistently improve multi-domain in-domain performance, but shows benefits for out-of-domain single-label predictions.
  • Single-label models consistently outperform multi-label models, likely due to interdependencies among moral dimensions and data imbalance.
  • Care and Fairness are learned more reliably than the underrepresented values (e.g., Purity, Authority) in several settings.
Figure 2: Moral label distribution from the MFRC data.
Figure 2: Moral label distribution from the MFRC data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.