Artificial Intelligence meets Bhagavad Gita and the Upanishads

Artificial Intelligence meets Bhagavad Gita and the Upanishads

Dr Rohitash Chandra is a Senior Lecturer  in Data Science  at the School of Mathematics and Statistics of University of South Wales. He is an expert  in the field of  Artificial Intelligence, and has recently done research in the area of natural language processing (NLP) for philosophy of religion by focusing on the Bhagavad Gita and the Upanishads. 

Originally from Fiji,  Dr Chandra completed his doctoral studies in New Zealand and worked as Lecturer in Computer Science  in Fiji (University of the South Pacific), before heading to do his post-doctoral studies in Singapore (Nanyang Technological University)  and then to Australia. The field of Hindu philosophy with a focus on the Bhagavad Gita and the Upanishads has been a long-time dream project for Dr Chandra. His interest in arts and literature is one of the things that pushed him to work on these projects.

As a  poet himself, Dr Chandra edited two poetry collections and has also published two of his own collections that are available on Amazon. He did want to pursue a fine arts degree but due to lack of formal education in Fiji, he decided to take up computer science. Now, his passion is towards  bringing science and religion  together, particularly Dharmic religions such as Hinduism, Buddhism, Jainism and Sikhism. 

Why did you specifically choose the Gita for this project?

I was heavily influenced by English poetry during my under-graduate studies in Computer Science and Engineering Technology  at the University of the South Pacific in FIji (2003 - 2005). I used to frequent the library to study English literature during my break time; William Wordsworth and W. B. Yeats were some of my favourite poets back then. 

I come from a Hindu family where my parents are religious and took interest in Hindu philosophy.  I remember growing up in a house where my father would buy video tapes of the Ramayana and the Mahabharata and we would watch it repeatedly.  The visuals are the themes that have always been at the back of my mind driving me to pursue greater things in life.  These have been the foundations that gave me excellence in my primary and secondary school studies, and towards the end of my secondary school I started writing poetry.

Mrs. Reddy and Mrs. Sangeeta Sharma were my teachers in high school who really motivated me to write, after reviewing my poems that I wrote without much planning in school. I always scored high in the poetry section of my English paper. I wrote poems when I began university and towards the end of my university, I published my first poetry book online (but that was heavily influenced by   English poetry).

I was aware of the epics and other literary works but I did not pay much attention to it. The Hindu awakening within me was at the age of 22 when I left Fiji as a Teaching and Research Assistant in a Middle East Technical University in Northern Cyprus,Turkey. It is predominantly a Muslim country where you do not have temples. I had a few Pakistani, Turkish and African friends, who asked me about Hinduism. That is when I realised that I should spend more time so that I can understand and explain it to them.

As I mentioned before, I was aware of the literary works, but I did not have any in-depth knowledge on them. That is when I picked up the Gita and the Upanishads and  I read them in English. Fiji has a Hindu population of less than thirty-five percent and we are proud and love to celebrate our culture. These are what motivated me to bring in Hindu culture and religion  into academic research tied with Artificial Intelligence. 

Dr Rohitash Chandra at School of Mathematics and Statistics, UNSW Sydney

So how did the idea to work with AI and the Gita come about?

A good friend of mine, Dr Tom Blau and I were part of the same lab at University of Sydney where I was a postdoc and he was PhD student then (2017 - 2019). We both had a shared interest in the Mahabharata, that eventually led us to start a study group known as the Vedanta Reading Group. We had interns and other guests visiting the university, who also joined the study group.  Vedanta Reading Group is part of my research group known as Transitional Artificial Intelligence Research Group at UNSW Sydney. We met weekly  to read the Bhagavad Gita. During the COVID-19 lockdowns, we continued our sessions online. We moved onto other texts such as the Ashtavakra Gita, Upanishads and selected texts from Buddhism and Taoism. 

While our sessions went on, we decided to bring out a few different translations of the Gita, started comparing it verse-by-verse, text-by-text. None of us knew Sanskrit, so it was either Hindi or English. We picked three translations (Mahatma Gandhi, Shri Purohit Swami and Eknath Easwaran) and compared the verses and the meaning, to really understand if the essence in translation was retained. Eknath Easwaran’s translation of the Bhagavad Gita was what I was introduced to when I was back in Northern Cyprus.

I had a few interns from India who were interested in natural language processing projects. Along with my past research interns from IIT Guwahati, Mukul Ranjan, and Venkatesh Kulkarni (coauthors in respective papers), we looked at different translations of the Bhagavad Gita and Upanishads and developed code to process them further for advanced NLP methods that use deep learning which are prominent machine learning methods. We ensure that all our research papers accompany open source  code and data, so that the research is reproducible  and also extendable by other researchers. 

