Classification of Arabic Poetry Emotions Using Deep Learning
Abstract
:1. Introduction
- It introduces an Arabic poem dataset with labeled emotions.
- It explores various deep learning models and transformer-based models to classify Arabic poems by emotions.
- It provides a performance comparison between deep learning and transformer-based models for Arabic poem classification.
2. Background
2.1. BERT-Based Models
2.2. Previous Work
2.3. Deep Learning Algorithms
3. Methodology
3.1. Dataset Collection
3.2. Deep Learning Approach
3.3. AraBERT Model
4. Results
4.1. Deep Learning Results
4.2. AraBERT Results
4.3. Comparison and Discussion
5. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Alzu’bi, S.; Badarneh, O.; Hawashin, B.; Al-Ayyoub, M.; Alhindawi, N.; Jararweh, Y. Multi-Label Emotion Classification for Arabic Tweets. In Proceedings of the 2019 Sixth International Conference on Social Networks Analysis, Management and Security (SNAMS), Granada, Spain, 22–25 October 2019; pp. 499–504. [Google Scholar] [CrossRef]
- Alswaidan, N.; Menai, M.E.B. Hybrid Feature Model for Emotion Recognition in Arabic Text. IEEE Access 2020, 8, 37843–37854. [Google Scholar] [CrossRef]
- Al-Hagery, M.; Alassaf, M.; Al-kharboush, F. Exploration of the best performance method of emotions classification for arabic tweets. Indones. J. Electr. Eng. Comput. Sci. 2020, 19, 1010. [Google Scholar] [CrossRef]
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. Bert: Pre-Training of Deep Bidirectional Transformers for Language Understanding. arXiv 2018, arXiv:181004805. [Google Scholar]
- Hong, Y.; Wu, Q.; Qi, Y.; Rodriguez-Opazo, C.; Gould, S. Vln bert: A recurrent vision-and-language bert for navigation. In Proceedings of the IEEE/CVF conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021. [Google Scholar]
- Qiao, Y.; Qi, Y.; Hong, Y.; Yu, Z.; Wang, P.; Wu, Q. HOP+: History-enhanced and Order-aware Pre-training for Vision-and-Language Navigation. IEEE Trans. Pattern Anal. Mach. Intell. 2023; ahead of print. [Google Scholar] [CrossRef]
- An, D.; Qi, Y.; Huang, Y.; Wu, Q.; Wang, L.; Tan, T. Neighbor-view enhanced model for vision and language navigation. In Proceedings of the 29th ACM International Conference on Multimedia, Virtual, 20–24 October 2021. [Google Scholar]
- Ye, H.; Li, G.; Qi, Y.; Wang, S.; Huang, Q.; Yang, M.H. Hierarchical modular network for video captioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022. [Google Scholar]
- Atliha, V.; Šešok, D. Text augmentation using BERT for image captioning. Appl. Sci. 2020, 10, 5978. [Google Scholar] [CrossRef]
- Zhou, Y.; Shimada, N. Generative adversarial network for text-to-face synthesis and manipulation with pretrained BERT model. In Proceeding of the 2021 16th IEEE International Conference on Automatic Face and Gesture Recognition (FG 2021), Jodhpur, India, 15–18 December 2021. [Google Scholar]
- Hayashi, T.; Watanabe, S.; Toda, T.; Takeda, K.; Toshniwal, S.; Livescu, K. Pre-Trained Text Embeddings for Enhanced Text-to-Speech Synthesis. In Proceeding of the 20th Annual Conference of the International Speech Communication Association INTERSPEECH 2019, Graz, Austria, 15–19 September 2019. [Google Scholar]
- Shahriar, S.; Tariq, U. Classifying Maqams of Qur’anic Recitations using Deep Learning. IEEE Access 2021, 9, 117271–117281. [Google Scholar] [CrossRef]
- Abdullah, M.; Hadzikadicy, M.; Shaikhz, S. SEDAT: Sentiment and Emotion Detection in Arabic Text Using CNN-LSTM Deep Learning. In Proceedings of the 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA), Orlando, FL, USA, 17–20 December 2018; pp. 835–840. [Google Scholar] [CrossRef]
- Abdul-Mageed, M.; Diab, M.; Korayem, M. Subjectivity and sentiment analysis of modern standard Arabic. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, Portland Oregon, 19–24 June 2011; pp. 587–591. [Google Scholar]
- Rabie, O.; Sturm, C. Feel the heat: Emotion detection in Arabic social media content. In Proceedings of the International Conference on Data Mining, Internet Computing, and Big Data (BigData2014), Washington, DC, USA, 17–19 November 2014; pp. 37–49. [Google Scholar]
- Al-Azani, S.; El-Alfy, E.-S.M. Using Word Embedding and Ensemble Learning for Highly Imbalanced Data Sentiment Analysis in Short Arabic Text. Procedia Comput. Sci. 2017, 109, 359–366. [Google Scholar] [CrossRef]
- Gharbat, M.; Saadeh, H.; Al Fayez, R.Q. Discovering The Applicability of Classification Algorithms With Arabic Poetry. In Proceedings of the 2019 IEEE Jordan International Joint Conference on Electrical Engineering and Information Technology (JEEIT), Amman, Jordan, 9–11 April 2019; pp. 453–458. [Google Scholar] [CrossRef]
- Abbas, M.; Lichouri, M.; Zeggada, A. Classification of Arabic Poems: From the 5th to the 15th Century. In New Trends in Image Analysis and Processing—ICIAP 2019; Cristani, M., Prati, A., Lanz, O., Messelodi, S., Sebe, N., Eds.; Springer International Publishin: Cham, Switzerland, 2019; pp. 179–186. [Google Scholar]
- Orabi, M.; Rifai, H.E.; Elnagar, A. Classical Arabic Poetry: Classification based on Era. In Proceedings of the 2020 IEEE/ACS 17th International Conference on Computer Systems and Applications (AICCSA), Antalya, Turkey, 2–5 November 2020; pp. 1–6. [Google Scholar] [CrossRef]
- Mohammad, I. Naive bayes for classical arabic poetry classification. Al-Nahrain J. Sci. 2009, 12, 217–225. [Google Scholar]
- Alsharif, O.; Alshamaa, D.; Ghneim, N. Emotion classification in Arabic poetry using machine learning. Int. J. Comput. Appl. 2013, 65, 16. [Google Scholar]
- Ahmed, M.A.; Hasan, R.A.; Ali, A.H.; Mohammed, M.A. Using machine learning for the classification of the modern Arabic poetry. TELKOMNIKA Telecommun. Comput. Electron. Control 2019, 17, 2667. [Google Scholar] [CrossRef]
- Antoun, W.; Baly, F.; Hajj, H. AraBERT: Transformer-Based Model for Arabic Language Understanding. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection, Marseille, France, 12 May 2020; European Language Resource Association: Luxembourg, 2020; pp. 9–15. Available online: https://www.aclweb.org/anthology/2020.osact-1.2 (accessed on 22 May 2021).
- Alyafeai, Z.; Al-Shaibani, M. ARBML: Democritizing Arabic Natural Language Processing Tools. In Proceedings of Second Workshop for NLP Open Source Software (NLP-OSS), Online, 9 November 2020; pp. 8–13. [Google Scholar]
- “Al Diwan: Encyclopedia of Arab Poetry”. Available online: https://www.aldiwan.net (accessed on 20 May 2021).
- Shahriar, S. Arabic-Poem-Emotion. GitHub. Available online: https://github.com/SakibShahriar95/Arabic-Poem-Emotion (accessed on 6 September 2021).
- Srivastava, N.; Hinton, G.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 2014, 15, 1929–1958. [Google Scholar]
- Nair, V.; Hinton, G.E. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML), Haifa, Israel, 21–24 June 2010; pp. 807–814. [Google Scholar]
- Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:14126980. [Google Scholar]
Source | Application | Dataset | Features | Algorithm | Results |
---|---|---|---|---|---|
[13] | Detect sentiment and emotions in Arabic tweets | SemEval Task- 1: Affect in Tweets | 1st submodel (Arabic tweets + English translated tweets): AffectiveTweets (142D), Doc2Vec (600D), Arabic Features (5D), DeepEmoji (64D), Unsupervised Learning sentiment features (4096D), Emoji Feature (1D) 2nd submodel (Arabic tweets only): 300D Aravec word embedding | CNN-LSTM | Emotion classification (Spearman correlation): 0.569 |
[14] | Subjectivity and sentiment analysis | 2855 Arabic annotated sentences from Penn Arabic Treebank | Domain labels, unique words, N-Grams, and adjectives | SVM | 0.72 F1 score for subjectivity and 0.956 F1 score for sentiment |
[1] | Classify emotions in Arabic tweets | Crawled 11,503 Arabic tweets | Bag-of-Words (BOW) and Term frequency-inverse document frequency (TF-IFD) | DT, RF, KNN | Accuracy: 0.664 Precision: 0.674 Recall: 0.857 F1-score: 0.826 (Best scores using RF) |
[2] | Emotion recognition in Arabic text | AETD, IAEDS, and SemEval | TF-IDF of character-grams (1–10 characters), TF-IDF of uni-grams Lexical sentiment features, Lexical emotion features Syntactic features: TF-IDF of POS Semantic features: TF-IDF of semantic meanings Deep features (embeddings): Emoji2vec (300D), GloVe (300D), AraVec-CBOW (300D), AraVec- SkipGram (300D), FastText (300D) | DNN (HEF) CuDNNLSTM + CuDNNGRU Hybrid HEF+DF | HEF+DF using IAEDS dataset: Accuracy: 87.2% Precision: 0.69 Recall: 0.60 F1-score: 0.64 |
[15] | Detection of emotions in Arabic social media content | Crawled 1605 Arabic tweets | Word–emotion lexicon built using Weka—BestFirst algorithm and manually selected emotion related words | SMO, NB, and simple search and frequency (SF) algorithm | Average precision: 0.74 Average recall: 0.64 Average F1-score: 0.65 (Best scores using SF) |
[3] | Classification of emotions in Arabic tweets | Crawled 3171 Arabic tweets | BoW, TF-IDF, N-grams | SVM, NB, LR | Accuracy: 82.43% F1-score: 0.83 (SVM) |
[16] | Sentiment analysis for imbalanced Arabic text dataset | Syria tweets dataset | Word2vec-CBOW 300D | SGD, SVC, LR, Gaussian NB, KNN, DT Ensemble including RF, voting, stacking | Accuracy: 85.28% F1-score: 63.95% (Stacking) |
[17] | Arabic poetry era classification | 10,895 hemistiches from Adab website belonging to Abbasid and Andalusian eras | Words in poetry text, rooting and stemming | SVM, logistic regression, RF, DT | Accuracy: 70.5% (SVM) |
[18] | Arabic poetry era classification | 30,866 poems belonging to Pre-Islamic, Umayyad, Abbasid, and Andalusian eras from Kaggle | Word tokenizer and N-gram tokenizer | Multinomial NB | Accuracy: 70.21%, F1-Score: 0.68 |
[19] | Arabic poetry era classification | 86,061 poems categorized into five eras collected from Adab website | FastText word embeddings Skipgram model (200D) | CNN | F1-Score: 0.796 (on five eras classification) |
[20] | Classical Arabic poetry classification | Poems used from well-known books into eight categories: Hekmah, Retha’a, Ghazal, Madeh, Heja’a, Wasef, Fakher, Naseeb | Root words from poem text, order and rank of words | NB | Recall: 0.6000 Precision: 0.7500 Accuracy: 55% |
[21] | Classify Arabic poetry emotion | 1231 poems from online website in four categories: Retha, Ghazal, Fakhr, Heja | Top K Unigrams | NB, SVM | Precision: 0.73 Recall: 0.66 F1-score: 0.66 (NB) |
[22] | Classification of modern Arabic poetry | Arabic poetry dataset collected from websites | Mutually deducted occurrence | SVM, NB, Linear SVC | Precision: 0.72 Recall: 0.47 F1-score: 0.51 (SVM) |
Arabic Poem Example | Emotion | Total Poems |
---|---|---|
If they asked about my wellbeing, I tried to make excuses, but I can’t I say I’m fine but it’s all words on the tongue And God knows what’s deep inside and what the eyes hide | Sad | 4064 |
The heart gets what it wants from love, and the body gets its share of disease And if you love you find the ordeal of who loves, death I am amazed from my heart that never tires from longing and blaming hurts it | Love | 3443 |
A face as if the full moon borrowed its light and shine from it And I saw on him a garden that made me and everyone else look at him | Joy | 1945 |
9452 |
Architecture | Train Accuracy (%) | Test Accuracy (%) | Testing F1-Score |
---|---|---|---|
1D-CNN | 97.0 | 62.0 | 0.62 |
Bi-RNN (GRU) | 98.0 | 63.0 | 0.62 |
1DCNN + LSTM | 97.0 | 54.0 | 0.53 |
SVM | 68.0 | 44.0 | 0.288 |
KNN (K = 5) | 58.0 | 41.0 | 0.312 |
MLP | 55.0 | 32.0 | 0.314 |
DT | 100.0 | 37.0 | 0.343 |
Gaussian NB | 40.0 | 37.0 | 0.349 |
Gradient Boosting | 60.0 | 44.0 | 0.318 |
AdaBoost | 45.0 | 42.0 | 0.322 |
Random Forest | 100.0 | 45.0 | 0.309 |
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. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Shahriar, S.; Al Roken, N.; Zualkernan, I. Classification of Arabic Poetry Emotions Using Deep Learning. Computers 2023, 12, 89. https://doi.org/10.3390/computers12050089
Shahriar S, Al Roken N, Zualkernan I. Classification of Arabic Poetry Emotions Using Deep Learning. Computers. 2023; 12(5):89. https://doi.org/10.3390/computers12050089
Chicago/Turabian StyleShahriar, Sakib, Noora Al Roken, and Imran Zualkernan. 2023. "Classification of Arabic Poetry Emotions Using Deep Learning" Computers 12, no. 5: 89. https://doi.org/10.3390/computers12050089
APA StyleShahriar, S., Al Roken, N., & Zualkernan, I. (2023). Classification of Arabic Poetry Emotions Using Deep Learning. Computers, 12(5), 89. https://doi.org/10.3390/computers12050089