GithubHelp home page GithubHelp logo

vieenrose / tonalizer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 5.04 MB

Tonalizer - CRF-based Tone Reconstitution Tool

Home Page: http://www.er-tim.fr/

Python 97.48% Shell 2.52%
tonalizer diacritization machine-learning crfsuite accents nlp-machine-learning

tonalizer's Introduction

Tonalizer - CRF-based Tone Reconstitution Tool

Introduction

In many languages such as Bambara or Arabic, tone markers (diacritics) may be written but are actually often omitted. Lack of tone markers contribute to ambiguities and subsequent difficulties when reading texts. To circumvent this problem, tonalization may be used, as a word sense disambiguation task, relying on context to add diacritics that partially disambiguate words as well as senses.

Objective

Tonalizer we propose here models tonalizaion of a tonalized text in UTF-8, and generate a model file. With the model file leant, tonalizer can performs reconstitue tone markers of a new raw text without diacritics.

System Requirements

  • python >= 2.4
  • python-Levenshtein
  • python-crfsuite
  • nltk

Installation

  • Unix-like Operating System (Linux, MacOS)
sudo pip install python-Levenshtein python-crfsuite nltk

General Functions

Undiacritizing

  • Undiacritize a UTF-8 stream received by stdin and show result to stdout
PROGRAM | python tonalizer.py -u
  • Undiacritize a UTF-8 raw text (.txt) and show result to stdout
python tonalizer.py -i infile -u
  • Undiacritize a UTF-8 raw text (.txt) and save result to file
python tonalizer.py -i infile -u -o outfile

Training

  • Generate a model file from a diacritized text, then store it in a file and show accuracy to screen
python tonalizer.py -i infile -l model -s report.csv
  • Generate a model file from a UTF-8 stream received by stdin, then store it in a file and show accuracy to screen
PROGRAM | python tonalizer.py -l model -s report.csv

Diacritizing

  • Use a model to recover diacrtize of a UTF-8 stream, then outputs to screen
PROGRAM | python tonalizer.py -d model 
  • Use a model to recover diacrtize of a new text, then outputs to a file
python tonalizer.py -i infile -d model -o outfile
  • Use a model to recover diacrtize of a UTF-8 stream, then outputs to a file
PROGRAM | python tonalizer.py -d model -o outfile 

Using pre-trained models

  • French
PROGRAM | python tonalizer.py -d models/fr.mdl 
  • Arabic
PROGRAM | python tonalizer.py -d model 

Experiment Results (Preliminary)

Ressource File Size File Name Language Accuracy Train/Test Ratio
Project Gutenberg. 696 KB pg17489.txt French 0.975 90 : 10
T. Zerrouki et al. معالم القربة في طلب الحسبة.txt Arabic

Reference

  • Project Gutenberg. (n.d.). Retrieved July 26, 2017, from www.gutenberg.org. link
  • T. Zerrouki, A. Balla, Tashkeela: Novel corpus of Arabic vocalized texts, data for auto-diacritization systems, Data in Brief (2017) link

tonalizer's People

Contributors

eldams avatar vieenrose avatar

Watchers

 avatar

Forkers

eldams levis0045

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.