Source-linked AI summary
A Combined CNN and LSTM Model for Arabic Sentiment Analysis
Abdulaziz M. Alayba, Vasile Palade, Matthew England, Rahat Iqbal
TL;DR
Arabic Twitter sentiment classification is challenging because Arabic has rich morphology, limited preprocessing tools, and scarce datasets. The paper combines CNNs and LSTMs with multiple sentiment-analysis levels, improving accuracy across Arabic datasets, including Main-AHS and Sub-AHS.
Problem
Arabic sentiment classification faces morphological diversity, limited accurate preprocessing tools, and fewer datasets than English.
Method
The paper combines CNN feature extraction and LSTM sequence modeling while evaluating character, Ch5gram, and word representation levels.
Results
Accuracy reached 0.9424 on Main-AHS and 0.9568 on Sub-AHS, compared with previous results of 0.92 and 0.95, respectively.
Takeaways & Limitations
Word-level and Ch5gram-level representations produced better sentiment classification results than the character-level option.
Takeaways & Limitations
The study uses Arabic sentiment datasets with only positive and negative classes.
Abstract
from arXiv · showhide
Deep neural networks have shown good data modelling capabilities when dealing with challenging and large datasets from a wide range of application areas. Convolutional Neural Networks (CNNs) offer advantages in selecting good features and Long Short-Term Memory (LSTM) networks have proven good abilities of learning sequential data. Both approaches have been reported to provide improved results in areas such image processing, voice recognition, language translation and other Natural Language Processing (NLP) tasks. Sentiment classification for short text messages from Twitter is a challenging task, and the complexity increases for Arabic language sentiment classification tasks because Arabic is a rich language in morphology. In addition, the availability of accurate pre-processing tools for Arabic is another current limitation, along with limited research available in this area. In this paper, we investigate the benefits of integrating CNNs and LSTMs and report obtained improved accuracy for Arabic sentiment analysis on different datasets. Additionally, we seek to consider the morphological diversity of particular Arabic words by using different sentiment classification levels.
1. Introduction
Sentiment analysis of short Arabic texts is challenging because Arabic has rich morphology and limited preprocessing resources. The paper combines CNN and LSTM networks to address Arabic sentiment classification.
- Arabic sentiment classification is difficult because Arabic has rich morphology and accurate preprocessing tools are limited.
- Sentiment analysis commonly involves converting text to numeric representations, extracting features, training classifiers, and estimating test error.
- Prior work by the authors achieved accuracies from 0.85 to 0.91 on Main-AHS using SVM, Naïve Bayes, logistic regression, and CNNs.
- Using a merged lexicon, CNNs, and pretrained Arabic word embeddings increased Main-AHS accuracy to 0.92 and produced 0.87–0.95 accuracy on Sub-AHS.
- The proposed approach combines CNN feature extraction with LSTM learning of sequential data.
2. Background and Related Work
Earlier research applied deep neural networks, SVMs, lexicon methods, and pretrained representations to sentiment analysis, including Arabic datasets and dialects. Arabic sentiment resources remain an active research area involving varied datasets and approaches.
- Deep-learning sentiment research includes CNNs with varied filter sizes and attention-based LSTMs for aspect-level sentiment analysis.
- Arabic studies have used SVM, Naïve Bayes, corpus-based methods, lexicon-based methods, and lexicon construction for sentiment classification.
- Prior Arabic work includes large Twitter collections, deep-learning models, pretrained word representations, and datasets spanning MSA, Egyptian dialect, tweets, and product reviews.
3. Datasets
The experiments use four Arabic Twitter datasets, each reduced to positive and negative sentiment classes, including the authors’ Main-AHS and Sub-AHS datasets. The datasets vary in size and class balance.
- The study uses four datasets, including one subset, with only positive and negative sentiment classes.
- Main-AHS contains 2,026 tweets, with 1,398 negative and 628 positive examples, and is unbalanced.
- Sub-AHS contains 1,732 tweets, including 1,230 negative and 502 positive examples.
- The dataset from contributes 1,975 usable tweets: 975 negative and 1,000 positive, covering politics, communities, and arts.
- The dataset from contains 2,479 selected positive and negative tweets from a collection originally containing more than 54,000 Arabic tweets and four classes.
3. CNN-LSTM Arabic Sentiment Analysis Model
The proposed architecture combines CNN and LSTM networks while representing Arabic tweets at character, character n-gram, or word levels. CNNs extract features, pooling reduces feature maps, and LSTMs model feature sequences before final classification.
- Architecture: The model combines CNN and LSTM networks to process Arabic text despite morphological variation and limited accurate preprocessing tools.
- Representation Levels: Three tokenization levels—character, Ch5gram, and word—expand features and address multiple forms of Arabic words in short tweets.
- Representation Levels: At character level, each letter represents a feature, increasing the number of features for an input sentence.
- Representation Levels: The Ch5gram level keeps words of five characters or fewer intact and splits longer words into five-character subwords.
- Input Layer: The input layer embeds tokens into fixed-length vectors and pads tweets to a common maximum length, producing a w×v matrix.
- CNN and Pooling: CNN filters scan token-vector sequences to detect features, after which max pooling downsamples feature maps and dropout with value 0.5 reduces overfitting.
- LSTM Layer: LSTMs receive feature vectors and capture sequential information by considering previous data before their outputs are merged and classified with a sigmoid function.
5. Experiments and Results
The experiments evaluate a combined CNN–LSTM model using accuracy across datasets and sentiment-analysis levels. The model improves performance on three datasets, with word-level representations strongest on Main-AHS and Ar-Twitter.
- Evaluation metric: Accuracy is computed from correctly and incorrectly classified positive and negative tweets using TP, TN, FP, and FN.The metric counts both correct predictions and the two types of classification error.
- Experimental setup: 50 epochs were used for all experiments, with 80% of each dataset for training and 20% for testing.The test set measures performance after training on the training split.
- Results: The proposed model improves sentiment-classification performance on Main-AHS, Sub-AHS, and Ar-Twitter, but trails slightly on ASTD.The comparison is based on Table 2, while the supplied figure caption identifies Main-AHS as one of the evaluated datasets.
- Results: Word-level achieves the best accuracy for Main-AHS and Ar-Twitter, while Sub-AHS shows similar results for word-level and Ch5gram-level representations.Char-level generally performs worst, although it exceeds Ch5gram-level on Ar-Twitter after 23 epochs.
6. Conclusions and Future Work
The study concludes that combining CNNs and LSTMs supports Arabic sentiment classification while testing character-, word-, and character-ngram-based levels. Word-level and Ch5gram-level representations outperform character-level processing, and the AHS accuracies reach 0.9424 and 0.9568.
- Conclusions: The paper investigates combining CNNs and LSTMs for Arabic sentiment classification and evaluates different sentiment-analysis levels.The levels address Arabic morphological and orthographic complexity.
- Conclusions: Character-level processing increases features for short tweets but is not ideal for the model.The conclusion contrasts this level with word-level and Ch5gram-level representations.
- Conclusions: Word-level and Ch5gram-level representations show better sentiment-classification results than character-level processing.This is the paper’s stated comparison across the evaluated sentiment-analysis levels.
- Results: 0.9424 accuracy is reached on Main-AHS and 0.9568 on Sub-AHS with the proposed approach.These values improve on the previous reported accuracies of 0.92 and 0.95, respectively.