Farhana Akter
3 min readDec 27, 2020

--

Project: Quran Challenge with AI

Text Generation from Quran Verses
Project Manager: Farhana Akter, PhD
Research Team: AIsoftsolution
ML Engineers: Badar Alam, Umer Farqoor, Umair Khan

Allah challenges all of creation to produce something similar to a chapter of the Quran: “Or do they say that he [Muhammad صلى الله عليه وسلم] has invented it? Say to them, ‘Bring ten invented chapters like it, and call for help on whomever you can besides Allah, if you are truthful.” (Quran 11:13) “And if you are in doubt about what We have sent down upon our servant [Muhammad صلى الله عليه وسلم], then produce a surah the like thereof and call upon your witnesses other than Allah, if you should be truthful.” (2:23)

Introduction

Natural Language Processing (NLP), a branch of Artificial Intelligence (AI), has witnessed a growing interest in the Arabic language in recent years. Various fields, such as machine translation, information retrieval, and text summarization, demonstrate a growing need for Arabic language resources, which are abundantly available on the web. This abundance necessitates accurate interpretation, primarily for text written in Arabic, leading to the demand for Arabic semantic analysis. This semantic analysis, in turn, aids in creating new text generation based on training data. In this study, our dataset comprised an English version of the Quran, and the following methodology was employed to address the challenge.

1) Is the Quran from the Creator and not man-made?

Muslims believe that Allah’s Quran was revealed to the final prophet, Muhammad (peace be upon him), through the angel Jibril. The findings of this project underscore that, even with the assistance of natural language processing in this era of technological advancement, generating a single meaningful verse like the Quran remains unattainable. The Quran’s miraculous nature is evident, given its revelation to an unlettered Prophet: “We have, without doubt, sent down the Message, and We will assuredly guard it.” (Al-Hijr 9)

2) Can Artificial Intelligence (AI) generate a verse like a verse of a surah? If not, what are the possible secrets?

To answer this question, we applied the most suitable machine learning model and found that AI cannot generate a meaningful and diverse verse like the Quran. Several challenges contribute to this, including the absence of sizable data related to every topic covered in the Quran, the contextual challenges posed by the dispersed references of Quranic verses, and the limitations of existing models such as LSTM and BiLSTM.

3) What is the difference between the Quran and other books that AI can generate?

Most books typically focus on a few topics, whereas the Quran encompasses every conceivable aspect of life. The Quran’s unique structure, where specific cases mentioned in one chapter may find their conclusion in a later chapter, poses challenges for information gathering and context establishment.

4) How can this study be replicated?

The replication process involves:

  • Loading and pre-processing data
  • Creating character mappings
  • Preparing the data to be in the right shape for the model structure
  • Training an RNN — LSTM network(s) to learn sequences of characters
  • Generating new sequences of characters

Approach

The model involves looking up the embedding for each character, running the GRU one-time step with the embedding as input, and applying the dense layer to generate logits predicting the next character’s log-likelihood.

“Surely, if mankind and jinn were to get together to produce the like of this Quran, they will never be able to produce the like of it, howsoever they might help one another.” (Quran 17:88) Indeed, neither AI nor humans can generate or produce a “statement” similar to the Quran’s verse. The collaboration of humans and AI falls short in creating a book like the Quran.

--

--

Farhana Akter

Here I am, O Allah, here I am. I submit and submit again.