Enhancing Thai Sentiment Analysis with WangchanBERTa and Instance-Class-Aware Dynamic Kernel Selection

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Thai sentiment analysis on social media remains challenging due to the lack of explicit word boundaries, informal expressions, code-mixing, short text length, and severe class imbalance, particularly in the WISESIGHT benchmark dataset. Although transformer-based models such as WangchanBERTa provide strong contextual representations for Thai language processing, conventional hybrid architectures using fixed convolutional kernels may fail to capture diverse local semantic patterns across different sentiment classes. To address this limitation, this study proposes WangchanBERTa with Instance-Class-Aware Dynamic Kernel Selection (WangchanBERTa-IC-DKS), a novel hybrid framework that integrates contextualized embeddings with multi-kernel convolutional neural networks and dynamic kernel selection at both the instance and class levels. The proposed model adaptively determines kernel importance according to sentence semantics and class-specific sentiment characteristics, enabling more effective local feature extraction and improved minority-class recognition. Experiments were conducted on the WISESIGHT sentiment benchmark using four kernel candidates: [2, 3, 4], [3, 4, 5], [2, 3, 4, 5], and [1, 2, 3, 4, 5]. The kernel candidate [2, 3, 4, 5] achieves the best performance, with a mean macro-F1 of 63.93% averaged across three independent runs using different random seeds. Ablation studies further show that combining both class-aware and instance-aware dynamic kernel selection improves balanced classification performance compared with fixed multi-kernel CNN baselines. The proposed model also outperforms the previous state-of-the-art Parallel Hybrid model by 1.23 percentage points on the WISESIGHT dataset and by 1.36 percentage points on the 40 Thai children’s tales dataset. These findings demonstrate that dynamic kernel selection is more effective than fixed convolutional kernels across the two evaluated Thai sentiment benchmarks, particularly for short, noisy, and imbalanced Thai texts.

Article activity feed