e-ISSN 2231-8542
ISSN 1511-3701

Home / Regular Issue / JTAS Vol. 30 (4) Oct. 2022 / JST-3160-2021


A Topic Modeling and Sentiment Analysis Model for Detection and Visualization of Themes in Literary Texts

Kah Em Chu, Pantea Keikhosrokiani and Moussa Pourya Asl

Pertanika Journal of Tropical Agricultural Science, Volume 30, Issue 4, October 2022


Keywords: Iranian diaspora, life writing, sentiment analysis, text mining, topic modeling

Published on: 28 September 2022

Despite the growing emergence of new computer analytic software programs, the adoption and application of computer-based data mining and processing methods remain sparse in literary studies and analyses. This study proposes a text analytics lifecycle to detect and visualize the prevailing themes in a corpus of literary texts. Two objectives are to be pursued: First, the study seeks to apply a Topic Modeling approach with selected algorithms of LDA, LSI, NMF, and HDP that can effectively detect the recurring topics about the major themes developed in the dataset. Second, the project aims to apply a Sentiment Analysis model that can analyze the polarity of writers’ discourse on the detected thematic topics with the algorithms of Vader and TextBlob. The implementation of Topic Modeling has detected six thematic topics of sex, family, revolution, imprisonment, intellectual, and death. The adoption of the Sentiment Analysis model also revealed that the feelings attached to all the identified themes are largely negative sentiments expressed towards socio-political issues.

  • Abdelrahman, O., & Keikhosrokiani, P. (2020). Assembly line anomaly detection and root cause analysis using machine learning. IEEE Access, 8, 189661-189672.

  • Afary, J. (2009). Sexual politics in modern Iran. Cambridge University Press.

  • Al Mamun, M. H., Keikhosrokiani, P., Asl, M. P., Anuar, N. A. N., Hadi, N. H. A., & Humida, T. (2022). Sentiment analysis of the Harry Potter Series using a lexicon-based approach. In P. Keikhosrokiani & M. Pourya Asl (Eds.), Handbook of Research on Opinion Mining and Text Analytics on Literary Works and Social Media (pp. 263-291). IGI Global.

  • Alaei, A. R., Becken, S., & Stantic, B. (2019). Sentiment analysis in tourism: Capitalizing on big data. Journal of Travel Research, 58(2), 175-191.

  • Appel, O., Chiclana, F., Carter, J., & Fujita, H. (2016). A hybrid approach to the sentiment analysis problem at the sentence level. Knowledge-Based Systems, 108, 110-124.

  • Asl, M. P. (2018). Practices of counter-conduct as a mode of resistance in Middle East women’s life writings. 3L: Language, Linguistics, Literature®, 24(2), 195-205. https://doi.10.17576/3L-2018-2402-15

  • Asl, M. P. (2019). Foucauldian rituals of justice and conduct in Zainab Salbi’s between two worlds. Journal of Contemporary Iraq & the Arab World, 13(2-3), 227-242. https://doi.10.1386/jciaw_00010_1

  • Asl, M. P. (2020). Micro-Physics of discipline: Spaces of the self in Middle Eastern women life writings. International Journal of Arabic-English Studies, 20(2), 223-240. https://doi.10.33806/ijaes2000.20.2.12

  • Asl, M. P. (2021). Gender, space and counter-conduct: Iranian women’s heterotopic imaginations in Ramita Navai’s City of Lies. Gender, Place & Culture, 1-21. https://doi:10.1080/0966369X.2021.1975100

  • Bird, S., Klein, E., & Loper, E. (2009). Natural language processing with Python. O’Reilly Media, Inc.

  • Chiaramonte, P. (2013, January 12). Hell on earth: Inside Iran’s brutal Evin prison. Fox News.

  • Costa, L. F. (2018). A method for content analysis applied to newspaper coverage of Japanese personalities in Brazil and Portugal. Digital Scholarship in the Humanities, 33(2), 231-247.

  • Devika, M. D., Sunitha, C., & Ganesh, A. (2016). Sentiment analysis: A comparative study on different approaches. Procedia Computer Science, 87, 44-49.

  • Ding, X., Liu, B., & Yu, P. S. (2008). A holistic lexicon-based approach to opinion mining. In Proceedings of the 2008 International Conference on Web Search and Data Mining (pp. 231-240). ACM Publishing.

  • Firmin, R. L., Bonfils, K. A., Luther, L., Minor, K. S., & Salyers, M. P. (2017). Using text-analysis computer software and thematic analysis on the same qualitative data: A case example. Qualitative Psychology, 4(3), 201-210.

  • Gabrilovich, E., & Markovitch, S. (2006). Overcoming the brittleness bottleneck using Wikipedia: Enhancing text categorization with encyclopedic knowledge. In AAAI (Vol. 6, pp. 1301-1306). American Association for Artificial Intelligence.

  • Graneheim, U. H., Lindgren, B. M., & Lundman, B. (2017). Methodological challenges in qualitative content analysis: A discussion paper. Nurse Education Today, 56, 29-34.

  • Grayson, S., Mulvany, M., Wade, K., Meaney, G., & Greene, D. (2016, September 20-21). Novel2vec: Characterising 19th century fiction via word embeddings. In 24th Irish Conference on Artificial Intelligence and Cognitive Science (AICS’16). Dublin, Ireland.

  • Grayson, S., Mulvany, M., Wade, K., Meaney, G., & Greene, D. (2017). Exploring the role of gender in 19th century fiction through the lens of word embeddings. In J. Gracia, F. Bond, J. McCrae, P. Buitelaar, C. Chiarcos & S. Hellmann (Eds.), Language, Data and Knowledge, (pp. 358-364). Springer.

  • Grayson, S., Wade, K., Meaney, G., & Greene, D. (2016). The sense and sensibility of different sliding windows in constructing co-occurrence networks from literature. In B. Bozic, G. Mendel-Gleason, C. Debruyne & D. O’Sullivan (Eds.), Computational History and Data-Driven Humanities, (pp. 65-77). Springer.

  • Hadi, N. H. A., & Asl, M. P. (2022). The real, the imaginary, and the symbolic: A Lacanian reading of Ramita Navai’s City of Lies. GEMA Online Journal of Language Studies, 22(1), 145-158.

  • Hornick, M. (2017, November 17). Explicit semantic analysis (ESA) for text analytics. Oracle Machine Learning.

  • Jafery, N. N., Keikhosrokiani, P., & Asl, M. P. (2022). Text analytics model to identify the connection between theme and sentiment in literary works: A case study of Iraqi life writings. In P. Keikhosrokiani & M. P. Asl (Eds.), Handbook of research on opinion mining and text analytics on literary works and social media (pp. 173-190). IGI Global.

  • Keikhosrokiani, P., & Asl, M. P. (Eds.). (2022). Handbook of Research on Opinion Mining and Text Analytics on Literary Works and Social Media. IGI Global.

  • Leavy, S., Meaney, G., Wade, K., & & Greene, D. (2019). Curatr: A platform for semantic analysis and curation of historical literary texts. In E. Garoufallou, F. Fallucchi & E. W. De Luca (Eds.), Metadata and Semantics Research, (pp. 354-366). Springer.

  • Leavy, S., Meaney, G., Wade, K., & & Greene, D. (2020). Mitigating gender bias in machine learning data sets. In L. Boratto, S. Faralli, M. Marras & G. Stilo (Eds.), Bias and Social Aspects in Search and Recommendation (pp. 12-26). Springer.

  • Lodin, H., & Balani, P. (2017). Rich semantic sentiment analysis using lexicon based approach. ICTACT Journal on Soft Computing, 7(04), 1486-1491.

  • Malik, E. F., Keikhosrokiani, P., & Asl, M. P. (2021, July 4-5). Text mining life cycle for a spatial reading of Viet Thanh Nguyen’s The Refugees (2017). In 2021 International Congress of Advanced Technology and Engineering (ICOTEN). Taiz, Yaman.

  • Mayo, M. (2017). A general approach to preprocessing text data. KDnuggets.

  • Mazzola, L., Siegfried, P., Waldis, A., Kaufmann, M., & Denzler, A. (2018, September 25-27). A domain specific ESA inspired approach for document semantic description. In 2018 International Conference on Intelligent Systems (IS). Funchal, Portugal.

  • Misuraca, M., Scepi, G., & Spano, M. (2021). Using opinion mining as an educational analytic: An integrated strategy for the analysis of students’ feedback. Studies in Educational Evaluation, 68, Article No. 100979.

  • Mumtaz, D., & Ahuja, B. (2018). A lexical and machine learning-based hybrid system for sentiment analysis. In B. Panda, S. Sharma & U. Batra (Eds.), Innovations in Computational Intelligence: Best Selected Papers of the Third International Conference on REDSET 2016 (pp. 165-175). Springer.

  • Naghibi, N. (2016). Women Write Iran: Nostalgia and Human Rights from the Diaspora. University of Minnesota Press.

  • Nekai, P. (2013). From education to segregation:Iran’s sexist policy. PROSPECT

  • Paroubek, P., & Pak, A. (2010, May). Twitter as a corpus for sentiment analysis and opinion mining. In Seventh International Conference on Language Resources and Evaluation (LREC’10). Valletta, Malta.

  • Ranucci, D. (2019). We never forgot Princeton’s Xiyue Wang during his imprisonment in Iran, student says.

  • Řehůřek, R. (2019). Models.hdpmodel–Hierarchical Dirichlet Process. Gensim.

  • Rehurek, R., & Sojka, P. (2010). Software framework for topic modelling with large corpora. In In Proceedings of the LREC 2010 workshop on new challenges for NLP frameworks (pp. 45-50). CiteSeer.

  • Scharl, A., Hubmann-Haidvogel, A., Jones, A., Fischl, D., Kamolov, R., Weichselbraun, A., & Rafelsberger, W. (2016). Analyzing the public discourse on works of fiction–Detection and visualization of emotion in online coverage about HBO’s Game of Thrones. Information Processing and Management, 52(1), 129-138.

  • Shahrokni, N. (2020). Women in Place: The Politics of Gender Segregation in Iran. University of California Press.

  • Shi, T., Kang, K., Choo, J., & Reddy, C. K. (2018). Short-text topic modeling via non-negative matrix factorization enriched with localword-context correlations. In Proceedings of the 2018 World Wide Web Conference (pp. 1105-1114). ACM Publishing.

  • Sofian, N. B., Keikhosrokiani, P., & Asl, M. P. (2022). Opinion mining and text analytics of reader reviews of Yoko Ogawa’s The Housekeeper and the Professor in Goodreads. In P. Keikhosrokiani & M. P. Asl (Eds.), Handbook of Research on Opinion Mining and Text Analytics on Literary Works and Social Media (pp. 240-262). IGI Global.

  • Subramanian, D. (2019). Text Mining in Python: Steps and Examples. Medium.

  • Suhendra, N. H. B., Keikhosrokiani, P., Asl, M. P., & Zhao, X. (2022). Opinion mining and text analytics of literary reader responses: A case study of reader responses to KL Noir volumes in Goodreads using sentiment analysis and topic. In P. Keikhosrokiani & M. P. Asl (Eds.), Handbook of Research on Opinion Mining and Text Analytics on Literary Works and SocialMedia (pp. 191-239). IGI Global.

  • Sukhija, N., Tatineni, M., Brown, N., Van Moer, M., Rodriguez, P., & Callicott, S. (2016). Topic modeling and visualization for big data in social sciences. In 2016 International IEEE Conferences on Ubiquitous Intelligence & Computing, Advanced and Trusted Computing, Scalable Computing and Communications, Cloud and Big Data Computing, Internet of People, and Smart World Congress (UIC/ATC/ScalCom/CBDCom/IoP/SmartWorld) (pp. 1198-1205). IEEE Publishing.

  • Teoh, Y. Z. I., & Keikhosrokiani, P. (2020). Knowledge workers mental workload prediction using optimised ELANFIS. Applied Intelligence, 51, 2406-2430.

  • Vasapollo, S. (2020). Causes of the Iranian 1979 Revolution: Historical and Political Aspects. ASERI.

  • Vinodhini, G., & Chandrasekaran, R. (2012). Sentiment analysis and opinion mining: A survey. International Journal of Advanced Research in Computer Science and Software Engineering, 2(6), 282-292.

  • Ying, S. Y., Keikhosrokiani, P., & Asl, M. P. (2021). Comparison of data analytic techniques for a spatial opinion mining in literary works: A review paper. In F. Saeed, F. Mohammed & A. Al-Nahari (Eds.), Innovative Systems for Intelligent Health Informatics. IRICT 2020. Lecture Notes on Data Engineering and Communications Technologies (pp. 523-535). Springer.

  • Ying, S. Y., Keikhosrokiani, P., & Asl, M. P. (2022). Opinion mining on Viet Thanh Nguyen’s the sympathizer using topic modelling and sentiment analysis. Journal of Information Technology Management, 14(Special Issue), 163-183.

ISSN 1511-3701

e-ISSN 2231-8542

Article ID


Download Full Article PDF

Share this article

Recent Articles