Skip to main content

Command-line application to automatically restore the diacritics of an Arabic text.

Project description

Multi-components system for automatic Arabic diacritics restoration

About

This tool is a command-line application written in Python 3 that automatically add diacritics to raw undiacritized Arabic text. To accomplish this task, it uses several techniques: Deep Learning, rule-based and statistical corrections. The deep learning part was implemented using Tensorflow. It was released as a support for the research paper: "Multi-components system for automatic Arabic diacritization" at ECIR2020.

Installation

This tool is available as a Python 3 package pipeline-diacritizer installable through pip. For installation instructions check the Download and installation wiki page.

Functions

This tool has 4 main functions: preprocessing of the data, training on the processed data, testing, and restoring the diacritics of an undiacritized text. In addition, it can calculates some statistics on a given dataset and the ratio of Out-of-Vocabulary words in a testing set according to a train set.

This is a quick introduction to the most important ones, without mentioning all the possible options for each one. For additional options, consider calling any subcommand with the option --help or -h (ex: pipeline_diacritizer train --help) or check the wiki for more details.

Preprocessing

Before feeding the new data to this application for training or testing, it needs to be converted to the standard format of this application: one sentence per line, where a sentence is delimited by a dot, a comma, or an end of line character.

$ pipeline_diacritizer process <source_file> <destination_file>

If the data is not yet partitioned into training, validation and testing sets, the program can help in this task using the following command:

$ pipeline_diacritizer partition <dataset_file>

Training

To run the training and validation on selected training/validation sets, use the next command:

$ pipeline_diacritizer train --train-data <train_file> --val-data <val_file>

Testing

To evaluate the performances of the application on a testing set, use this command:

$ pipeline_diacritizer test <test_file>

Diacritization

The following command restores the diacritics of the Arabic words from the supplied text file and outputs a diacritized copy:

$ pipeline_diacritizer diacritize <text_file>

Statistics

To get some statistics about the dataset, such as the count of tokens, arabic words, numbers... use the following command:

$ pipeline_diacritizer stat <dataset_file>

OoV Counting

To calculate the ratio of the Out-of-Vocabulary words between the train set and the validation/test set, use the next command:

$ pipeline_diacritizer oov <train_file> <test_file>

License

Pipeline-diacritizer code is licensed under MIT License.

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

pipeline_diacritizer-1.0.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

pipeline_diacritizer-1.0.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file pipeline_diacritizer-1.0.2.tar.gz.

File metadata

  • Download URL: pipeline_diacritizer-1.0.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for pipeline_diacritizer-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1cb39f488aa0c383d1e2b2a9ee6f9a908295bdda3fcf10e9fd72cf7d226ee238
MD5 df9a64b6b3252072e2c606684d17388e
BLAKE2b-256 79e63a539d9e13b69a063d753f60670a2eb2f2a860c89038051e9402bb98831d

See more details on using hashes here.

File details

Details for the file pipeline_diacritizer-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pipeline_diacritizer-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for pipeline_diacritizer-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16e12358ba8fa0c4c54da4450abe179eec2114ea8147c477d6ad4629421122d4
MD5 30a27f1e710888ad24592bd9f2299dce
BLAKE2b-256 17d64d519521a0195827b63eecda67a077713f814606c0f6caa759fcb76c9d21

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