SinaTools : Open Source Toolkit for Arabic Natural Language Processing

Tymaa Hammouda, Mustafa Jarrar, Mohammed Khalilia · 2024

Read SinaTools : Open Source Toolkit for Arabic Natural Language Processing by Tymaa Hammouda, Mustafa Jarrar, Mohammed Khalilia (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2411-01523.txt.

Description

A 2024 arXiv research paper by Tymaa Hammouda, Mustafa Jarrar, Mohammed Khalilia. We introduce SinaTools , an open-source Python package for Arabic natural language processing and understanding. SinaTools is a unified package allowing people to integrate it into their system workflow, offering solutions for various tasks such as flat and nested Named Entity Recognition (NER), fully-flagged Word Sense Disambiguation (WSD), Semantic Relatedness, Synonymy Extractions and Evaluation, Lemmatization, Part-of-speech Tagging, Root Tagging, and additional helper utilities such as corpus processing, text stripping methods, and diacritic-aware word matching.

Catalog record

CREATORTymaa Hammouda, Mustafa Jarrar, Mohammed Khalilia
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2411-01523

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

SinaTools : Open Source Toolkit for Arabic Natural Language Processing Tymaa Hammouda, Mustafa Jarrar, Mohammed Khalilia Abstract We introduce SinaTools , an open-source Python package for Arabic natural language processing and understanding. SinaTools is a unified package allowing people to integrate it into their system workflow, offering solutions for various tasks such as flat and nested Named Entity Recognition (NER), fully-flagged Word Sense Disambiguation (WSD), Semantic Relatedness, Synonymy Extractions and Evaluation, Lemmatization, Part-of-speech Tagging, Root Tagging, and additional helper utilities such as corpus processing, text stripping methods, and diacritic-aware word matching. This paper presents SinaTools and its benchmarking results, demonstrating that SinaTools outperforms all similar tools on the aforementioned tasks, such as Flat NER ( 87.33 % 87.33\% ), Nested NER ( 89.42 % 89.42\% ), WSD ( 82.63 % 82.63\% ), Semantic Relatedness ( 0.49 0.49 Spearman rank), Lemmatization ( 90.5 % 90.5\% ), POS tagging ( 97.5 % 97.5\% ), among others. SinaTools can be downloaded from ( https://sina.birzeit.edu/sinatools ). \setcode utf8 \setcode utf8 \email [email protected] 1 Introduction Despite the progress in Arabic NLP [ 9 ] , there remain a lack of tools and resources that offer solutions for Arabic NLP and NLU tasks. Developing machine learning tools is crucial in democratizing Arabic NLP, as they allow people to incorporate machine learning into their workflows with less technical knowledge. The availability of open-source and advanced AI tools remains limited. Low-code platforms and toolkits can bridge this gap by offering intuitive interfaces and trained models, making it easier for people in industry, research, and education to tap into the power of NLP to develop and deploy NLP applications. As will be discussed in this paper, a handful of tools for Arabic NLP have emerged, each offering rich functionalities that contribute to the growing ecosystem of Arabic NLP. Notable examples include The Stanford CoreNLP Toolkit [ 42 ] , Farasa [ 10 ] , MADAMIRA [ 49 ] , CAMeLTools [ 46 ] , and OCTOPUS [ 12 ] . This article presents a new set of tools packaged in SinaTools , an open-source toolkit for Arabic NLP and NLU, offering state-of-the-art solutions for various semantic-related tasks developed by SinaLab at Birzeit University. SinaTools currently supports flat, nested, and fine-grained Named Entity Recognition (NER), Word Sense Disambiguation (WSD), Semantic Relatedness, Synonymy Extraction and Evaluation, Lemmatization, Part-of-Speech (POS) tagging, and root tagging, among others. SinaTools provides a single end-to-end system for these tasks with different interfaces, including a Command Line Interface (CLI), Software Development Kit (SDK), and Application Programming Interface (API), as well as Python Jupyter Notebooks. Our goal is to simplify the development and deployment of Arabic NLP applications. Additionally, this article presents our benchmarking results of similar toolkits on the aforementioned tasks, demonstrating the superiority of SinaTools over other tools. The main contributions of this article are: 1. Open-source 1 1 1 Download page: https://sina.birzeit.edu/sinatools and Python-based Arabic toolkit for various NLU tasks, with different interfaces. 2. Benchmarking Arabic NLP toolkits, demonstrating SinaTools benefits and superior performance on all tasks. This article is structured as follows: Section 2 overviews related work. Section 3 presents the design and implementation. Section 4 presents all NLU modules. Section 5 concludes the paper and outlines our future work. Fig. 1: Core modules of SinaTools 2 Related Work This section overviews different Arabic NLP toolkits, which we also summarize in Table 1 . The Stanford CoreNLP [ 42 ] is a general-purpose toolkit, supporting nine languages including Arabic, but its Arabic support is limited to basic tasks. MADAMIRA [ 49 ] is designed for morphological analysis and disambiguation, including lemmatization, POS tagging, and segmentation. As will be demonstrated later, MADAMIRA is among the top-performing tools in terms of accuracy. However, it is not open-source, is notably slow, and its functionalities are limited to morphology tasks. Farasa [ 10 ] focuses also on Arabic morphology tasks, mainly lemmatization, POS tagging, and segmentation. Farasa is designed for speed, offering fast morphological analysis. However, its results are less sophisticated compared to MADAMIRA. For instance, Farasa’s POS tagger is limited to 20 tags, whereas MADAMIRA supports 40 tags. Additionally, Farasa’s lemmatizer returns ambiguous lemmas as it removes all diacritics. CAMeLTools [ 46 ] is an open-source NLP toolkit providing utilities for pre-processing, morphological modeling, dialect identification, NER, and sentiment analysis. Although CAMeLTools covers a broad range of tasks, its support of NLU tasks is limited. For example, its NER module can only detect three flat entity types: PERS , LOC , and ORG . OCTOPUS [ 12 ] introduces a significant advancement with its AraT5v2 model, specifically designed for Arabic text generation. Meticulously trained on extensive and diverse datasets, the tools outperform competitive baselines across various tasks. OCTOPUS supports eight Arabic generation tasks, including summarization, paraphrasing, grammatical error correction, and question generation, among other generative tasks. There are other task-specific tools. For example, TURJUMAN [ 43 ] is a neural machine translation toolkit that translates from 20 dialects into MSA using the AraT5 model. AraNet [ 2 ] supports various social media tasks, including age, dialect, gender, emotion, irony, and sentiment prediction. Mazajak [ 13 ] focuses on sentiment analysis. Table 1: Feature comparison of related Arabic NLP tools. SinaTools CoreNLP Farasa MADAMIRA CamelTools Octopus Language Python Java Java Java Python Python Command Line Interface (CLI) ✓ ✓ ✓ ✓ ✓ Application Programming Interface (API) ✓ ✓ ✓ ✓ ✓ ✓ Morphological Modeling ✓ ✓ Morphological Disambiguation ✓ ✓ ✓ ✓ Diacritization ✓ ✓ ✓ ✓ Tokenization/Segmentation/Stemming ✓ ✓ ✓ ✓ Lemmatization ✓ ✓ ✓ ✓ POS Tagging ✓ ✓ ✓ ✓ ✓ Root Tagging ✓ NER 21 tags (flat, nested) 4 tags flat 3 tags flat WSD ✓ Semantic Relatedness ✓ Sentiment Analysis ✓ Dialect ID ✓ Title Generation ✓ QA ✓ Question Generation ✓ transliteration ✓ ✓ ✓ grammatical error correction ✓ Paraphrase ✓ Summarization ✓ Synonyms Extraction ✓ 3 Design and Implementation 3.1 Design SinaTools is an open-source toolkit consisting of a collection of Python application programming interfaces (APIs) and their corresponding command-line tools, which encapsulate these APIs. It adheres to these core design principles: 1. Modularity : Each function is encapsulated in its own module, allowing for independent development, testing, and maintenance. This structure facilitates the seamless addition of new features without impacting existing ones. 2. Extensibility : The architecture is designed to be extensible, enabling users to easily integrate additional tasks or replace existing components with custom implementations. 3. User-Friendly APIs : SinaTools provides intuitive and consistent APIs that abstract the complexity of underlying algorithms and data structures. This ensures that users, regardless of their expertise in NLP, can leverage the full capabilities of the tools with a minimal learning curve. 4. Performance Optimization : The implementation emphasizes efficient processing of large datasets. Large models and datasets required for various tasks are loaded the first time they are used or through a specific implemented download command. This approach minimizes load times and ensures efficient memory usage during operations. 3.2 Implementation SinaTools is implemented in Python 3.10.8 and can be installed via pip install. Python was selected due to its ease of use and its widespread adoption for NLP and Machine Learning. SinaTools is designed to be compatible with Python version 3.10 on

Read the complete text