| Literature DB >> 35697814 |
Eslam Omara1, Mervat Mousa2, Nabil Ismail2.
Abstract
Sentiment analysis is a Natural Language Processing (NLP) task concerned with opinions, attitudes, emotions, and feelings. It applies NLP techniques for identifying and detecting personal information from opinionated text. Sentiment analysis deduces the author's perspective regarding a topic and classifies the attitude polarity as positive, negative, or neutral. In the meantime, deep architectures applied to NLP reported a noticeable breakthrough in performance compared to traditional approaches. The outstanding performance of deep architectures is related to their capability to disclose, differentiate and discriminate features captured from large datasets. Recurrent neural networks (RNNs) and their variants Long-Short Term Memory (LSTM), Gated Recurrent Unit (GRU), Bi-directional Long-Short Term Memory (Bi-LSTM), and Bi-directional Gated Recurrent Unit (Bi-GRU) architectures are robust at processing sequential data. They are commonly used for NLP applications as they-unlike RNNs-can combat vanishing and exploding gradients. Also, Convolution Neural Networks (CNNs) were efficiently applied for implicitly detecting features in NLP tasks. In the proposed work, different deep learning architectures composed of LSTM, GRU, Bi-LSTM, and Bi-GRU are used and compared for Arabic sentiment analysis performance improvement. The models are implemented and tested based on the character representation of opinion entries. Moreover, deep hybrid models that combine multiple layers of CNN with LSTM, GRU, Bi-LSTM, and Bi-GRU are also tested. Two datasets are used for the models implementation; the first is a hybrid combined dataset, and the second is the Book Review Arabic Dataset (BRAD). The proposed application proves that character representation can capture morphological and semantic features, and hence it can be employed for text representation in different Arabic language understanding and processing tasks.Entities:
Mesh:
Year: 2022 PMID: 35697814 PMCID: PMC9192763 DOI: 10.1038/s41598-022-13153-w
Source DB: PubMed Journal: Sci Rep ISSN: 2045-2322 Impact factor: 4.996
Arabic sentiment analysis using RNNs and gated RNN.
| [ | [ | [ | [ | [ | [ | [ | [ | [ | [ | [ | [ | [ | [ | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | RNN | LSTM DNN | LSTM CNN RCNN | LSTM CNN | LSTM | LSTM Bi-LSTM | CNN Bi-LSTM | Bi-LSTM LSTM CNN | CNN LSTM CNN-LSTM | CNN-LSTMs | CNN-LSTM | CNN-LSTM | LSTM GRU Bi-LSTM Bi-GRU | GRU |
| Layers | Two layers | One layer | One layer | One layer | One layer Two layers | One layer | One layer | One layer Three layers | Conv. layer LSTM layer | Conv. layer Two LSTM layers | Conv. layer LSTM layer | One layer | One layer | |
| Features | Word weight | Binary vectors | Word embedding | Word embedding | Word embedding | Word embedding | Word embedding | Word embedding | Word embedding | Character Character N-gram Word | Word embedding | Word embedding | Emojis | Word embedding |
| Dataset | ASTD 9174 tweets MASTD 1850 tweets ArSAS 19,762 tweets GS 4191 tweets Syrian 2000 tweets ArTwitter 2000 tweets | LABR 63,000 reviews | 40,000 tweets | MSAC 2000 reviews SemEval-2017 task 4 2000 tweets and comments | LABR 16,448 reviews | TSAC 17,069 comments | ASTD 10,000 tweets | ASTD 1589 tweets ArTwitter 1951tweets LABR 16,448 reviews MPQA 9996 news articles Multi-domain resource 31,598 reviews Main-AHS 2026 tweets | ASTD 10,000 tweets ArTwitter 2000 tweets | Main-AHS 2026 tweets Sub-AHS 1732 tweets Ar-Twitter 2000 tweets ASTD 2479 tweets | Ar-Twitter 2000 tweets ASTD 10,000 tweets LABR 63,000 reviews | SemEval 2017 task 4-A 9655 tweets ASTD 10,000 tweets ArSAS 17,784 tweets | Tweets YouTube comments 2091 | Religious hate 6600 tweets |
| Preprocessing | Tokenization Normalization Stemming Deleting non-Arabic words, numbers, URLs, users mentions, hashtags, stop words, names Detecting intensification, emoji, idioms, negation | Tokenization Stemming Removing punctuation marks, stop-words, tab space, blank space | Removing special characters, none Arabic letters, diacritics, elongation Normalization Manual correction | Tokenization Normalization Stemming Deleting stop words | Normalization Stemming Removing diacritics, repetition, punctuations, stop words, non-Arabic words | Normalization Removing numbers, punctuation symbols, elongation, diacritics Replace emoticons with emoji Tokenize emoji | Tokenization Normalization Stemming Removing stop words, punctuations, Latin characters, digits | Deleting non-Arabic symbols, dialectical marks, punctuation marks, tatweel, duplicate character | Tokenization (character, character 5-g, word) | Normalization Stemming Lemmatization Removing stop words, duplicated letters Filtering non-Arabic words Spelling correction | Normalization Removing elongation, unknown characters, diacritics, punctuation | Normalization Removing tweets with no Emojis | Normalization Handling elongation Deleting stop words, diacritics, punctuations, emojis, tatweel, one-letter words, non-Arabic characters |
Figure 1LSTM/GRU architecture (created by Microsoft PowerPoint 2010).
Figure 2Bi-LSTM/Bi-GRU architecture (created by Microsoft PowerPoint 2010).
Figure 3CNN-LSTM/CNN-GRU architecture (created by Microsoft PowerPoint 2010).
Figure 4CNN-Bi-LSTM/CNN-Bi-GRU architecture (created by Microsoft PowerPoint 2010).
Network settings for feature detection layers.
| Architecture | Parameter | Settings |
|---|---|---|
| Gated RNNs | Embedding size | 16 |
| LSTM, GRU, Bi-LSTM, Bi-GRU layers | 3 | |
| LSTM, GRU cells | 100 in each layer | |
| Bi-LSTM, Bi-GRU cells | 100 in each direction | |
| Gated RNNs—CNN | Embedding size | 16 |
| LSTM, GRU, Bi-LSTM, Bi-GRU layers | 3 | |
| LSTM, GRU cells | 100 in each layer | |
| Bi-LSTM, Bi-GRU cells | 100 in each direction | |
| CNN layers | 3 | |
| CNN local receptive field (kernel) | 3 | |
| CNN feature maps | 512 | |
| Pooling layers | 3 | |
| Pooling size | 3 | |
| CNN—gated RNNs | Embedding size | 16 |
| CNN layers | 3 | |
| CNN local receptive field (kernel) | 3 | |
| CNN feature maps | 512 | |
| Pooling layers | 3 | |
| Pooling size | 3 | |
| LSTM, GRU, Bi-LSTM, Bi-GRU layers | 3 | |
| LSTM, GRU cells | 100 in each layer | |
| Bi-LSTM, Bi-GRU cells | 100 in each direction |
Network settings for discrimination layers.
| Parameter | Settings |
|---|---|
| Dense layer one cells | 2048 |
| Dropout 1 | 0.5 |
| Dense layer two cells | 2048 |
| Dropout 2 | 0.5 |
| Dense layer three cells | 1 |
The Arabic sentiment analysis corpora.
| Name | Total entries | Domain | Positive entries | Negative entries |
|---|---|---|---|---|
| [ | 2000 | Tweeter | 1000 | 1000 |
| [ | 10,006 | Tweeter | 799 | 1684 |
| [ | 671 | Tweeter | 222 | 128 |
| [ | 3200 | Tweeter/blogs | 719 | 1760 |
| [ | 500 | Movie reviews | 250 | 250 |
| [ | 63,257 | Book reviews | 42,832 | 8224 |
| [ | 34,492 | Reviews | 24,948 | 6650 |
| [ | 2026 | Tweeter | 628 | 1398 |
| [ | 409,562 | Hotel reviews | 52,849 | 52,849 |
| [ | 21,064 | Tweeter | 4643 | 7840 |
Comparison of applied models’ performance on the hybrid dataset.
| Architecture | Precision | Recall | F-score | Accuracy |
|---|---|---|---|---|
| LSTM | 88.89 | 88.85 | 88.84 | 88.85 |
| GRU | 88.98 | 88.92 | 88.92 | 88.92 |
| LSTM-CNN | 88.82 | 88.79 | 88.79 | 88.79 |
| GRU-CNN | ||||
| CNN-LSTM | 88.13 | 88.12 | 88.12 | 88.12 |
| CNN-GRU | 88.11 | 88.10 | 88.10 | 88.10 |
| Bi-LSTM | 88.03 | 87.85 | 87.83 | 87.85 |
| Bi-GRU | 88.96 | 88.85 | 88.84 | 88.85 |
| Bi-LSTM-CNN | 89.31 | 89.30 | 89.30 | 89.30 |
| Bi-GRU-CNN | ||||
| CNN-Bi-LSTM | 88.52 | 88.51 | 88.51 | 88.51 |
| CNN-Bi-GRU | 88.20 | 88.17 | 88.17 | 88.17 |
Significant values are in given in bold.
Comparison of applied models’ performance on the BRAD data set.
| Architecture | Precision | Recall | F-score | Accuracy |
|---|---|---|---|---|
| LSTM | 82.16 | 82.14 | 82.14 | 82.14 |
| GRU | 80.62 | 80.62 | 80.61 | 80.61 |
| LSTM-CNN | 80.24 | 79.90 | 79.85 | 79.91 |
| GRU-CNN | ||||
| CNN-LSTM | 80.69 | 80.69 | 80.68 | 80.68 |
| CNN-GRU | 80.81 | 80.81 | 80.81 | 80.81 |
| Bi-LSTM | 81.14 | 81.13 | 81.13 | 81.13 |
| Bi-GRU | 81.18 | 81.18 | 81.18 | 81.18 |
| Bi-LSTM-CNN | 80.09 | 80.07 | 80.07 | 80.07 |
| Bi-GRU-CNN | ||||
| CNN-Bi-LSTM | 80.89 | 80.89 | 80.89 | 80.89 |
| CNN-Bi-GRU | 80.44 | 80.44 | 80.44 | 80.44 |
Significant values are in given in bold.
Comparison of Bi-GRU-CNN performance and the related literature on the BRAD dataset.
| Architecture | Precision | Recall | F-score | Accuracy |
|---|---|---|---|---|
| [ | 81.48 | 81.44 | 81.45 | 81.46 |
| Bi-GRU-CNN | 83.22 | 83.20 | 83.20 | 83.20 |
| GRU-CNN | 82.74 | 82.74 | 82.74 | 82.74 |
| LSTM | 82.16 | 82.14 | 82.14 | 82.14 |
Performance of models trained on the Hybrid dataset and tested using the BRAD test set.
| Architecture | Precision | Recall | F-score | Accuracy |
|---|---|---|---|---|
| LSTM | 75.42 | 71.35 | 70.13 | 71.32 |
| GRU | 75.02 | 70.94 | 69.67 | 70.90 |
| LSTM-CNN | 77.03 | 74.03 | 73.28 | 74.01 |
| GRU-CNN | 77.29 | 74.68 | 74.05 | 74.66 |
| CNN-LSTM | 74.88 | 71.49 | 70.46 | 71.46 |
| CNN-GRU | 75.08 | 71.76 | 70.77 | 71.73 |
| Bi-LSTM | 72.41 | 65.97 | 63.30 | 65.93 |
| Bi-GRU | 74.14 | 68.97 | 67.18 | 68.93 |
| Bi-LSTM-CNN | 77.43 | 74.19 | 73.38 | 74.16 |
| Bi-GRU-CNN | ||||
| CNN-Bi-LSTM | 75.42 | 72.16 | 71.22 | 72.13 |
| CNN-Bi-GRU | 74.96 | 71.70 | 70.72 | 71.67 |
Significant values are in given in bold.
Figure 5Accuracy of LSTM/GRU based architectures (created by Microsoft PowerPoint 2010).
The networks parameers.
| Architecture | Total params (M) |
|---|---|
| LSTM | 212.088 |
| GRU | 212.036 |
| LSTM-CNN | 43.905 |
| GRU-CNN | 43.853 |
| CNN-LSTM | 13.599 |
| CNN-GRU | 13.497 |
| Bi-LSTM | 420.124 |
| Bi-GRU | 419.980 |
| Bi-LSTM-CNN | 44.429 |
| Bi-GRU-CNN | 44.284 |
| CNN-Bi-LSTM | 21.540 |
| CNN-Bi-GRU | 21.296 |
Performance measures of the hybrid dataset.
| Precision | Recall | F-score | Precision | Recall | F-score | ||
|---|---|---|---|---|---|---|---|
| Negative | 0.9024 | 0.8711 | 0.8865 | Negative | 0.9050 | 0.8698 | 0.8870 |
| Positive | 0.8755 | 0.9058 | 0.8904 | Positive | 0.8747 | 0.9086 | 0.8913 |
| Average | 0.8889 | 0.8885 | 0.8884 | Average | 0.8898 | 0.8892 | 0.8892 |
| Negative | 0.8986 | 0.8746 | 0.8864 | Negative | 0.9014 | 0.8904 | 0.8959 |
| Positive | 0.8778 | 0.9013 | 0.8894 | Positive | 0.8918 | 0.9026 | 0.8972 |
| Average | 0.8882 | 0.8879 | 0.8879 | Average | 0.8966 | 0.8965 | 0.8965 |
| Negative | 0.8891 | 0.8710 | 0.8799 | Negative | 0.8863 | 0.8742 | 0.8802 |
| Positive | 0.8736 | 0.8913 | 0.8824 | Positive | 0.8759 | 0.8879 | 0.8818 |
| Average | 0.8813 | 0.8812 | 0.8812 | Average | 0.8811 | 0.8810 | 0.8810 |
| Negative | 0.9070 | 0.8434 | 0.8740 | Negative | 0.9108 | 0.8613 | 0.8854 |
| Positive | 0.8536 | 0.9136 | 0.8826 | Positive | 0.8685 | 0.9157 | 0.8914 |
| Average | 0.8803 | 0.8785 | 0.8783 | Average | 0.8896 | 0.8885 | 0.8884 |
| Negative | 0.8999 | 0.8844 | 0.8921 | Negative | 0.9061 | 0.8850 | 0.8954 |
| Positive | 0.8864 | 0.9016 | 0.8939 | Positive | 0.8876 | 0.9083 | 0.8978 |
| Average | 0.8931 | 0.8930 | 0.8930 | Average | 0.8969 | 0.8967 | 0.8966 |
| Negative | 0.8929 | 0.8752 | 0.8839 | Negative | 0.8914 | 0.8693 | 0.8802 |
| Positive | 0.8776 | 0.8950 | 0.8862 | Positive | 0.8725 | 0.8941 | 0.8832 |
| Average | 0.8852 | 0.8851 | 0.8851 | Average | 0.8820 | 0.8817 | 0.8817 |
Performance measures of the BRAD dataset.
| Precision | Recall | F-score | Precision | Recall | F-score | ||
|---|---|---|---|---|---|---|---|
| Negative | 0.8137 | 0.8345 | 0.8240 | Negative | 0.8084 | 0.8033 | 0.8058 |
| Positive | 0.8296 | 0.8083 | 0.8188 | Positive | 0.8039 | 0.8090 | 0.8065 |
| Average | 0.8216 | 0.8214 | 0.8214 | Average | 0.8062 | 0.8062 | 0.8061 |
| Negative | 0.7709 | 0.8519 | 0.8094 | Negative | 0.8305 | 0.8234 | 0.8270 |
| Positive | 0.8339 | 0.7461 | 0.7875 | Positive | 0.8244 | 0.8314 | 0.8279 |
| Average | 0.8024 | 0.7990 | 0.7985 | Average | 0.8274 | 0.8274 | 0.8274 |
| Negative | 0.8097 | 0.8030 | 0.8064 | Negative | 0.8129 | 0.8011 | 0.8070 |
| Positive | 0.8040 | 0.8107 | 0.8073 | Positive | 0.8033 | 0.8151 | 0.8091 |
| Average | 0.8069 | 0.8069 | 0.8068 | Average | 0.8081 | 0.8081 | 0.8081 |
| Negative | 0.8086 | 0.8165 | 0.8125 | Negative | 0.8116 | 0.8128 | 0.8122 |
| Positive | 0.8141 | 0.8061 | 0.8101 | Positive | 0.8119 | 0.8107 | 0.8113 |
| Average | 0.8114 | 0.8113 | 0.8113 | Average | 0.8118 | 0.8118 | 0.8118 |
| Negative | 0.8095 | 0.7873 | 0.7983 | Negative | 0.8401 | 0.8207 | 0.8303 |
| Positive | 0.7924 | 0.8142 | 0.8031 | Positive | 0.8242 | 0.8433 | 0.8337 |
| Average | 0.8009 | 0.8007 | 0.8007 | Average | 0.8322 | 0.8320 | 0.8320 |
| Negative | 0.8104 | 0.8072 | 0.8088 | Negative | 0.8066 | 0.8017 | 0.8041 |
| Positive | 0.8074 | 0.8106 | 0.8090 | Positive | 0.8023 | 0.8071 | 0.8047 |
| Average | 0.8089 | 0.8089 | 0.8089 | Average | 0.8044 | 0.8044 | 0.8044 |
Confusion matrices of the hybrid dataset.
| Predicted label | Predicted label | ||||
|---|---|---|---|---|---|
| True label | Negative | Positive | True label | Negative | Positive |
| Negative | 7085 | 1048 | Negative | 7074 | 1059 |
| Positive | 766 | 7367 | Positive | 743 | 7390 |
| Negative | 7113 | 1020 | Negative | 7242 | 891 |
| Positive | 803 | 7330 | Positive | 792 | 7341 |
| Negative | 7084 | 1049 | Negative | 7110 | 1023 |
| Positive | 884 | 7249 | Positive | 912 | 7221 |
| Negative | 6859 | 6859 | Negative | 7005 | 1128 |
| Positive | 703 | 7430 | Positive | 686 | 7447 |
| Negative | 7193 | 940 | Negative | 7198 | 935 |
| Positive | 800 | 7333 | Positive | 746 | 7387 |
| Negative | 7118 | 1015 | Negative | 7070 | 1063 |
| Positive | 854 | 7279 | Positive | 861 | 7272 |
Confusion matrices of the BRAD dataset.
| Predicted label | Predicted label | ||||
|---|---|---|---|---|---|
| True label | Negative | Positive | True label | Negative | Positive |
| Negative | 6541 | 1297 | Negative | 6296 | 1542 |
| Positive | 1498 | 6315 | Positive | 1492 | 6321 |
| Negative | 6677 | 1161 | Negative | 6454 | 1384 |
| Positive | 1984 | 5829 | Positive | 1317 | 6496 |
| Negative | 6294 | 1544 | Negative | 6279 | 1559 |
| Positive | 1479 | 6334 | Positive | 1445 | 6368 |
| Negative | 6400 | 1438 | Negative | 6371 | 1467 |
| Positive | 1515 | 6298 | Positive | 1479 | 6334 |
| Negative | 6171 | 1667 | Negative | 6433 | 1405 |
| Positive | 1452 | 6361 | Positive | 1224 | 6589 |
| Negative | 6327 | 1511 | Negative | 6284 | 1554 |
| Positive | 1480 | 6333 | Positive | 1507 | 6306 |