###### Abstract  
This research investigates the impacts of pre-processing techniques on the effectiveness of topic modeling algorithms for Arabic texts, focusing on a comparison between BERTopic, Latent Dirichlet Allocation (LDA), and Non-Negative Matrix Factorization (NMF). Using the Single-label Arabic News Article Data set (SANAD), which includes 195,174 Arabic news articles, this study explores pre-processing methods such as cleaning, stemming, normalization, and stop word removal, which are crucial processes given the complex morphology of Arabic. Additionally, the influence of six different embedding models on the topic modeling performance was assessed. The originality of this work lies in addressing the lack of previous studies that optimize BERTopic through adjusting the \(n\)-gram range parameter and combining it with different embedding models for effective Arabic topic modeling. Pre-processing techniques were fine-tuned to improve data quality before applying BERTopic, LDA, and NMF, and the performance was assessed using metrics such as topic coherence and diversity. Coherence was measured using Normalized Pointwise Mutual Information (NPMI). The results show that the Tashaphyne stemmer significantly enhanced the performance of LDA and NMF. BERTopic, optimized with pre-processing and bi-grams, outperformed LDA and NMF in both coherence and diversity. The CAMeL-Lab/bert-base-arabic-camelbert-da embedding yielded the best results, emphasizing the importance of pre-processing in Arabic topic modeling. BERTopic; topic modeling pre-processing techniques; LDA; NMF; NPMI; topic diversity; Tashaphyne; ISRI +
Footnote †: journal: Medical  
themes or topics from a vast collection of documents, often being used to organize, manage, and provide insights into unstructured text [3]. Traditionally, topic modeling has been considered a subclass of machine learning, particularly in the category of unsupervised learning, where it is employed to classify documents based on latent patterns of word co-occurrence. Models like LDA and NMF exemplify these classical approaches. However, these methods rely on statistical and matrix decomposition techniques, which are limited by their assumption of word independence [4]. Traditional topic modeling methods such as Latent Semantic Analysis (LSA), Probabilistic Latent Semantic Analysis (pLSA), and LDA have provided foundational techniques for uncovering latent structures within text corpora. LSA utilizes Singular Value Decomposition (SVD) to reduce the dimensionality of term-document matrices, while pLSA introduces probabilistic modeling to capture topic distributions across documents. LDA further extends these concepts by incorporating a generative probabilistic framework, where each document is viewed as a mixture of topics and each topic as a distribution over words. These methods have been pivotal in advancing text analysis, but their reliance on the bag-of-words assumption often limits their ability to capture the linguistic and semantic richness of languages like Arabic [4; 5; 6]. The advent of deep learning and neural networks has paved the way for more sophisticated models that can grasp the nuances of language and context more effectively. These methods aim to address the limitations of traditional models, particularly in handling large and complex data sets, better capturing the nuances of language and improving model interpretability. Advanced techniques, such as Dynamic Topic Models (DTMs), Non-Negative Matrix Factorization with advanced regularization, and neural topic models, have emerged to provide more nuanced analyses [5; 7; 8]. Incorporating word embeddings, such as Word2 Vec and GloVe, further enhances topic identification by capturing the semantic relationships between words, while models like BERTopic utilize state-of-the-art transformer-based embeddings for context-aware and robust topic modeling. These advancements demonstrate the evolution of topic modeling into a more linguistically sophisticated and computationally efficient field [9; 10].