Git Product home page Git Product logo

pipeline-diacritizer's Introduction

Multi-components system for automatic Arabic diacritics restoration

Warning: This project has been deprecated due to its bad design and problems. This repository is only left because it has been referenced from the corresponding paper. For a better and newer project, check Multilevel Diacritizer.

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" which was presented in the ECIR2020 conference.

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 preprocess <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.

pipeline-diacritizer's People

Contributors

hamza5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pipeline-diacritizer's Issues

Problems installing the pipeline

Thank you for your contribution, I am trying to download and install Pipeline-diacritizer is by using pip bur i get an error that no matching distribution found. Thank you in advance.

Training error

While trying to run this on Colab:

!pipeline_diacritizer train --train-data data/train.csv --val-data data/val.csv

I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/pipeline_diacritizer", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/pipeline_diacritizer/pipeline_diacritizer.py", line 289, in main
    train(args.train_data, args.val_data, args.iterations, args.weights_dir, args.early_stop)
  File "/usr/local/lib/python3.7/dist-packages/pipeline_diacritizer/pipeline_diacritizer.py", line 105, in train
    model.train(train_data, val_data, iterations, early_stop)
  File "/usr/local/lib/python3.7/dist-packages/pipeline_diacritizer/diacritization_model.py", line 314, in train
    with open(self.get_trigrams_file_path(), 'wb') as vocab_file:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/pipeline_diacritizer/Tashkeela_params/DiacritizationModel_trigrams.pkl'

Resume Training

Does this have the ability to resume training if it was interrupted partway through?

How do I apply the tashkeela dataset to train the system?

Hi! Your code looks like a very nice work, something that's thought through thoroughly.
And it looks like you've made special preprocessing functionality for the Tashkeela dataset.
However, I'm not sure how to feed the Tashkeela dataset to train your algorithm.

Can you please help me?
Thank you,
Barney

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.