Next Article in Journal
Analysis of Points of Interest in Hsinchu Old City Blocks Using Space Syntax
Previous Article in Journal
Computational Analysis of Catalytic Combustion Using Finite Volume Method (FVM): Advantages, Constraints, and Potential Applications
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

HauBERT: A Transformer Model for Aspect-Based Sentiment Analysis of Hausa-Language Movie Reviews †

1
Department of Computer Science, Federal University Dutse, Dutse 720211, Nigeria
2
Department of Computer Science, Federal University of Technology Babura, Jigawa 702104, Nigeria
*
Author to whom correspondence should be addressed.
Presented at the 5th International Electronic Conference on Applied Sciences, 4–6 December 2024; https://sciforum.net/event/ASEC2024.
Eng. Proc. 2025, 87(1), 43; https://doi.org/10.3390/engproc2025087043
Published: 9 April 2025
(This article belongs to the Proceedings of The 5th International Electronic Conference on Applied Sciences)

Abstract

In this study, we present a groundbreaking approach to aspect-based sentiment analysis (ABSA) using transformer-based models. ABSA is essential for understanding the intricate nuances of sentiment expressed in text, particularly across diverse linguistic and cultural contexts. Focusing on movie reviews in Hausa, a language under-represented in sentiment analysis research, we propose HauBERT, a bidirectional transformer-based approach tailored for aspect and polarity classification, by fine-tuning a pre-trained mBERT model. Our work addresses the scarcity of resources for sentiment analysis in under-represented languages by creating a comprehensive Hausa ABSA dataset. Leveraging this dataset, we preprocess the text using state-of-the-art techniques for feature extraction, enhancing the model’s ability to capture nuanced aspects of sentiment. Furthermore, we manually annotate aspect-level feature ontology words and sentiment polarity assignments within the reviewed text, enriching the dataset with valuable semantic information. Our proposed transformer-based model utilizes self-attention mechanisms to capture long-range dependencies and contextual information, enabling it to effectively analyze sentiment in Hausa movie reviews. The proposed model achieves significant accuracy in aspect term extraction and sentiment polarity classification, with scores of 99% and 92% respectively, outperforming traditional machine models. This demonstrates the transformer’s ability to capture complex linguistic patterns and nuances of sentiment. Our study advances ABSA research and contributes to a more inclusive sentiment analysis landscape by providing resources and models tailored for under-represented languages.

1. Introduction

Natural language processing (NLP) is a branch of artificial intelligence (AI) that uses machine learning to enable computers comprehend and interact with human language [1]. NLP combines statistical modelling, machine learning, deep learning, computational linguistics, and rule-based human language modelling to allow computers and digital devices to recognize, comprehend, and produce text and speech [2].
Sentiment analysis is crucial for companies as it helps them understand their customers’ feelings toward their brand. By automatically categorizing the emotions behind social media interactions, reviews, and other forms of feedback, organizations can make informed decisions. Sentiment analysis encompasses various techniques and methods that enable businesses to assess their clients’ opinions about specific services or products [3].
Understanding the emotions, thoughts, and opinions conveyed in written text is a core objective of NLP. In particular, sentiment analysis (SA) focuses on identifying people’s sentiments and opinions toward specific elements such as products and services. In written texts, these elements can be the whole document, sentences, or words within the text. This capability has applications in various fields, from marketing and recommendation systems to social media analysis, making it easier for decision-making [4]. Businesses, researchers, and policymakers use sentiment analysis to gauge public opinion, improve customer experience, and inform decision-making processes. However, traditional sentiment analysis approaches often fail to capture sentiment at a granular level, as they classify an entire sentence or document without distinguishing sentiments related to specific aspects.
Aspect-based sentiment analysis (ABSA) is a specialized task within SA that focuses on identifying and extracting sentiments related to specific aspects of a product or service [5]. ABSA addresses the limitation of traditional SA by identifying sentiment toward specific aspects of an entity within a text. For example, in a movie review stating, “The cinematography was stunning, but the storyline was weak”, general sentiment analysis may classify it as neutral due to the mix of positive and negative opinions. However, ABSA provides deeper insights by recognizing that cinematography is associated with a positive sentiment, while storyline carries a negative sentiment. This fine-grained sentiment extraction is particularly useful in domains such as product reviews, customer feedback analysis, and social media monitoring [6].
From the example in Figure 1, SA would classify the overall sentiment of the sentence as neutral because it contains both positive and negative opinions. However, it fails to capture the specifics about what exactly is liked or disliked, making it difficult to take targeted action based on this information alone. ABSA, on the other hand, can break down the sentiment by specific aspects: Camera Quality: Positive; Battery Life: Negative. The advantage of ABSA here is clear; it reveals that the user is happy with the camera but dissatisfied with the battery. This provides more actionable insight for product developers or customer support teams, who can then focus on improving battery life without affecting the camera quality, tailoring responses or improvements to the specific needs and preferences of users.
Additionally, ABSA can provide valuable data for marketing teams, who can emphasize highly rated aspects in promotional materials, and for streaming platforms, which can use these insights to improve recommendation algorithms by aligning content with user preferences. In essence, ABSA helps the industry respond more effectively to audience feedback, shaping content to better align with viewer expectations and drive engagement; this kind of analysis is not possible with traditional SA [7].
Despite significant advancements in ABSA for high-resource languages such as English and Chinese, low-resource languages, particularly African languages like Hausa, remain underexplored. Hausa is one of the most widely spoken languages in West Africa, with over 54 million speakers [8]. However, there is a scarcity of NLP resources, annotated datasets, and domain-specific sentiment analysis tools for Hausa. Existing multilingual sentiment analysis models, such as multilingual BERT (mBERT), struggle with the unique linguistic characteristics of Hausa, including its complex morphology, tonal variations, and lack of sufficient labelled data. Therefore, speakers of Hausa and other under-represented languages cannot benefit equally from language technologies that support other populations.
To address these challenges, this study introduces HauBERT, a transformer-based model specifically developed for aspect-based sentiment analysis in Hausa-language movie reviews. Our key contributions are as follows: (1) Development of a Hausa ABSA dataset. We curate and annotate a dataset of Hausa movie reviews, categorizing sentiment at the aspect level to facilitate supervised learning. (2) Secondly, we adapt mBERT for aspect extraction and sentiment polarity classification in Hausa, leveraging transfer learning and fine-tuning techniques to enhance its performance. Additionally, HauBERT performance is compared against traditional machine learning models (SVM, Naïve Bayes) and deep learning architectures (CNN) to demonstrate its effectiveness in aspect-based sentiment classification. (3) Finally, we analyze the challenges of ABSA in Hausa, including data imbalance and linguistic complexities, and discuss potential improvements for low-resource sentiment analysis.
The rest of this paper is structured as follows: Section 2 provides an overview of existing research on sentiment analysis, aspect-based sentiment analysis (ABSA), and transformer-based models, with a focus on their applications to low-resource languages. Section 3 details the dataset collection and preprocessing, the architecture of our proposed HauBERT model, and the experimental setup used for training and evaluation. Section 4 presents the performance evaluation of HauBERT, comparing it with traditional machine learning and deep learning approaches. Section 5 interprets the experimental findings, highlights the implications of our work, summarizes our key contributions, and discusses directions for further improvements in ABSA for low-resource languages.

