Giter Site home page Giter Site logo

mtuoc / mtuoc_eflomal_aligner Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 24 KB

Scripts to align parallel corpora at word or subword level using eflomal. Useful for training with guided alignment.

License: GNU General Public License v3.0

Python 100.00%

mtuoc_eflomal_aligner's Introduction

MTUOC_eflomal_aligner

Scripts to align parallel corpora at word or subword level using eflomal. Useful for training with guided alignment.

Requirements

These scripts needs eflomal (https://github.com/robertostling/eflomal). Follow the installation instructions of eflomal:

Clone the eflomal repository or download the zip:

git clone https://github.com/robertostling/eflomal.git
cd eflomal
python3 -m pip install .

Using the script

You can access the help of the program with the -h option:

python3 MTUOC_eflomal_aligner.py -h
usage: MTUOC_eflomal_aligner.py [-h] [--cL1 CL1] [--cL2 CL2] [--sL1 SL1] [--sL2 SL2] [--fwd FWD] [--rev REV]
                                [--inpriors INPRIORS] [--outpriors OUTPRIORS] [--limit LIMIT]

MTUOC_eflomal_aligner: command line tool to align a corpus or a pair of sentences using eflomal.

options:
  -h, --help            show this help message and exit
  --cL1 CL1             The corpus for language 1 (for corpus mode).
  --cL2 CL2             The corpus for language 2 (for corpus mode).
  --sL1 SL1             The sentence for language 1 (for sentence mode).
  --sL2 SL2             The sentence for language 2 (for sentence mode).
  --fwd FWD             The forward alignment.
  --rev REV             The reverse alignment.
  --inpriors INPRIORS   The input priors file to use. If not stated, not priors files will be used to start with the
                        alignment. This parameter is compulsory when aligning sentences.
  --outpriors OUTPRIORS
                        The output priors file that will be generated after the alignment. If not stated, the priors
                        files will be called eflomal.priors.
  --limit LIMIT         The limit of sentences to process.

If we need to align de train corpora: train.sp.en and train.sp.es, we should write`:

python3 MTUOC_eflomal_aligner.py --cL1 train.sp.en --cL2 train.sp.es --fwd train.sp.en.es.align --rev train.sp.en.es.align --outpriors eng-spa.priors

In train.sp.en.es.align we have the alignments if we want to train an English-Spanish system.

If we want to train the reverse system, Spanish-English, we can use the rev output, that is, the file train.sp.es.en.align. We don't need to rerun the script again.

mtuoc_eflomal_aligner's People

Contributors

mtuoc avatar

Watchers

 avatar

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.