Skip to main content

Seq2seq model with attention for automatic orthographic simplification

Project description

ortografix

GitHub release PyPI release Build MIT License

Welcome to ortografix, a seq2seq model for automatic ortografic simplification, coded with pytorch 1.4.

Install

via pip:

pip3 install ortografix

or, after a git clone:

python3 setup.py install

Train

To train a model, run:

ortografix train \
--data /abs/path/to/training/data \
--model-type gru \
--shuffle \
--hidden-size 256 \
--num-layers 1 \
--bias \
--dropout 0 \
--learning-rate 0.01 \
--epochs 10 \
--print-every 100 \
--use-teacher-forcing \
--teacher-forcing-ratio 0.5 \
--output-dirpath /abs/path/to/output/directory/whereto/save/model \
--with-attention \
--character-based

Test

Qualitative evaluation

To qualitatively evaluate the output of the model on a set of 10 randomly selected sentences from a given dev/test set, run:

ortografix evaluate \
--data /abs/path/to/test/data.txt \
--model /abs/path/to/model/directory/ \
--random 10

Quantitative evaluation

To quantitatively evaluate the output of the model on a given dev/test set, run:

ortografix evaluate \
--data /abs/path/to/test/data.txt \
--model /abs/path/to/model/directory

Quantitative evaluation will return:

  1. The sum of all edit (Levenshtein) distance computed across all test pairs
  2. The average edit distance computed across all test pairs
  3. The average normalized edit distance
  4. The average normalized edit similarity

All measure are computed via textdistance.

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

ortografix-0.3.5.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file ortografix-0.3.5.tar.gz.

File metadata

  • Download URL: ortografix-0.3.5.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.6.5

File hashes

Hashes for ortografix-0.3.5.tar.gz
Algorithm Hash digest
SHA256 d98e6ebed7f61b010dc0999f8722f0a8331086efd2825beac892d904982bd0af
MD5 16941a1ab7489d3dd41867f4b0db4bd1
BLAKE2b-256 b9b3d12daa89d7b239669203f59512875cd6ab280cfebb1f1dee8f434185603f

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