/


Omdena developed “Yarub,” an open-source Arabic NLP library that provides essential tools for tasks such as sentiment analysis, NER, POS tagging, and morphological processing. By scraping, cleaning, and labeling high-quality Modern Standard Arabic datasets—where resources are historically limited—the project established a scalable foundation for advancing Arabic language AI applications in research, industry, and education.
In this Omdena project, our goal was to develop open-source Python NLP libraries for the Arabic language that can be easily used across key Natural Language Processing tasks such as morphological analysis, named entity recognition (NER), sentiment analysis, word embeddings, dialect identification, part-of-speech tagging, and more.
As with any machine learning initiative, data quality plays a critical role in achieving strong model performance. However, for this project—Building Open Source NLP Libraries & Tools for the Arabic Language—the required data was not readily available. The complexity of the Arabic language, its rich morphology, and the existence of multiple dialects made data collection especially challenging.
To address this, we decided to focus the first phase solely on Modern Standard Arabic (MSA). Yet, this introduced an immediate barrier: there is a limited supply of pure MSA datasets, as much written Arabic blends MSA with classical and regional dialect forms.
This article outlines our data collection journey. At the beginning, the path was not entirely clear. However, thanks to Omdena’s bottom-up collaborative development approach, the pieces gradually aligned into a complete and effective strategy. Below, we summarize the main steps and insights gained throughout the process.
Collecting Modern Standard Arabic data
Training data is the data used to train an algorithm or machine learning model to predict the outcome as per our design model.
Test data is used to measure the performance, such as accuracy or efficiency, of the algorithm used to train the machine.
We aimed to collect MSA datasets specified for the various models of our Arabic NLP toolkit, which are:
Yarub Training Datasets were incorporated where available.
Pros:
Challenges:

Before scraping websites, it is important to ensure ethical and legal compliance. Website permissions can be checked using:
example.com/robots.txt
Annotation and labeling require significant time and teamwork.
We scraped noor-book.com, which contains ~80,000 user-contributed quotes.
Because the site uses infinite scrolling, we used Selenium + BeautifulSoup to load content dynamically, scroll the page, and extract text.
Then follow those directions as provided by the documentation page:
We scraped noor-book.com, which contains ~80,000 user-contributed quotes.
Because the site uses infinite scrolling, we used Selenium + BeautifulSoup to load content dynamically, scroll the page, and extract text.
It is a miscellaneous operating system interface
Here we used (os.environ) as a mapping object representing the string environment.
We will import ‘web driver’ from the Selenium library. Still, first, you need to add the folder containing WebDriver’s binaries to your system’s path with the help of Selenium documentation here.
Used it to apply a sleep function to give the server the time needed to perform the given requests without being overloaded.
Its use is accompanied by some knowledge about the structure of a web page and some HTML tags.
We need to define where the parts we need to scrape lay in, and you can use the BeautifulSoup library to parse it.
The idea of using scraped tweets comes from the idea to aim accounts mainly use MSA in their tweets as:
A structured EDA process helps uncover hidden formatting issues, language noise, and annotation gaps — explore how to perform exploratory data analysis in Python step-by-step to strengthen preprocessing before model training.
We have tried to use Doccano software for labeling web scraped data sets, but it was not so accurate at facing problems with consistency.

After the vicissitude process, we have successfully achieved an MSA scraped dataset and labeling as per the requirement.

Most often hosted at the Python Packaging Index (PyPI), historically known as the Cheese Shop. At PyPI, you can find everything from Hello World to advanced deep learning libraries.
Here you can find out about our PyPI Yarub Library.

We want to point to that the most important step was to know what are the specifications of the required data by each task in the project and then come applying the previously mentioned techniques, and that was only possible by communication and careful listening to the members of the other tasks and repeatedly going back to them to assure that we are on the right track.
Also, After the success in our mention in that project, it is not the end of the road as we are going to develop furthermore functionality related to our training dataset. We will add an Arabic image training dataset for computer vision challenges and research topics.
In the end, enjoy this video that will take you on a short journey through our project.
You might also like

Revolutionizing Short-term Traffic Congestion Prediction with Machine Learning

Using Advanced Data Mining Techniques for Educational Leadership

Machine Learning and NLP For Arabic: Part Of Speech Tagging

Leading a Local Chapter Challenge in My Home Country Nepal to Understand the Voices of Women, Youth and Marginalized Groups