Ahmed-Mortadi/Mustashhed

HTML

0

23 commits

updated Nov 25, 2023

See the code

README

Mustashhed - Arabicthon 2023 Project

Welcome to "Mustashhed," our open-source project submitted as a contribution to Arabicthon 2023 (https://arabicthon.ksaa.gov.sa/). Mustashhed is a Flask web application accessible at https://mustashhed.ngrok.dev/.

Idea of the Project

Our project leverages a set of large datasets of text containing a substantial number of Arabic texts. We utilize pySBD (Python Sentence Boundary Disambiguation) to split the text from the corpora into sentences, forming the examples.

Next, we employ the aubmindlab/bert-base-arabertv02, aubmindlab/bert-large-arabertv02, and medmediani/Arabic-KW-Mdel models to obtain embeddings for these examples. When a user enters a word along with its meaning and type, or uses the Alriyadh dictionary, we utilize camel_tools to retrieve all forms of the word based on its type (verb, noun, preposition).

For each word form, it is associated with the meaning to create a query. This query is then passed to the one of the embedding models mentioned above. Subsequently, we utilize Faiss, a library for efficient similarity search and clustering of dense vectors, to find the most similar examples to the user's query, by comparing the embeddings generated by the same model that embedded the user's query.

Getting Started

To run and host this project locally, follow these steps:

  1. Download the "resources" folder from this Google Drive link.
  2. Replace the existing "static/resources" folder in the project with the downloaded one.
  3. Create a new python virtual environment, and activate it.
  4. Run the following command:
pip install -r requirements.txt
  1. Follow the installation steps in the CAMeL Tools GitHub repository to install the camel-tools package.
  2. Run the following command:
pip install faiss-cpu
  1. If you want to use 'Alriyadh dictionary' meanings you need to ask them ([email protected]) to give you an API_KEY, then if they porvided you with the key, put your key in the API_KEY variable in main.py.
  2. Set the value of MODEL_NAME in main.py with the model you need to use, by commenting other models' names.
  3. Run the main application.
python main.py

Note: The first time you run the application, it may take some time to download the selected model. Subsequent runs will not require this download.

Data Resources

Quraan

Hadith

News

Poetry

Ahmed-Mortadi/Mustashhed

HTML

0

23 commits

updated Nov 25, 2023

See the code

README

Mustashhed - Arabicthon 2023 Project

Welcome to "Mustashhed," our open-source project submitted as a contribution to Arabicthon 2023 (https://arabicthon.ksaa.gov.sa/). Mustashhed is a Flask web application accessible at https://mustashhed.ngrok.dev/.

Idea of the Project

Our project leverages a set of large datasets of text containing a substantial number of Arabic texts. We utilize pySBD (Python Sentence Boundary Disambiguation) to split the text from the corpora into sentences, forming the examples.

Next, we employ the aubmindlab/bert-base-arabertv02, aubmindlab/bert-large-arabertv02, and medmediani/Arabic-KW-Mdel models to obtain embeddings for these examples. When a user enters a word along with its meaning and type, or uses the Alriyadh dictionary, we utilize camel_tools to retrieve all forms of the word based on its type (verb, noun, preposition).

For each word form, it is associated with the meaning to create a query. This query is then passed to the one of the embedding models mentioned above. Subsequently, we utilize Faiss, a library for efficient similarity search and clustering of dense vectors, to find the most similar examples to the user's query, by comparing the embeddings generated by the same model that embedded the user's query.

Getting Started

To run and host this project locally, follow these steps:

  1. Download the "resources" folder from this Google Drive link.
  2. Replace the existing "static/resources" folder in the project with the downloaded one.
  3. Create a new python virtual environment, and activate it.
  4. Run the following command:
pip install -r requirements.txt
  1. Follow the installation steps in the CAMeL Tools GitHub repository to install the camel-tools package.
  2. Run the following command:
pip install faiss-cpu
  1. If you want to use 'Alriyadh dictionary' meanings you need to ask them ([email protected]) to give you an API_KEY, then if they porvided you with the key, put your key in the API_KEY variable in main.py.
  2. Set the value of MODEL_NAME in main.py with the model you need to use, by commenting other models' names.
  3. Run the main application.
python main.py

Note: The first time you run the application, it may take some time to download the selected model. Subsequent runs will not require this download.

Data Resources

Quraan

Hadith

News

Poetry