Home Current Archive Editorial Board
Instructions for papers
For Authors Aim & Scope News Contact

METAHEURISTIC-DRIVEN HYPERPARAMETER OPTIMIZATION FOR BERT IN SENTIMENT ANALYSIS

DOIhttps://doi.org/10.70102/afts.2025.1833.176

Abstract

Sentiment analysis has come out as an important activity in natural language processing (NLP) applications whose data analysis is in high demand at present in the modern world. The BERT (Bidirectional Encoder Representations from Transformers) algorithm has proved to be extremely efficient when it comes to sentiment analysis tasks, and its potential is far exceeding that of conventional algorithms, unlocking their potential however would require fine tuning of their hyperparameters. It is quite a feat to optimise the BERT’s various hyperparameters due to the complicated interaction between them (e.g. the learning rate, batch size, dropout rate, attention heads). In this paper, the Salp Swarm Algorithm (SSA) is used as a bio-inspired metaheuristic optimization technique to optimize the fine-tuning process. Through SSA’s exceptionally efficient search capabilities in modelling multidimensional search space, BERT hyperparameters are optimized systematically to the sentiment classification tasks. A benchmark dataset for sentiment analysis (Sentiment140) is used to evaluate the proposed model. The novelty of the presented model is the fact that it dynamically adjusts its search behaviour in response to performance signals, thus it identifies better-performing parameter sets than conventional methods, leading to successful exploitation of the BERT algorithm that has produced high performing configurations. Extensive evaluations against 3 state-of-the-art search algorithms, namely manual tuning, grid search, and random search are conducted on the Sentiment140 benchmark dataset, demonstrating the superiority of the proposed SSA BERT optimization technique over state-of-the-art methods. The SSA-BERT model achieved a maximum accuracy of 96.4 percent, which is far better than manual tuning, grid search, and random search (65.0 percent, 69.5 percent and 72.0 percent respectively). It also performed better than other existing BERT models used in related literature, which showed accuracy levels between 46.4 and 75.7 percent in accordance with different benchmarks.

References

1.
Liu B. Sentiment analysis and opinion mining. Springer Nature. 2022 May 31.
2.
Medhat W, Hassan A, Korashy H. Sentiment analysis algorithms and applications: A survey. Ain Shams Engineering Journal. 2014 Dec 1;5(4):1093–113.
3.
Devlin J, Chang MW, Lee K, Toutanova K, BERT. Pre-training of deep bidirectional transformers for language understanding. . In: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. 2019 Jun:4171–86.
4.
Rogers A, Kovaleva O, Rumshisky A. A Primer in BERTology: What We Know About How BERT Works. Transactions of the Association for Computational Linguistics. 2020;8:842–66.
5.
Sun C, Qiu X, Xu Y, Huang X. How to fine-tune BERT for text classification? In: China National Conference on Chinese Computational Linguistics; . 2019 Oct 13;194–206.

Citation

The statements, opinions and data contained in the journal are solely those of the individual authors and contributors and not of the publisher and the editor(s). We stay neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Most read articles

  1. 01 STEP TOWARDS INTELLIGENT TRANSPORTATION SYSTEM WITH VEHICLE CLASSIFICATION AND RECOGNITION USING SPEEDED-UP ROBUST FEATURES Original scientific article June 2023
  2. 02 CORRUPTION AND INFRASTRUCTURE DEVELOPMENT BASED ON STOCHASTIC ANALYSIS Original scientific article June 2023
  3. 03 ECO TOURISM DEVELOPMENT BASED ON NATURAL AND ARTIFICIAL SURROUNDINGS IN SEMBERIJA AND MAJEVICA AREA Review paper June 2023
  4. 04 CONVERGENCE PROBLEMS WITH ANSYS'S SOLID 65 FINITE ELEMENT IN CONCRETE-FILLED TUBULAR (CFT) COLUMNS AS A CASE STUDY Original scientific article June 2023
  5. 05 THERMAL COMFORT IN BELGRADE, SERBIA: UTCI-BASED SEASONAL AND ANNUAL ANALYSIS FOR THE PERIOD 1991-2020 Original scientific article June 2023
  6. 06 GIS BASED VULNERABILITY ASSESSMENT OF ILLEGAL WASTE DISPOSAL – CASE STUDY EAST SARAJEVO Original scientific article December 2022