arXiv:2611.08323cs.CLNov 2026

Manuscript Offprint

arXiv:2611.08323

Polarity Classification with Multitask Learning Syntax Augmentation

Muhammad Imran, Carlos Gómez-Rodríguez

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Sentiment Analysis (SA) is a fundamental NLP task concerned with the identification and categorization of subjective information in text. While lexicon-based methods offer transparency, they often struggle with linguistic phenomena such as negation and intensification. Syntactic parsing has been integrated into SA pipelines to address this, but conventional parsers introduce significant computational overhead. Recent work shows that reformulating dependency parsing as a Sequence Labeling (SEL) task can improve efficiency. We propose and compare two strategies for integrating syntactic knowledge into a neural sentiment analysis model under unified Multi-Task Learning (MTL). The first, Standard-MTL, jointly learns dependency parsing (via sequence labeling) and sentiment polarity classification using a shared encoder with two task-specific heads. The second, Contrastive-MTL, provides implicit syntactic guidance through a contrastive auxiliary objective and a syntax-biased attention pooling mechanism, without requiring explicit label prediction. Both rely on syntactic annotations during training and eliminate need for hand-crafted compositional rules or external parsing at inference. We evaluate eleven datasets spanning seven languages—the MARC corpus (English, Spanish, French, German) and seven datasets from SemEval-2022 Task 10 (English, Spanish, Norwegian, Basque, Catalan)—using four established SEL encodings. With the relative encoding, Contrastive-MTL outperforms a syntax-naive baseline on 10 of 11 datasets and surpasses the external rule-based pipeline (SELSP) that parses at inference on all six datasets where the latter applies, while being 1.5–9× faster at evaluation. Standard-MTL is more dataset- and encoding-dependent. These results show implicit syntactic supervision during training can match or exceed explicit parsing at inference without computational overhead.

1 Introduction

Sentiment Analysis (SA) is a fundamental task in Natural Language Processing (NLP) that deals with the identification and categorization of subjective information in a given text, typically involving subjectivity detection and polarity classification (e.g., positive, negative, or neutral) (Cui et al., 2023). In this article, we focus on sentiment polarity classification: given an input text xx (a sentence or document), predict its overall sentiment polarity y∈Yy \in \mathcal{Y}, where Y\mathcal{Y} typically contains labels such as positive, negative, and neutral. This is a sentence-or document-level classification task. We do not address fine-grained tasks like structured or aspect-based sentiment analysis.

Lexicon-based approaches leverage sentiment dictionaries like SO-CAL (Brooke et al., 2009) to detect polarity-bearing words, providing an intuitive and transparent approach to SA. The explainability of lexicon-based methods stands in contrast to that of “black-box” supervised machine learning models. In lexicon-based approaches, the predicted sentiment can be traced directly to specific lexical items, whereas supervised models, despite often achieving high accuracy, obscure the reasoning behind their predictions (Cui et al., 2023).

However, the accuracy of lexicon-based approaches depends on the handling of linguistic phenomena such as negation (“not good”) and intensification (“very good”), which have the tendency to shift or modify sentiment polarity. The scope of these linguistic phenomena is quite complex. To handle it properly, researchers have integrated syntactic parsing within rule-based SA systems (Vilares et al., 2017; Imran et al., 2026b). By analyzing the syntactic structure of a sentence-often represented via Universal Dependencies (UD) (Zeman et al., 2023), rule-based systems can apply recursive, compositional rules to accurately determine the scope of polarity-shifting elements. Despite these advantages in accuracy and explainability, conventional syntactic parsers, such as Stanza (Qi et al., 2020), are computationally expensive, creating a bottleneck for large-scale or real-time SA applications (Gómez-Rodríguez and Vilares, 2018; Strzyz et al., 2019).

