Classifying Verses of the Q uran using Doc2vec (2021)

Abstract: The Quran, as a significant religious text, bears important spiritual and linguistic values. Understanding the text and inferring the underlying meanings entails semantic similarity analysis. We classified the verses of the Quran into 15 pre-defined categories or concepts, based on the Qurany corpus, using Doc2Vec and Logistic Regression. Our classifier scored 70% accuracy, and 60% F1-score using the distributed bag-of-words architecture. We then measured how similar the documents within the same category are to each other semantically and use this information to evaluate our model. We calculated the mean difference and average similarity values for each category to indicate how well our model describes that category.

## introduction the richness of the quran and the deep layers of its meaning offer immense potential for further study and experiments. the knowledge in the quran was presented using different approaches, mainly using the tree-structure hierarchy @xcite . as a result, determining a concept's true meaning in the quran is difficult. we want to classify the quran verses based on topics or meanings to assist users in identifying the religious knowledge explained in the quran. there has been previous work on classifying textual documents and sentences in english and arabic @xcite . however, only a few studies in the literature attempt to classify the verses of the holy quran @xcite @xcite . therefore, using nlp combined with ml, this paper presents an approach to classifying the quran based on topics and meanings. to do so, we need to compute the similarity in meaning between its passages. we focus on sentence/ paragraph levels. therefore, we represent the verses of the quran as vectors of features and compare them by measuring the distance between these features. we use doc2ve foot_0 to compute features that capture the semantics of the quranic verses. we then train a logistic regression classifier in a supervised way to learn the underlying meanings and classify the verses of the quran into fifteen predefined classes or categories. we then use the cosine similarity measure on the vectors to examine how semantically similar the verses are in each class. we compute two metrics: average similarity and mean similarity difference to inspect the relation between the verses in the same class and other classes. this information indicates how more similar same-category documents are to each other than to documents from different categories. a higher average similarity indicates how similar the documents are in each category. a higher mean difference implies that the model can identify those documents in one class are more distinct from those in other classes. since we are interested in a topical classification, we use the qurany corpus to train and evaluate our model. the rest of the paper is organized as follows: section 2 presents studies related to the classification of the verses of the quran. section 3 describes our approach to classifying the quranic verses and our experiments. section 4 presents our evaluation and results. finally, section 5 states our conclusions and future research directions. @xcite , evaluated the effectiveness of four wellknown classification algorithms: decision tree, k-nearest neighbor (k-nn), support vector machine (svm) and naïve bayes (nb), to classify quran verses according to their topics. they used the manual topical classification of quranic verses by @xcite to train and evaluate the four classifiers. three selected topics (classes) are used, and 1,227 verses were used in this study out of 6236 verses in the whole quran. another classification has been presented by qurany @xcite . this project annotates the verses of the qur'an with a comprehensive index of nearly1100 topics; it classifies the qur'an into fifteen main themes and subdivides the main themes into sub-themes. in this work, we exploit the distributed representation of text to capture the semantic properties of the 6236 arabic verses of the quran. we transformed the verses of the quran into a numerical form, which can be used as input to ml methods to examine the semantic similarity between the quranic verses and classify them into topical classes. ## methodology the objective of this experiment is to evaluate our model in capturing the semantic properties of verses of the quran. therefore, we examine our model on the following tasks: ## conclusion we used nlp combined with ml to classify the verses of the quran into 15 predefined classes. the semantics of the verses were captured using doc2vec embeddings that were used to group similar documents. our model achieved a classification accuracy of 68% and 56% f1 score. the results confirmed that the classifier scored higher accuracy with the distributed bags of words architecture of the doc2vec model. next, we evaluated our model by examining the semantic similarity of the quranic verses. derived classes showed relatively high average similarity for some classes using the distributed bags of words architecture. the three top classes that achieved higher average same-category similarity and mean-difference are faith, pillars of islam, and religions. the three classes scored top values consistently for both metrics with different runs (500, 700, 900, 1100 test samples). the two metrics are not relatively high for some classes. we contribute that to some classes' documents similar to those of another class. besides, some verses in the quran discuss more than one concept/ topic. the uniqueness and complexity of the quran language could also be a significant reason reflected in our results. in the future, we may incorporate subtopic chains from qurany corpus, and we may consider creating unique classifications of quran verses using existing knowledge resources, and test our model using them. we may consider other approaches for computing the semantic similarity, investigate their performance, and how they compare to our approach.