2. Literature Review

ABSA aims to detect sentiment in specific “aspects” within a text rather than assigning a general sentiment to the entire text [9]. Traditional ABSA methods often rely on supervised learning techniques, such as Support Vector Machines (SVMs) and Logistic Regression [10], which utilize manually crafted features for sentiment detection [11]. Although these methods have demonstrated effectiveness, they encounter limitations in addressing complex sentiment expressions and contextual nuances [12]. Furthermore, these approaches struggle to capture contextual relationships in a long sequence of texts, resulting in inaccurate outcomes when applied to long reviews [13].
More recent ABSA research has moved towards deep learning, leveraging architectures like convolutional neural networks (CNNs) and recurrent neural networks (RNNs) to capture richer, context-sensitive features [14,15,16,17]. For example, Ma et al. [18] introduced an LSTM-based model for ABSA, which captures long-term dependencies between words, enabling better performance in complex sentiment scenarios. Nevertheless, RNNs struggle with computational efficiency and scalability, leading researchers to explore more robust and context-aware models [18].
Studies such as [19] have shown that BERT’s attention mechanisms improve ABSA by enabling models to focus on sentiment-laden aspects, enhancing accuracy and generalization. Despite these advancements, ABSA studies using transformers remain predominantly focused on high-resource languages, with limited attention to low-resource languages [19].
Sentiment analysis has been applied across various domains, including hotels, airlines, healthcare, and the stock market [20]. In the hotel industry, sentiment analysis helps to gain insights into customer preferences and dislikes. In comparison, Ref. [21] employed sentiment analysis to detect trends in the stock market and cryptocurrencies based on market sentiment. Alsaeed [22] analyzed tweets across different domains to assess their sentiments. Recently, the healthcare sector has experienced a surge in the application of sentiment analysis, particularly in customer opinion analysis [23,24,25,26] and customer satisfaction analysis [27,28]. The business sector has consistently leveraged sentiment analysis to enhance its operations.

2.1. Transformer Models in NLP

Transformer models, particularly BERT (Bidirectional Encoder Representations from Transformers), have revolutionized NLP by introducing self-attention mechanisms that allow models to capture the context in a bidirectional manner [29,30]. These models have achieved state-of-the-art results across a wide range of NLP tasks, including sentiment analysis, text classification, and question answering, and have paved the way for specialized ABSA applications.
Yuliant et al. [31] demonstrate how a pre-trained model can be adopted for ABSA tasks with few computational resources or datasets by proposing a transformer-based model pre-trained on the Indonesian language, which has since been effectively utilized for ABSA tasks. Three models were explored: a feature-based model with a CNN, a fine-tuned single-sentence classification model, and a fine-tuned sentence-pair classification model. The sentence-pair classification model showed the highest effectiveness, improving F-1 scores significantly over baseline models [31].
BERT [32,33] and its variants have revolutionized NLP by enabling models to learn context-dependent representations of language, resulting in state-of-the-art performance in many NLP tasks, including ABSA. These models, however, require large amounts of data for training, which poses a challenge for low-resource languages like Hausa. As such, existing models often fall short when applied to Hausa texts due to the unique linguistic characteristics of the language, including its rich morphological structure and syntactic conventions. These characteristics, coupled with culturally specific expressions, render it difficult to transfer models trained on high-resource languages directly to Hausa with satisfactory results [5]. Additionally, there is limited research specifically focused on the nuances of sentiment expression in Hausa, especially for domain-specific applications like movie reviews.
Following BERT’s success, multiple variants have been developed, such as RoBERTa [34] and DistilBERT [35], which improve upon BERT’s architecture and training strategies. These models, however, rely on large amounts of high-quality text data for pre-training, making them challenging to apply in low-resource language contexts. For low-resource settings, multilingual models like mBERT and XLM-R [36] have provided a solution, enabling cross-lingual transfer learning by training on a mixture of languages. However, while these models support over 100 languages, they lack the depth of training and linguistic adaptability required for languages with unique syntactic and morphological features, such as Hausa.
One solution to this limitation is fine-tuning multilingual transformers on domain-specific or language-specific data. Emezue and Dossou [37] successfully fine-tuned mBERT on six African languages for machine translation and [38] fine-tuned mBERT on Swahili for social media sentiment analysis, demonstrating the feasibility of adapting transformers to low-resource languages. Similarly, Ref. [39] examined the potential of leveraging transfer learning to address data scarcity, highlighting that multilingual transformers can serve as a foundation for adapting models to new languages [39]. HauBERT builds on these findings by fine-tuning a multilingual transformer to capture sentiment across specific aspects in Hausa-language movie reviews, representing an adaptation of transformer models for a unique language context.

2.2. NLP for Low-Resource Languages

Research on NLP for low-resource languages increasingly focuses on building resources, datasets, and methodologies that are accessible and effective for languages with limited digital text resources [40]. Despite their high number of speakers, African languages are often regarded as low-resource due to insufficient labelled data, pre-trained language models, and digital corpora [41]. Hausa, a widely spoken language in West Africa, faces these challenges, limiting the development of models that can accurately capture its linguistic and cultural nuances [42].
Efforts to support NLP for African languages include the creation of African multilingual datasets and frameworks, such as MasakhaNER, a named entity recognition dataset for several African languages [43]. These initiatives provide foundational resources that enable the adaptation of NLP models to African languages, yet sentiment analysis, and ABSA in particular, remain underexplored. Recent studies have attempted to address these gaps. Also, Ref. [44] investigated transfer learning techniques for low-resource African languages, concluding that language-specific fine-tuning can significantly enhance model performance [44]. Oladipo explored the sociocultural challenges of adapting NLP to African languages, emphasizing the need for culturally relevant sentiment datasets [45,46].
In the context of sentiment analysis, studies like [47] developed a Swahili sentiment analysis model for social media, but such models are still rare for Hausa. Furthermore, ABSA for Hausa poses unique challenges due to linguistic characteristics like noun class systems, vowel harmony, and complex morphology, which demand a nuanced approach to model design [48]. Hauwe is a Hausa word embedding model based on the word2vec architecture, designed to improve NLP tasks for Hausa by capturing semantic and syntactic relationships between words. Given the scarcity of Hausa-specific NLP resources, Hauwe provides pre-trained word vectors that facilitate downstream tasks such as text classification, named entity recognition, and sentiment analysis. Unlike multilingual embeddings, which often fail to capture the linguistic nuances of low-resource languages, Hauwe is trained on Hausa text corpora, ensuring better contextual representations [49].
Integrating Hauwe with transformer-based models like mBERT can further improve performance by enriching input embeddings with domain-specific knowledge, addressing limitations posed by low-resource language constraints. Therefore, HauBERT leverages both Hauwe and mBERT to focus on Hausa’s unique linguistic features and by targeting ABSA in a culturally relevant domain of movie reviews where sentiment expression often carries distinct cultural meanings and contextual dependencies.
This review of the literature shows that while significant progress has been made in ABSA [50] and transformer-based NLP [51,52,53], there is limited work specifically targeting low-resource languages like Hausa. Existing ABSA models are ill suited for the unique linguistic and cultural challenges presented by Hausa, and multilingual transformers, though helpful, often lack the domain-specific fine-tuning necessary for accurate ABSA. This study fills a critical gap by developing HauBERT, a specialized transformer model fine-tuned for Hausa movie reviews. By creating a dataset of annotated Hausa movie reviews and evaluating HauBERT against baseline models, this research contributes to the development of ABSA models tailored for underrepresented languages, providing insights that could extend to other low-resource languages.

