Stanceformer: Target-Aware Transformer for Stance Detection

Krishna Garg, Cornelia Caragea
10/9/2024
cs.CL

Official code: kgarg8/Stanceformer (5 stars, MIT, last commit 2024-12-12).

Abstract

The task of Stance Detection involves discerning the stance expressed in a text towards a specific subject or target. Prior works have relied on existing transformer models that lack the capability to prioritize targets effectively. Consequently, these models yield similar performance regardless of whether we utilize or disregard target information, undermining the task's significance. To address this challenge, we introduce Stanceformer, a target-aware transformer model that incorporates enhanced attention towards the targets during both training and inference. Specifically, we design a \textit{Target Awareness} matrix that increases the self-attention scores assigned to the targets. We demonstrate the efficacy of the Stanceformer with various BERT-based models, including state-of-the-art models and Large Language Models (LLMs), and evaluate its performance across three stance detection datasets, alongside a zero-shot dataset. Our approach Stanceformer not only provides superior performance but also generalizes even to other domains, such as Aspect-based Sentiment Analysis. We make the code publicly available.\footnote{\scriptsize\url{https://github.com/kgarg8/Stanceformer}}

View on arXivView PDF

Code Implementations(1)

MIT

Target Aware Transformer for Stance Detection

50Shell, PythonFeb 15, 20241 years agoMIT

Similar Papers

Cite this paper

@article{garg2024stanceformer,
  title  = {Stanceformer: Target-Aware Transformer for Stance Detection},
  author = {Krishna Garg and Cornelia Caragea},
  year   = {2024},
  eprint = {2410.07083},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.07083v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.07083.svg)](https://codeofpaper.com/paper/2410.07083)

Discussion