In our first project (Chandra and Kulkarni, 2022), we use sentiment and semantic analysis which are NLP strategies to compare translations of the Bhagavad Gita. We  need a comprehensive dataset about human sentiments expressed based on some text and hence we utilised Sen-wave COVID-19 dataset that featured 50 experts who hand-labelled 10,000 tweets. We used this as the training data to fine-tune the BERT-based deep learning (NLP model developed by Google)  model  for sentiment analysis. We note that we extended an earlier project where we used the same model for COVID-19 sentiment analysis during the first wave in India (Chandra and Krishna, 2021). We were interested in quantifying what type of sentiments were being expressed during the pandemic as this enables a better understanding of human psychology during a pandemic. 

One might think that there would be negative emotions during the rise of COVID-19 cases, but surprisingly, we found that people have also been joking around, or expressing some humour in their tweets. This is human psychology – when people are afraid or tense and going through a tough time, they crack jokes! 

We further extended this model for Hindu philosophy where we decided to compare the different translations of the Bhagavad Gita where we studied the sentiments and the semantics of the three translations. We found that despite variations occurring in the vocabulary or the sentence structure, the meaning, and the emotions behind it were similar.

What are the projects lined up for the future?

I have a good friend in Pondicherry, Sushrut Badhe who has translated the Bhagavad Gita while maintaining the rhythm and rhyme. We are looking at quantifying the NLP model we developed further by comparing how humans view the sentiments expressed. Hence, the followup is a “man vs Machine” project where we will have a survey to gather data for qualitative assessments of the sentiments predicted by the NLP model. Furthermore,  we are also are looking at quantifying the accuracy of  the Google Sanskrit translator - this project is led by Chaarvi Bansal (BITS Pilani) and Akshat Shukla (IIT Delhi) and supported by Mukul Ranjan and Sushrut Badhe.  

Oxford University has a Centre for Hindu Studies and my dream is to establish our own Center for Hindu Studies at the UNSW Sydney, where we promote Hinduism. Our Centre would have a diverse range of subjects that include Hindu philosophy and Sanskrit Studies, Hindu history and literature along with cultural activities such as fine arts and drama, classical music and dance, and Vedic mathematics. We would like to eventually have Postgraduate research and Undergraduate programmes. Our dream is that our future students have the option to take Undergraduate double majors such as Computer Science and Hindu Studies and they can further do Masters by Research and Ph.D in Hindu Studies. Research in the area of AI for Hinduism would also be a major activity along with other multidisciplinary research areas. 

There are many versions of Ramayana as a play in different parts of South Asia - India, Thailand, Bali. Can a similar project be done with plays?

The plays  at the end of the day are based on text, so you could always compare the topics and the sentiments across those texts to see how similar or different they are, you know. AI can analyse the sentiments that have been expressed in the verses and use that to compare the texts. 

Artificial intelligence is going to address a lot of those things in the next five or ten years. Many have already been developed, but it takes a while for people and companies to actually adopt it. There is real scope in virtual reality and computer vision for Hinduism, in restoring ancient Hindu arts and also creating modern works of art. 

As a scientist, what are your views on bringing religion and science or academic research together?

Well, most people are of the opinion that research or any student related to religion should not be conducted in an academic setting. But I would like to challenge that since there are many wonderful concepts - that laid the foundations of modern science and technology that emerge from Hinduism. The decimal and binary number system are examples of concepts  from Hinduism. The 13th century Kerala School of Mathematics predated Newton in Calculus. We are still holding onto a Eurocentric version of history of science and technology. We need to free academics from this point of view and embrace the contributions by coloured scientists and philosophers, particularly from Asia. 

Hinduism involved academia for thousands of years. Our Rishis (scientists and philosophers)  were great mathematicians and had knowledge on the nitty gritties of science. We also had Hindu women in academia who were philosophers and scientists

Today, we have people contributing to these studies with the help of modern science and technology. In India, there is a start-up that is working with temples and virtual reality, and I am engaging in research with them. 

There are many big changes happening to the world, and I envision a world where we are not afraid to bring these two aspects together, or rather understand that they were never apart to bring them together. I think that the ancient knowledge from our Hindu texts are for the world. We have concepts about democracy, non-violence, meditation, and veganism from these texts and we need to highlight them further. 

For further reading:

  1. Chandra R; Kulkarni V, 2022, 'Semantic and Sentiment Analysis of Selected Bhagavad Gita Translations Using BERT-Based Language Framework', IEEE Access, vol. 10, pp. 21291 - 21315,
  2. Chandra R; Ranjan M, 2022, 'Artificial intelligence for topic modelling in Hindu philosophy: Mapping themes between the Upanishads and the Bhagavad Gita', PLoS ONE, vol. 17, pp. e0273476,
  3. Chandra R; Krishna A, 2021, 'COVID-19 sentiment analysis via deep learning during the rise of novel cases', PLoS ONE, vol. 16, pp. e0255615,
  4. AI, philosophy and religion: what machine learning can tell us about the Bhagavad Gita: