Skip to main content

A lightweight Python library for preprocessing Arabic dialect text written in Arabic script.

Project description

LIAS_Labrary

LIAS_Labrary is a lightweight Python library for preprocessing Arabic dialect text written in Arabic script.
It is designed to support both:

  • single-text preprocessing
  • dataset / DataFrame column preprocessing

The library focuses on safe and practical preprocessing operations commonly needed in Arabic dialect NLP and sentiment analysis workflows, while preserving the original Arabic letter forms.


Main Features

LIAS_Labrary currently supports:

Core text preprocessing

  • Remove Arabic diacritics
  • Remove tatweel (ـ)
  • Reduce repeated letters
  • Reduce repeated punctuation
  • Normalize whitespace
  • Remove or preserve selected special characters
  • Convert digits between:
    • Western digits: 0 1 2 3 4 5 6 7 8 9
    • Eastern Arabic digits: ٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩

Emoji handling

  • keep
  • remove
  • replace

When using replace, users can choose:

  • replacement position:
    • inline
    • append
    • prepend
  • output format:
    • plain
    • tagged

URL handling

  • keep
  • remove
  • replace

When using replace, users can choose:

  • replacement position:
    • inline
    • append
    • prepend
  • output format:
    • plain
    • tagged
  • replacement token:
    • default: رابط
    • customizable to any language or token

Hashtag handling

  • keep
  • normalize
  • remove

Example:

  • #هاد الفيلم زوينهاد الفيلم زوين

HTML cleaning

  • Remove HTML tags for web scraping / crawling / extracted text scenarios

Dataset-level preprocessing

For each operation, LIAS_Labrary also provides *_data functions that:

  • process a selected column in a pandas DataFrame
  • preserve the full dataset
  • return the dataset with the processed column added or updated

Design Principles

LIAS_Labrary follows a conservative preprocessing philosophy:

  • It preserves original Arabic letters
  • It does not perform aggressive Arabic letter normalization
  • It avoids transformations such as:
    • أ / إ / آ → ا
    • ى → ي
    • ة → ه
    • simplification of ؤ / ئ

This choice helps preserve orthographic information for:

  • pretrained language models
  • later lemmatization
  • future transcoding or advanced linguistic processing

Installation

From PyPI

pip install LIAS_Labrary

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lias_labrary-0.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lias_labrary-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file lias_labrary-0.2.0.tar.gz.

File metadata

  • Download URL: lias_labrary-0.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for lias_labrary-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2d6d532b98f09e6dec6251c1b1b73d3de3f6f8c85c89bbc8146c5c4db667027b
MD5 c85442028d8a8d710e3f5e3174415def
BLAKE2b-256 84c6d3cf4941dc59bbfc5b6c076eb052943e81707bfd066a9cc9ebe6947ea227

See more details on using hashes here.

File details

Details for the file lias_labrary-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lias_labrary-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for lias_labrary-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d838d426045b4b167c2d5686fd3d88b62e02bbd2c2fc4db374ada47afd4c457
MD5 5d3874e49d83d986083d837731079c49
BLAKE2b-256 922dd7b0ad04d1ab3d68cdbcaade8d9fc44aecd0117d3c53eede5f017d7f0a9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page