3. Methodology

Our approach to ABSA in Hausa movie reviews involves a transformer-based model for aspect and polarity classification. This Methodology section describes in detail the dataset preparation, preprocessing, model design, training, and evaluation. Each step is carefully tailored to maximize the model’s effectiveness in analyzing sentiment in an underrepresented language.

3.1. Dataset Description

The dataset used in this research contains movie comments written in the Hausa language. The dataset was collected and organized using web scrapping tools. We scrapped comments from several Hausa movie streaming sites. The dataset contains a total of 1651 comments. These comments were made on different aspects of movies, such as actors/actresses, story/plot, cinematography, and so on. This can be visualized using word frequency mapping, as presented in Figure 2.

3.2. Dataset Preprocessing and Preparation

Each text review was tokenized using an Autotokenzer from transformers and transformed into a vector using the Hausa version of word2vec referred to as hauwe [49]. Aspect terms are processed into vectors using beginning–inside–outside (BIO) tagging and tokenization techniques, while their corresponding sentiment polarities are transformed using one-hot encoding compatible with the input structure required by the transformer.

Dataset Preparation

Data Splits: The processed Hausa ABSA dataset was divided into three sets: The Training Set (70% of the data) used to train the model. The Validation Set (15% of the data) used for hyperparameter tuning and early stopping. The Test Set (15% of the data) used to evaluate the model’s final performance.

3.3. Proposed Model

To capture the complexity of ABSA in Hausa, we present an architectural framework of the proposed transformer-based model architecture in Figure 3. The model leverages self-attention to capture contextual relationships across aspect terms and their associated sentiments. We used a pre-trained transformer model as the Backbone model, and then fine-tuned this model for the ABSA task. To transform the Hausa text, we used an mBERT variant for Hausa language modeling, with adaptations to ensure compatibility with Hausa linguistic patterns. Two classification heads were added to the transformer model. Aspect Classification Head: This layer identifies the aspect terms within each review. The output is a probability distribution over predefined aspect categories. Sentiment Classification Head: This layer predicts the sentiment polarity associated with each identified aspect, classifying each into positive, negative, or neutral. Attention Mechanism: To enhance the model’s focus on relevant aspect terms, we incorporated additional attention mechanisms in the classification heads, enabling more accurate aspect–word prediction.
This architecture combines the robust contextual understanding of transformers with task-specific attention and classification heads to address the dual goals of aspect extraction and sentiment polarity classification in ABSA tasks for the Hausa language.
To optimize for both aspect extraction and sentiment classification tasks simultaneously, we use a multi-task loss function:
  • Cross-Entropy Loss for Aspect Classification: Computes the loss between the predicted aspect labels and the true labels, encouraging accurate aspect term detection.
  • Cross-Entropy Loss for Sentiment Polarity Classification: Calculates the loss for sentiment polarity classification, driving the model to assign correct sentiment polarities to each aspect. The combined loss function is defined as follows:
    L aspect = i = 1 N y i aspect log ( p i aspect ) + ( 1 y i aspect ) log ( 1 p i aspect )
    L Sentiment = i = 1 N y i polarity log ( p i polarity ) + ( 1 y i polarity ) log ( 1 p i polarity )
    Total Loss = α × L aspect + β × L Sentiment
    where α and β are the weights for the aspect and sentiment losses, respectively.
  • y i aspect —The ground truth binary label for the i-th training example, where
  • y i aspect = 1 if an aspect is present.
  • y i aspect = 0 if an aspect is absent.
  • p i aspect —The predicted probability of the presence of an aspect for the i-th instance.
  • N—The total number of training examples.
  • L —Represents the binary cross-entropy loss, which measures how well the model’s predicted probabilities match the actual labels.
The model formulation is a detailed process that specifies the necessary inputs, including the dataset, model, optimizer, number of epochs, batch size, and loss function. The procedure involves initializing the model, shuffling the dataset, and unpacking batches for processing. This process is explained better in Algorithm 1.
The training begins with a task-specific adjustment, where mBERT is initialized using pre-trained weights, and a classification head designed specifically for ABSA is added. The inputs consist of Hausa-language sentences that are tokenized into ‘input_ids’ and attention_mask, ensuring the model processes them effectively. The loss function is computed by comparing the model’s predictions with the actual aspect labels, facilitating the model’s learning process. During each epoch, accuracy, which is crucial for evaluating ABSA tasks, is tracked. The training flow proceeds in iterative cycles, where each batch undergoes forward propagation to make predictions, followed by loss computation, backpropagation for error correction, and updates to the model parameters to improve performance with each iteration.
Algorithm 1 Fine-Tuning mBERT for ABSA in Hausa Language
Require: Preprocessed dataset D with inputs in Hausa; pre-trained mBERT model M ; optimizer O ; number of epochs E; batch size B; and loss function L .
  1:
Initialize mBERT model M with pre-trained weights.
  2:
Add a task-specific classification head to M for ABSA.
  3:
Split dataset D into training and validation sets.
  4:
Divide the training set into batches of size B.
  5:
for epoch e = 1 to E do
  6:
   Shuffle the training dataset.
  7:
   for each batch ( X , y ) in the training set do
  8:
     Unpack the batch:
  9:
         Input IDs X ids , attention mask X mask , and labels y .
10:
     Transfer the batch to the computation device (e.g., GPU or CPU).
11:
     Zero the gradients of O .
12:
     Compute predictions y ^ using mBERT:
13:
         y ^ = M ( X ids , X mask ) .
14:
     Compute loss :
15:
         = L ( y ^ , y ) .
16:
     Perform backpropagation to compute gradients:
17:
         θ .
18:
     Update model parameters using the optimizer:
19:
         θ θ O ( θ ) .
20:
   end for
21:
   Evaluate the model on the validation set to compute metrics such as accuracy and F1-score.
22:
end for
23:
Return the fine-tuned mBERT model M .
Table 1 presents five examples of Hausa-language sentences along with their corresponding tokenized representations, including input_ids and attention_mask. The input_ids represent the numerical token IDs assigned by the tokenizer, where [101] and [102] denote the special classification and separation tokens, respectively. The attention_mask indicates which tokens are actual inputs (1) and which are padding tokens (0), ensuring that the model processes only relevant tokens while ignoring padding. In cases where the sentence length is shorter than the maximum sequence length, padding tokens (0) are appended at the end of the input_ids, with corresponding 0s in the attention_mask. This structured tokenization ensures uniform input dimensions, which is essential for batch processing in transformer-based models like HauBERT. The table highlights how different Hausa sentences are preprocessed before being fed into the model, ensuring that the contextual representation of each token is preserved for effective aspect-based sentiment analysis.

4. Results

This section presents the evaluation results of the HauBERT model for ABSA in Hausa-language movie reviews. We assess the model’s performance on two key tasks: aspect extraction and sentiment polarity classification. The effectiveness of HauBERT is compared against traditional machine learning models (SVM, Naïve Bayes) and deep learning approaches (CNN), demonstrating its superiority in handling sentiment analysis for a low-resource language. Performance metrics such as accuracy, precision, recall, F1-score, and AUC-ROC are reported to provide a comprehensive evaluation. Additionally, we analyze the impact of data preprocessing, tokenization, and fine-tuning strategies on the model’s effectiveness. The following subsections detail the quantitative results, comparison with baseline models, and insights drawn from the findings.

4.1. Exploratory Data Analysis

To gain insights into our dataset, we conducted an exploratory data analysis (EDA) to examine its structure, distribution, and characteristics. The dataset, designed for Aspect-Based Sentiment Analysis (ABSA) in the Hausa language, contains annotated sentences with aspect terms and corresponding sentiment labels. The analysis revealed an imbalanced representation of positive, negative, and neutral sentiments, which may affect model performance. This problem can be visualized in Figure 4a,c. To ensure the robustness of fine-tuning pre-trained models, the dataset needs to be balanced for each class. The average sentence length and the distribution of aspect terms were analyzed as shown in Figure 4b,d, highlighting the linguistic nuances of the Hausa language, such as compound word formations and tone markers. Additionally, the dataset’s BIO tagging structure facilitated a detailed examination of aspect term coverage, ensuring alignment with real-world usage scenarios. This comprehensive EDA informed preprocessing steps and guided model fine-tuning strategies.

4.2. Experimental Setup and Evaluation Metric

The experimental setup used in this study to implement the proposed model involved a series of procedures to prepare, train, and evaluate the transformer-based model on the Hausa ABSA dataset.
The experiments were conducted on a high-performance computing setup equipped with NVIDIA GPUs (Tesla V100 or A100) to accelerate the transformer model’s training and inference times. Specifically, we conducted model training and evaluation on a high-performance computing setup equipped with an NVIDIA Tesla V100 GPU (32 GB VRAM) and 128 GB RAM. The experiments were implemented using Python 3.8 and PyTorch 1.12.1, with the Hugging Face transformers library (version 4.26.1) for model fine-tuning. Additional dependencies include NLTK (3.6.7) for text preprocessing and scikit-learn (1.0.2) for evaluation metrics.
The proposed model is evaluated on both aspect term extraction and sentiment polarity classification. Key metrics include the following:
  • Aspect Extraction Accuracy: Calculated as the percentage of correctly identified aspect terms.
    Aspect _ Accuracy = T r u e P o s t i v e + T r u e N e g a t i v e T r u e P o s i t i v e + T r u e N e g a t i v e + F a l s e P o s i t i v e + F a l s e N e g a i v e
  • Sentiment Polarity Accuracy: Measured as the percentage of correct sentiment predictions for each aspect.
    Sentiment _ Accuracy = T r u e P o s i t i v e s + T r u e N e g a t i v e s T r u e P o s i t i v e + T r u e N e g a t i v e + F a l s e P o s i t i v e + F a l s e N e g a i v e
    Precision = T r u e P o s t i v e T r u e P o s t i v e + F a l s e P o s t i v e
    Recall = T r u e P o s i t i v e T r u e P o s i t i v e + F a l s e N e g a t i v e
  • F1-Score: F1-scores were computed to assess precision and recall for each category in both aspect and sentiment classification tasks.
    F 1 - Score = 2 · Precision · Recall Precision + Recall
For aspect extraction and sentiment polarity classification, these terms are defined as follows:
  • True Positive (TP): The model correctly identifies an aspect or assigns the correct sentiment polarity.
    Example: If the model correctly predicts that “cinematography” is an aspect and assigns it a positive sentiment, this is a TP.
  • False Positive (FP): The model incorrectly identifies an aspect or assigns a sentiment when it should not.
    Example: If the model wrongly predicts “dialogue” as an aspect when it is not annotated as such, this is an FP.
  • True Negative (TN): The model correctly ignores a non-aspect term or correctly classifies a sentiment as neutral/absent.
    Example: If the model does not assign a sentiment label to a word that is not relevant to sentiment analysis, this is a TN.
  • False Negative (FN): The model fails to identify an actual aspect or assigns an incorrect sentiment polarity.
    Example: If the model fails to detect “acting” as an aspect when it is actually present in the dataset, this is an FN.