A promising solution to this computational bottleneck is the reformulation of dependency parsing as a Sequence Labeling (SEL) task (Gómez-Rodríguez and Vilares, 2018; Strzyz et al., 2019). SEL parsers rely on lightweight scripts (Roca et al., 2022) to linearize the tree structure into a sequence of labels, enabling the use of fast, off-the-shelf sequence taggers for syntactic analysis. Recent work by Imran et al. (2026b) successfully applied a Sequence Labeling Syntactic Parser (SELSP) within a rule-based sentiment analysis pipeline, demonstrating significant improvements in processing speed over traditional parsers while maintaining competitive accuracy for polarity classification.

While effective, the pipeline approach in (Imran et al., 2026b) treats parsing and sentiment analysis as two discrete stages: first, a full parse tree is generated via sequence labeling, and then a separate rule-based engine computes sentiment from that structure. In this article, we propose two alternative strategies for integrating syntactic knowledge under a unified Multi-Task Learning (MTL) framework. Unlike prior work that uses a pipeline architecture—where a sequence labeling parser first generates a full parse tree, followed by a separate rule-based engine that computes sentiment from that structure—our proposed MTL models leverage syntactic annotations (generated by an accurate off-the-shelf parser) during training to provide an auxiliary learning signal, thereby eliminating the need for hand-crafted compositional rules or external parsing at inference time. Our first variant, Standard-MTL, employs explicit multi-task supervision by jointly training a shared encoder to predict sentiment polarity and dependency relation labels simultaneously. In contrast, our second variant, Contrastive-MTL, integrates syntax implicitly through a contrastive auxiliary objective and a syntax-biased attention pooling mechanism. Crucially, both models share an identical baseline sentiment architecture; the auxiliary syntactic signals are discarded at inference to ensure that any performance gains stem solely from the internalized linguistic structure learned during training.

Recent advances in contrastive learning have demonstrated the value of both sentence-level and token-level objectives. Sentence-level methods such as SimCSE (Gao et al., 2021), DeCLUTR (Giorgi et al., 2021), and supervised contrastive learning (Khosla et al., 2020) learn robust representations by pulling together semantically similar sentences and pushing apart dissimilar ones. More recently, token-level objectives have proven effective in different settings: MEXMA (Janeiro et al., 2025) combines sentence-level and token-level objectives for cross-lingual sentence encoders by predicting masked tokens across languages, while Critical Tokens Matter (Lin et al., 2024) uses token-level contrastive estimation to identify and penalize critical tokens in LLM reasoning trajectories. These works establish that token-level signals can shape representations more effectively than sentence-level objectives alone. However, these methods either operate at the sentence/instance level or target cross-lingual encoding and LLM reasoning; none uses dependency relations as token-level contrastive signals for sentiment analysis. Our Contrastive-MTL fills this gap by combining token-level syntax and sentiment contrastive losses with syntax-biased attention pooling, injecting syntactic knowledge without requiring parsing at the inference stage.

Our contributions are threefold: (1) We present two complementary multi-task learning strategies for integrating syntactic information into sentiment analysis: Standard-MTL, which jointly learns dependency parsing as sequence labeling and sentiment classification, and MTL-Contrastive, which injects syntactic guidance implicitly through a contrastive auxiliary objective and syntax-biased attention pooling. (2) We evaluate both MTL variants on eleven datasets: MARC product reviews (spanning four language subsets) and seven SemEval-2022 Task 10 corpora covering hotel, news, and multi-domain reviews—across seven languages in total and using four sequence-labeling encodings. We then compare their performance against a single-task baseline (sentiment-only, without syntactic supervision), an external rule-based pipeline that parses at inference (SELSP), and two ablations that isolate the contributions of the contrastive losses and the attention bias. (3) Through a mechanism analysis on a SemEval-2022 English dataset combining linear probing, inference-time attention analysis, and learned-bias inspection, we show that the contrastive objective produces encoder representations that are linearly separable by dependency relation, and that the attention bias alone — without the contrastive anchor — degrades encoder-side syntactic encoding.