Search

The Allama-Bot - AI meets Culture

This week's article explores the Allama-Bot, a passion project by Dubai-student Taimur Shaikh. A passionate computer scientist, Taimur explores the intersections between culture and technology, elaborating on his aims with the project.


By Taimur Shaikh



In the age of technology, digitalization infiltrates almost every aspect of our lives. Despite this, creativity is still attributed as an exclusively human notion, unable to be simplified into an algorithm. I strived to change that, whilst also paying homage to a key player in the history of Pakistan.


Allama-Bot is an Artificial Intelligence system that generates Urdu Shayari (notably, ghazals) in the style of renowned Urdu and Farsi poet, Allama Muhammad Iqbal. From a high-level, the system works by scouring over 10,000 lines of nearly all of Iqbal’s works across his 4 Urdu poetry books (Bang e Dara, Bal e Jibril, Zarb e Kalim and Armughan e Hijaz) and analyzes how words are ordered. It then trains on this dataset by essentially trying to ‘guess’ what the next word is on a particular line given the first word. It then tries to guess the third word based on the first two, then the fourth based on the first three, and so on until it has done this for the whole line for every line in the dataset.


Most of the Pakistani diaspora is not exposed to the impact that Iqbal had in Pakistan’s formation and ideology. It was in fact Iqbal who played a pivotal role in motivating Jinnah to take charge of the All India Muslim League. In fact, some propose Jinnah did not truly wish for the partition of the country, but was persuaded via a letter from Iqbal in 1937. The following is an excerpt from said letter:


“...A separate federation of Muslim Provinces, reformed on the lines I have suggested above, is the only course by which we can secure a peaceful India and save Muslims from the domination of Non-Muslims. Why should not the Muslims of North-West India and Bengal be considered as nations entitled to self-determination just as other nations in India and outside India are?”


Whether or not the Partition should have happened is a topic that has been debated for decades amongst historians, and is not the main focus of this article. Rather, I simply aim to highlight the influence that Allama Iqbal had on the soon-to-be Pakistan. He set the cogs into motion, not just through his talks with Jinnah, but through his literary endeavours as well, which call for a sense of unity and passion amongst the Muslims of British India. This is highlighted in works such as Saare Jahan se Acha as well as the song Tarana e Milli.


My reasons for taking up this project are threefold. Firstly, I have a deep interest in AI as a whole, and am always looking for intriguing new ideas to explore within it, such as music generation or intelligent game development. Generating text, and poetry at that, was simply one of the things I had on my list of potential projects. Secondly, although it may seem out of the ordinary for a brown STEM boy like me, I have a profound appreciation for the creative and literary arts. I have a strong musical background, and I see poetry as simply spoken word music, as it contains many analogues to principles of music theory. After all, ghazals are also a popular form of music on top of poetry. My third and final reason is to pay tributes to the culture which I cherish so dearly. Whilst I was unfamiliar with Iqbal’s works specifically before this project, delving into his shayari allowed me to be transported back to the British India in which he resided. His works carry with them a strong sense of religious passion, patriotism, and above all, hope - something that Pakistan could undoubtedly use right now. Creating a rather crude digital poet that mimics him may not be that grand a gesture, but the everlasting nature of technology means that Allama-Bot may hopefully give future generations of Pakistanis a glimpse into one of the most important figures in the formation of our country.


In the context of Pakistan, AI is a relatively new concept, but it is being readily implemented and leveraged in a handful of different sectors. For instance, members of the growing startup scene in Pakistan have used Machine Learning techniques to analyze competitor performance and set optimum price levels accordingly in order to maximize profits. Additionally, a recent breakthrough allowed Pakistan to develop their own AI system to calculate COVID risk. Although Pakistan houses limited academic institutions with a concentration in AI, there have been a fair share of notable achievements. NUST inaugurated their own AI-centred chapter (NCAI) in March 2018, and it has been competitive even with some more well-known international institutions. In addition, the Research Center for Artificial Intelligence (RCAI) in Karachi, formerly known as the Koshish Foundation, has been making headway not just in AI, but for other hot-topic tech fields like Internet of Things (IoT).


Allama­-Bot does not fall under the same category as any of these AI applications, though. Rather, it is classified as creative AI. That is, AI systems which aim to generate work which can be deemed “creative”. As you can expect, it is hard to quantify creativity, or even define what it is. An entire subfield of CS known as Computational Creativity was created to tackle these conjectures. From my research, I can conclude that, as a creative entity, Allama-Bot still has a long way to go in terms of the work it puts out, but we’re getting there. I hope to continue fostering this project into university, and hopefully conduct further research into Natural Language Processing and flesh out this project.


One of Allama-Bot's creations:

"Tajasus Hai Tu To Ye Alam E Lekin Huwa Hai Ya

Taak Ka Khamosh Hai Ye Rehta E Khawani Jis Hai Ya


Namood Woh Sharer Ab Zan Nahin Hai Mujhe Ka Magar O

Parwaz Hai Zindagi Tu Rakhte E Souhbat Yazdan Mera Hai Ya


Nau-E-Insan Magar E Khudi Maqamat Hai Ye Nabi Meri Jis Aseer

Nay Khoonro Ye Tad Au Ye Firaaq Nahin Hai Ya


Wehshat Khud E Aflak Khalwat Se Dil Ban Dunya Zindagi

Zarb Zanjeer Huwa Teri? E Aaeen Lutf Paida Hai Ya


Go Chahne Kiya Ishq Ka Khoob Tu Ne Kis Tera Noor

Falsafa E Deen Laila Se Turbat Ka Maqam Hai Ya


Naghma-E-Ishrat Ke Liye Ghalib Tha Koi Isse E Kancha ! Ga

Dekh To Jahangeer Tujh Mein Namrood E Sanam Bhi Hai Ya


Naqsh-E-Haq Sharar Hum Ba Mera E Haq Dala Hun Ishq Ka

Nafas Hai Chun Ki Hasti Aik Ajab Mein Faryad Hai Ya"


Follow us on Instagram
Subscribe to our YouTube Channel