Level Up Islam Learn More

Learn all about the system that powers this platform and what the future trajectory is.

About Sentiment Search

Enabling users to search Quranic verses by emotion and sentiment

Mission

Sentiment Search is dedicated to helping users find Quranic verses that speak to their hearts and address their emotional and spiritual needs. By combining the utility of AI to search Quranic verses and match relevancy to certain keywords, Sentiment Search empowers users to find verses that resonate with their emotions and concerns.

How It Works

Sentiment Search maps every Ayah to a numerical value called a vector embedding. Each search query is mapped to a vector embedding as well. The similarity between the query and the Ayah is calculated using the cosine similarity between the two vector embeddings. We return the most relevant Ayahs based on the highest similarity score.

Surah Sentiment Analysis

Explaining the results of our Sentiment Search analysis for each Surah

Data Collection

Collecting all of the Surahs and Ayahs is done through an endpoint on a public API. This is all thanks to the Islamic Network and can be found here: https://alquran.cloud/

Sentiment Analysis

Sentiment Analysis is done using a free inference provider from HuggingFace and the model is fed only the first few Ayahs of the Surah. This is done to ensure that the model does not overfit to the entire Surah and becuase the inference provider has a limit on the number of tokens.

Results

Every Surah is ranked based on the similarity between the emotional keyword and the Ayahs in the Surah. The top 3 sentiment scores are returned for each Surah.

Future Improvements

The results and accuracy can be improved by using higher quality models with more parameters since currently we are using a free inference provider from HuggingFace. With more funds the website can also take dynamic input from the user and generate results on the spot for doing sentiment search.