The proposed transformer-based model is compared with traditional machine learning approaches, such as SVM and Naive Bayes classifiers, and a deep learning architecture such as CNN, to highlight the impact of the transformers and attention mechanism on the ABSA task.
The evaluation results demonstrate the performance of the proposed model for aspect-based sentiment analysis. In the first experiment for aspect extraction, the model achieves outstanding performance with a remarkable accuracy of 1.00, precision of 0.99, recall of 0.99, and F1-score of 0.99 across all aspect classes, indicating its effectiveness in extracting aspects from sequences of sentence dataset. This is because of the attention layer allows the model to focus on the important part of the sentence. However, in the second experiment, for sentiment classification, the model achieves an overall accuracy of 0.9281, a precision of 0.9479, a recall of 0.9281, and an F1-score of 0.9082, respectively. The per-class evaluation shows that the model performs well for class 1 (precision: 0.85, recall: 0.96, F1-score: 0.76) but struggles with classes 0 and 2 due to their smaller representation in the dataset. This reflects the challenges associated with imbalanced data. These results highlight the model’s robustness to perform both aspect extraction and sentiment classification, and the overall performance is presented in Table 2.
To visualize the performance of the HuaBERT model during training, the accuracy and loss curves are presented in Figure 5a and Figure 5b, respectively, showcasing the model’s progression in learning over epochs. These curves highlight the balance between minimizing error and improving predictive accuracy as the training progresses. Additionally, the AUC-ROC curve, depicted in Figure 5c, illustrates the model’s classification performance by plotting the true positive rate against the false positive rate. This provides a comprehensive evaluation of the model’s ability to distinguish between classes, offering deeper insights into its robustness and predictive reliability.
To better validate the HauBERT model, we compare its performance with traditional machine learning (ML) and deep learning techniques.
The results of the performance comparison between HauBERT and traditional models for ABSA presented in Table 3 highlight the superior capabilities of HauBERT. With an accuracy of 0.92, precision of 0.94, recall of 0.92, and F1-score of 0.90, HauBERT outperforms all other models across all metrics. Additionally, its AUC score of 0.90 demonstrates its robust ability to differentiate between classes. Among the baseline models, CNN achieved competitive results, with an accuracy of 0.91 and an AUC score of 0.90, but fell slightly short in precision and recall. Traditional machine learning models, including SVM, Random Forest, and Naive Bayes, showed significantly lower performance, with accuracies ranging from 0.64 to 0.70 and AUC scores between 0.66 and 0.67. These results emphasize the advantage of transformer-based architectures like HauBERT in handling complex language tasks, particularly for underrepresented languages like Hausa.
Table 4 provides a performance comparison of our proposed model with existing ABSA models. It is evident that our model outperforms the baseline models in terms of accuracy, precision, and recall. This improvement can be attributed to the incorporation of a hierarchical attention mechanism that effectively captures sentiment information at both the word and sentence levels. Additionally, the utilization of a pre-trained mBERT model provides strong contextual understanding, further enhancing the performance.
While our model demonstrates significant improvement, there is still room for further refinement. Future work could explore incorporating more advanced attention mechanisms, fine-tuning the pre-trained language model, and investigating the impact of incorporating external knowledge sources.

5. Discussion

The experimental results demonstrate the robust performance of HauBERT in the domain of ABSA for the Hausa language. HauBERT consistently achieves superior results across various metrics when compared to baseline models, validating its effectiveness as a transformer-based solution.
The ROC curves for sentiment classification across three classes reveal strong predictive capabilities, as evidenced by AUC scores of 0.7138, 0.7900, and 0.9003 for class 0, class 1, and class 2, respectively. These results indicate HauBERT’s ability to effectively distinguish between sentiment classes, particularly excelling in detecting the positive sentiment class (class 2) with an AUC of 0.9003.
The training and test loss and accuracy curves provide insights into the optimization process of the model. The training loss exhibits a smooth convergence pattern, stabilizing at near-zero levels, while the training accuracy approaches 1.0, indicating excellent learning of the training data. The test loss, although higher than the training loss, stabilizes after initial fluctuations, and the test accuracy shows consistent improvement over epochs. This pattern reflects a balance between generalization and overfitting, underscoring the effectiveness of the training strategy.
Table 3 highlights the comparative performance of HauBERT with other state-of-the-art ABSA models. HauBERT achieves an accuracy of 92.81%, surpassing most existing models except Bengla-BERT, which records a marginally higher accuracy of 94.15%. However, HauBERT demonstrates competitive precision (94.79%) and recall (92.81%), with an F1-score of 90.82%, showcasing balanced performance across all metrics. Moreover, HauBERT achieves an AUC score of 0.9002, underscoring its ability to handle sentiment classification tasks effectively.
The enhanced performance of HauBERT can be attributed to its ability to leverage the multilingual pre-training of mBERT while fine-tuning for domain-specific tasks. Despite being a low-resource language, Hausa benefits significantly from the transfer learning capabilities of mBERT. While baseline models such as SVM, Random Forest, and Naïve Bayes struggle with precision and recall, HauBERT outperforms them by a substantial margin, demonstrating the importance of utilizing transformer-based architectures for ABSA tasks.
Although HauBERT demonstrates strong results, further optimization might reduce the test loss and enhance generalization performance. Additionally, fine-tuning specific hyperparameters or incorporating domain-specific pre-training data could further improve model performance. Future work may also focus on extending the model to other low-resource languages to evaluate its cross-lingual adaptability.
The results of our study demonstrate that HauBERT is an effective model for Aspect-Based Sentiment Analysis (ABSA) in Hausa-language movie reviews, with potential applications across various domains. In the entertainment industry, HauBERT can be used to automate sentiment analysis of audience feedback, helping filmmakers and streaming platforms understand viewer preferences and improve content recommendations. Additionally, businesses and organizations can leverage HauBERT for customer feedback analysis, allowing them to extract fine-grained insights from Hausa-language reviews on products and services. In the broader context of social media monitoring, HauBERT can be deployed to track public sentiment on key issues, aiding policymakers and brands in making data-driven decisions. Furthermore, the model’s ability to process aspect-based sentiment makes it useful for journalistic analysis, where media organizations can assess audience reactions to news and entertainment content. Although our study focuses on movie reviews, the scalability of HauBERT suggests that it could be adapted for other domains, including healthcare, politics, and finance, by fine-tuning on domain-specific datasets.

6. Conclusions

This study introduced HauBERT, a transformer-based model for Aspect-Based Sentiment Analysis (ABSA) in Hausa-language movie reviews, addressing the challenges of sentiment analysis in low-resource languages. We began by highlighting the importance of ABSA, its advantages over traditional sentiment analysis, and the lack of NLP resources for the Hausa language. The proposed HauBERT model was fine-tuned on a curated Hausa ABSA dataset, leveraging a pre-trained multilingual BERT model for aspect extraction and sentiment polarity classification. Through extensive experimentation, HauBERT demonstrated superior performance compared to traditional machine learning and deep learning baselines, achieving high accuracy and robust classification results. Our findings suggest that transformer-based models can effectively adapt to low-resource languages, provided that proper fine-tuning and domain-specific datasets are available. In practical applications, HauBERT can enhance automated sentiment analysis in Hausa for movie reviews, social media monitoring, and customer feedback analysis. Future work will focus on expanding the dataset, improving generalization to other domains, and optimizing model efficiency for deployment in real-world systems.

Author Contributions

Conceptualization, A.Y.Z.; methodology, F.M.A.; data curation, A.M., F.M.A. and U.I.; writing—original draft preparation, A.M.; writing—review and editing, U.I. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data used in this research can be found on GitHub alongside the model: https://github.com/El-amin/HauwBert-A-Transformer-Based-Model-For-Aspect-Based-Sentiment-Analysis-ABSA- (accessed on 18 December 2024).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Abdulrashid, I.; Ahmad, I.S.; Musa, A.; Khalafalla, M. Impact of social media posts’ characteristics on movie performance prior to release: An explainable machine learning approach. Electron. Commer. Res. 2024. [Google Scholar] [CrossRef]
  2. Kuznetsov, I.; Afzal, O.M.; Dercksen, K.; Dycke, N.; Goldberg, A.; Hope, T.; Hovy, D.; Kummerfeld, J.K.; Lauscher, A.; Leyton-Brown, K.; et al. What can natural language processing do for peer review? arXiv 2024, arXiv:2405.06563. [Google Scholar]
  3. Medhat, W.; Hassan, A.; Korashy, H. Sentiment analysis algorithms and applications: A survey. Ain Shams Eng. J. 2014, 5, 1093–1113. [Google Scholar] [CrossRef]
  4. Wankhade, M.; Rao, A.C.S.; Kulkarni, C. A survey on sentiment analysis methods, applications, and challenges. Artif. Intell. Rev. 2022, 55, 5731–5780. [Google Scholar] [CrossRef]
  5. Ibrahim, U.; Zandam, A.Y.; Adam, F.M.; Musa, A. A Deep Convolutional Neural Network-based Model for Aspect and Polarity Classification in Hausa Movie Reviews. arXiv 2024, arXiv:2405.19575. [Google Scholar]
  6. Sultana, N.; Sultana, R.; Rasel, R.I.; Hoque, M.M. Aspect-based sentiment analysis of bangla comments on entertainment domain. In Proceedings of the 2022 25th International Conference on Computer and Information Technology (ICCIT), Cox’s Bazar, Bangladesh, 17–19 December 2022; pp. 953–958. [Google Scholar]
  7. Baid, P.; Gupta, A.; Chaplot, N. Sentiment analysis of movie reviews using machine learning techniques. Int. J. Comput. Appl. 2017, 179, 45–49. [Google Scholar] [CrossRef]
  8. Schuh, R. Hausa Language Variation and Dialects; University of California: Los Angeles, CA, USA, 2024. [Google Scholar]
  9. Schouten, K.; Frasincar, F. Survey on aspect-level sentiment analysis. IEEE Trans. Knowl. Data Eng. 2015, 28, 813–830. [Google Scholar] [CrossRef]
  10. Vanaja, S.; Belwal, M. Aspect-level sentiment analysis on e-commerce data. In Proceedings of the 2018 International Conference on Inventive Research in Computing Applications (ICIRCA), Coimbatore, India, 11–12 July 2018; pp. 1275–1279. [Google Scholar]
  11. Siddiqua, A.; Bindumathi, V.; Raghu, G.; Bhargav, Y. Aspect-based Sentiment Analysis (ABSA) using Machine Learning Algorithms. In Proceedings of the 2024 Third International Conference on Distributed Computing and Electrical Circuits and Electronics (ICDCECE), Ballari, India, 26–27 April 2024. [Google Scholar] [CrossRef]
  12. Nandal, N.; Tanwar, R.; Pruthi, J. Machine learning based aspect level sentiment analysis for Amazon products. Spat. Inf. Res. 2020, 28, 601–607. [Google Scholar] [CrossRef]
  13. Pontiki, M.; Galanis, D.; Papageorgiou, H.; Androutsopoulos, I.; Manandhar, S.; Al-Smadi, M.; Al-Ayyoub, M.; Zhao, Y.; Qin, B.; De Clercq, O.; et al. Semeval-2016 task 5: Aspect based sentiment analysis. In Proceedings of the International Workshop on Semantic Evaluation, San Diego, CA, USA, 16–17 June 2016; pp. 19–30. [Google Scholar]
  14. Regi, A.E.; Leelipushpam, G.J. Enhancing Aspect Based Sentiment Analysis Using BERT and Capsule Networks. In Proceedings of the 2024 2nd International Conference on Device Intelligence, Computing and Communication Technologies (DICCT), Dehradun, India, 15–16 March 2024. [Google Scholar] [CrossRef]
  15. Bharathi, R.; Bhavani, R.; Priya, R. Leveraging Deep Learning Models for Automated Aspect Based Sentiment Analysis and Classification. SSRG Int. J. Electr. Electron. Eng. 2023, 10, 120–130. [Google Scholar]
  16. Vinitha, V.; Bargavi, S.M. A Intensified Approach on Aspect Based Sentiment Analysis Using Pre-Trained Deep Learning Model. In Proceedings of the 2024 International Conference on Recent Advances in Electrical, Electronics, Ubiquitous Communication, and Computational Intelligence (RAEEUCCI), Chennai, India, 17–18 April 2024; pp. 1–5. [Google Scholar]
  17. Kumar, D.; Gupta, A.; Gupta, V.K.; Gupta, A. Aspect-Based Sentiment Analysis using Machine Learning and Deep Learning Approaches. Int. J. Recent Innov. Trends Comput. Commun. 2023, 11, 118–138. [Google Scholar] [CrossRef]
  18. Ma, Y.; Peng, H.; Cambria, E. Targeted aspect-based sentiment analysis via embedding commonsense knowledge into an attentive LSTM. In Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–7 February 2018; Volume 32. [Google Scholar]
  19. Sun, C.; Huang, L.; Qiu, X. Utilizing BERT for aspect-based sentiment analysis via constructing auxiliary sentence. arXiv 2019, arXiv:1903.09588. [Google Scholar]
  20. Zvarevashe, K.; Olugbara, O.O. Gender voice recognition using random forest recursive feature elimination with gradient boosting machines. In Proceedings of the 2018 International Conference on Advances in Big Data, Computing and Data Communication Systems (icABCD), Durban, South Africa, 6–7 August 2018; pp. 1–6. [Google Scholar]
  21. Ramírez-Tinoco, F.J.; Alor-Hernández, G.; Sánchez-Cervantes, J.L.; Salas-Zárate, M.d.P.; Valencia-García, R. Use of sentiment analysis techniques in healthcare domain. In Current Trends in Semantic Web Technologies: Theory and Practice; Springer: Berlin/Heidelberg, Germany, 2019; pp. 189–212. [Google Scholar]
  22. Alsaeedi, A.; Khan, M.Z. A study on sentiment analysis techniques of Twitter data. Int. J. Adv. Comput. Sci. Appl. 2019, 10, 361–374. [Google Scholar] [CrossRef]
  23. Fei, Z.; Yang, E.; Li, D.D.U.; Butler, S.; Ijomah, W.; Li, X.; Zhou, H. Deep convolution network based emotion analysis towards mental health care. Neurocomputing 2020, 388, 212–227. [Google Scholar] [CrossRef]
  24. Park, E.; Kang, J.; Choi, D.; Han, J. Understanding customers’ hotel revisiting behaviour: A sentiment analysis of online feedback reviews. Curr. Issues Tour. 2020, 23, 605–611. [Google Scholar] [CrossRef]
  25. Cortis, K.; Davis, B. Over a decade of social opinion mining: A systematic review. Artif. Intell. Rev. 2021, 54, 4873–4965. [Google Scholar] [CrossRef]
  26. Arora, A.; Chakraborty, P.; Bhatia, M.; Mittal, P. Role of emotion in excessive use of Twitter during COVID-19 imposed lockdown in India. J. Technol. Behav. Sci. 2021, 6, 370–377. [Google Scholar] [CrossRef] [PubMed]
  27. Bashar, M.A.; Nayak, R.; Balasubramaniam, T. Deep learning based topic and sentiment analysis: COVID19 information seeking on social media. Soc. Netw. Anal. Min. 2022, 12, 90. [Google Scholar] [CrossRef]
  28. Chaturvedi, S.; Mishra, V.; Mishra, N. Sentiment analysis using machine learning for business intelligence. In Proceedings of the 2017 IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI), Chennai, India, 21–22 September 2017; pp. 2162–2166. [Google Scholar]
  29. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need (NIPS 2017). arXiv 2017, arXiv:1706.03762. [Google Scholar]
  30. Huang, Z.; Xu, P.; Liang, D.; Mishra, A.; Xiang, B. TRANS-BLSTM: Transformer with bidirectional LSTM for language understanding. arXiv 2020, arXiv:2003.07000. [Google Scholar]
  31. Yulianti, E.; Nissa, N.K. ABSA of Indonesian customer reviews using IndoBERT: Single-sentence and sentence-pair classification approaches. Bull. Electr. Eng. Inform. 2024, 13, 3579–3589. [Google Scholar] [CrossRef]
  32. Wang, Z.; Mayhew, S.; Roth, D. Extending multilingual BERT to low-resource languages. arXiv 2020, arXiv:2004.13640. [Google Scholar]
  33. Devlin, J.; Chang, M.W.; 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, Minneapolis, MN, USA, 2–7 June 2019; Volume 1, p. 2. [Google Scholar]
  34. Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; Stoyanov, V. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv 2019, arXiv:1907.11692. [Google Scholar]
  35. Sanh, V.; Debut, L.; Chaumond, J.; Wolf, T. DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. arXiv 2019, arXiv:1910.01108. [Google Scholar]
  36. Conneau, A.; Khandelwal, K.; Goyal, N.; Chaudhary, V.; Wenzek, G.; Guzmán, F.; Grave, E.; Ott, M.; Zettlemoyer, L.; Stoyanov, V. Unsupervised Cross-lingual Representation Learning at Scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Online, 5–10 July 2020; pp. 8440–8451. [Google Scholar] [CrossRef]
  37. Emezue, C.C.; Dossou, B.F. MMTAfrica: Multilingual machine translation for African languages. arXiv 2022, arXiv:2204.04306. [Google Scholar]
  38. Tonja, A.L.; Dossou, B.F.P.; Ojo, J.; Rajab, J.; Thior, F.; Wairagala, E.P.; Aremu, A.; Moiloa, P.; Abbott, J.; Marivate, V.; et al. InkubaLM: A small language model for low-resource African languages. arXiv 2024, arXiv:2408.17024. [Google Scholar]
  39. Agic, Ž.; Vulic, I. JW300: A Wide-Coverage Parallel Corpus for Low-Resource Languages; Association for Computational Linguistics: Stroudsburg, PA, USA, 2019. [Google Scholar]
  40. da Rocha Junqueira, J.; Lopes, É.; Freitas, L.; Correa, U.B. A Systematic Analysis of Multilingual and Low-Resource Languages Models: A Review on Brazilian Portuguese. In Proceedings of the AMCIS 2024 Proceedings, Salt Lake City, UT, USA, 15–17 August 2024. [Google Scholar]
  41. Nekoto, W.; Marivate, V.; Matsila, T.; Fasubaa, T.; Kolawole, T.; Fagbohungbe, T.; Akinola, S.O.; Muhammad, S.H.; Kabongo, S.; Osei, S.; et al. Participatory research for low-resourced machine translation: A case study in african languages. arXiv 2020, arXiv:2010.02353. [Google Scholar]
  42. Leong, C.; Shandilya, H.; Dossou, B.F.; Tonja, A.L.; Mathew, J.; Omotayo, A.H.; Yousuf, O.; Akinjobi, Z.; Emezue, C.C.; Muhammad, S.; et al. Adapting to the low-resource double-bind: Investigating low-compute methods on low-resource African languages. arXiv 2023, arXiv:2303.16985. [Google Scholar]
  43. Adelani, D.I.; Abbott, J.; Neubig, G.; D’souza, D.; Kreutzer, J.; Lignos, C.; Palen-Michel, C.; Buzaaba, H.; Rijhwani, S.; Ruder, S.; et al. MasakhaNER: Named entity recognition for African languages. Trans. Assoc. Comput. Linguist. 2021, 9, 1116–1131. [Google Scholar] [CrossRef]
  44. Hedderich, M.A. Weak Supervision and Label Noise Handling for Natural Language Processing in Low-Resource Scenarios. Ph.D. Thesis, Saarland University, Saarland, Germany, 2022. [Google Scholar] [CrossRef]
  45. Oladipo, A.; Ogundepo, O.; Ogueji, K.; Lin, J. An exploration of vocabulary size and transfer effects in multilingual language models for African languages. In Proceedings of the 3rd Workshop on African Natural Language Processing, Virtual Event, 13–16 October 2022. [Google Scholar]
  46. Alabi, J.O.; Adelani, D.I.; Mosbach, M.; Klakow, D. Adapting pre-trained language models to African languages via multilingual adaptive fine-tuning. arXiv 2022, arXiv:2204.06487. [Google Scholar]
  47. Martin, G.L.; Mswahili, M.E.; Jeong, Y.S. Sentiment classification in swahili language using multilingual bert. arXiv 2021, arXiv:2104.09006. [Google Scholar]
  48. Salih Noorain, A.A.; Mohammed Daud, M.D. Semantic Concepts of Hausa Language: An Analytical and Descriptive Study at the Level of Words. Alustath 2023, 62, 386–401. [Google Scholar]
  49. Abdulmumin, I.; Galadanci, B.S. hauwe: Hausa words embedding for natural language processing. In Proceedings of the 2019 2nd International Conference of the IEEE Nigeria Computer Chapter (NigeriaComputConf), Zaria, Nigeria, 14–17 October 2019; pp. 1–6. [Google Scholar]
  50. Denny, P.; Taskova, K.; Wicker, J.; Taskova, K. A Systematic Review of Aspect-based Sentiment Analysis (ABSA): Domains, Methods, and Trends. arXiv 2023, arXiv:2311.10777. [Google Scholar]
  51. Chouikhi, H.; Chniter, H.; Jarray, F. Arabic sentiment analysis using BERT model. In Proceedings of the Advances in Computational Collective Intelligence: 13th International Conference (ICCCI 2021), Kallithea, Greece, 29 September–1 October 2021; Proceedings 13. Springer: Berlin/Heidelberg, Germany, 2021; pp. 621–632. [Google Scholar]
  52. Nguyen, Q.T.; Nguyen, T.L.; Luong, N.H.; Ngo, Q.H. Fine-tuning BERT for sentiment analysis of Vietnamese reviews. In Proceedings of the 2020 7th NAFOSTED Conference on Information and Computer Science (NICS), Ho Chi Minh City, Vietnam, 26–27 November 2020; pp. 302–307. [Google Scholar]
  53. Hoang, M.; Bihorac, O.A.; Rouces, J. Aspect-based sentiment analysis using bert. In Proceedings of the 22nd Nordic Conference on Computational Linguistics, Turku, Finland, 30 September–2 October 2019; pp. 187–196. [Google Scholar]
  54. Prottasha, N.J.; Sami, A.A.; Kowsher, M.; Murad, S.A.; Bairagi, A.K.; Masud, M.; Baz, M. Transfer learning for sentiment analysis using BERT based supervised fine-tuning. Sensors 2022, 22, 4157. [Google Scholar] [CrossRef] [PubMed]
  55. Regatte, Y.R.; Gangula, R.R.R.; Mamidi, R. Dataset Creation and Evaluation of Aspect Based Sentiment Analysis in Telugu, a Low Resource Language. In Proceedings of the Twelfth Language Resources and Evaluation Conference, Marseille, France, 11–16 May 2020; pp. 5017–5024. [Google Scholar]
  56. Chifu, A.G.; Fournier, S. Linguistic features for sentence difficulty prediction in ABSA. arXiv 2024, arXiv:2402.03163. [Google Scholar]
Figure 1. Comparison between Sentiment Analysis (SA) and Aspect-Based Sentiment Analysis (ABSA). The figure highlights how SA only captures the overall sentiment, while ABSA breaks it down by specific aspects.
Figure 1. Comparison between Sentiment Analysis (SA) and Aspect-Based Sentiment Analysis (ABSA). The figure highlights how SA only captures the overall sentiment, while ABSA breaks it down by specific aspects.
Engproc 87 00043 g001
Figure 2. Word frequency map.
Figure 2. Word frequency map.
Engproc 87 00043 g002
Figure 3. Framework for fine-tuning a pre-trained mBERT model for ABSA. The figure explains how a low-resource language can be preprocessed for pre-trained transformer model.
Figure 3. Framework for fine-tuning a pre-trained mBERT model for ABSA. The figure explains how a low-resource language can be preprocessed for pre-trained transformer model.
Engproc 87 00043 g003
Figure 4. Grouped visualization of exploratory data analysis results. The subfigures highlight (a) sentiment distribution, (b) average word length, (c) polarity distribution, and (d) aspect term distribution.
Figure 4. Grouped visualization of exploratory data analysis results. The subfigures highlight (a) sentiment distribution, (b) average word length, (c) polarity distribution, and (d) aspect term distribution.
Engproc 87 00043 g004aEngproc 87 00043 g004b
Figure 5. Accuracy/Loss curve and AUC-ROC curve of the proposed model. The subfigures highlight (a) Accuracy curve, (b) Loss curve, (c) AUC ROC curve.
Figure 5. Accuracy/Loss curve and AUC-ROC curve of the proposed model. The subfigures highlight (a) Accuracy curve, (b) Loss curve, (c) AUC ROC curve.
Engproc 87 00043 g005
Table 1. Examples of tokenized Hausa-language sentences with corresponding input IDs and attention masks.
Table 1. Examples of tokenized Hausa-language sentences with corresponding input IDs and attention masks.
Original Hausa SentenceTokenized input_idsAttention Mask
Fim din yana da kyau.[101, 4035, 2176, 3693, 2099, 102, 0, 0][1, 1, 1, 1, 1, 1, 0, 0]
Labari bai da ma’ana.[101, 6784, 2190, 3693, 102, 0, 0, 0][1, 1, 1, 1, 1, 0, 0, 0]
Yan wasan sun yi kokari.[101, 3157, 2078, 2176, 2099, 102, 0, 0][1, 1, 1, 1, 1, 1, 0, 0]
Sauti yana da matsala.[101, 4321, 2176, 3693, 102, 0, 0][1, 1, 1, 1, 1, 0, 0]
Hoton fim din yana da kyau.[101, 7894, 4035, 2176, 3693, 2099, 102, 0][1, 1, 1, 1, 1, 1, 1, 0]
Table 2. Performance of HauBERT for ABSA in Hausa language movie reviews are cited.
Table 2. Performance of HauBERT for ABSA in Hausa language movie reviews are cited.
ModelAccuracyPrecisionRecallF1-ScoreAUC-Score
HuaBERT Aspect Extraction0.960.930.930.910.94
HauBERT Sentiment model0.92810.94790.92810.90820.9002
Table 3. Performance comparison between HauBERT and traditional ML techniques.
Table 3. Performance comparison between HauBERT and traditional ML techniques.
ModelAccuracyPrecisionRecallF1-ScoreAUC-Score
HauBERT0.920.940.920.900.90
SVM0.640.600.640.520.66
Random Forest0.640.600.640.520.66
Naive Bayes0.700.710.700.670.76
CNN0.910.830.780.880.90
Table 4. Performance comparison with existing ABSA models.
Table 4. Performance comparison with existing ABSA models.
Ref.AccuracyPrecisionRecallF1-ScoreAUC-Score
HauBERT0.92810.94790.92810.90820.9002
Bengla-BERT [54]0.94150.94230.92940.93040.9473
TC-LSTM [55]0.79680.74640.72040.7232-
BERT FINE-TUNED [56]0.82000.82000.81200.8120-
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Musa, A.; Adam, F.M.; Ibrahim, U.; Zandam, A.Y. HauBERT: A Transformer Model for Aspect-Based Sentiment Analysis of Hausa-Language Movie Reviews. Eng. Proc. 2025, 87, 43. https://doi.org/10.3390/engproc2025087043

AMA Style

Musa A, Adam FM, Ibrahim U, Zandam AY. HauBERT: A Transformer Model for Aspect-Based Sentiment Analysis of Hausa-Language Movie Reviews. Engineering Proceedings. 2025; 87(1):43. https://doi.org/10.3390/engproc2025087043

Chicago/Turabian Style

Musa, Aminu, Fatima Muhammad Adam, Umar Ibrahim, and Abubakar Yakubu Zandam. 2025. "HauBERT: A Transformer Model for Aspect-Based Sentiment Analysis of Hausa-Language Movie Reviews" Engineering Proceedings 87, no. 1: 43. https://doi.org/10.3390/engproc2025087043

APA Style

Musa, A., Adam, F. M., Ibrahim, U., & Zandam, A. Y. (2025). HauBERT: A Transformer Model for Aspect-Based Sentiment Analysis of Hausa-Language Movie Reviews. Engineering Proceedings, 87(1), 43. https://doi.org/10.3390/engproc2025087043

Article Metrics

Back to TopTop