GithubHelp home page GithubHelp logo

ymoslem / mt-evaluation Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 7.0 31 KB

Machine Translation (MT) Evaluation Scripts

Home Page: https://blog.machinetranslation.io/tag/machine-translation-evaluation/

Python 100.00%
mt-evaluation machine-translation bleu wer

mt-evaluation's Introduction

MT-Evaluation

Machine Translation (MT) Evaluation Scripts

Tutorials for this repository can be found at: https://blog.machinetranslation.io/tag/machine-translation-evaluation/

Installation

All dependencies can be installed via:

pip3 install -r requirements.txt

Usage

To run the Python scripts and calculate the MT evaluation metrics on your machine translation output, you need to have two files:

  1. Reference: It is the human translation (target) file of your test dataset.
  2. System: It is the MTed translation/prediction, generated by the machine translation model for the source of the same test dataset used for “Reference”.

BLEU

Corpus BLEU: Calculates the BLEU score for the whole corpus and prints the result.

python3 compute-bleu.py Reference.txt System.txt

Sentence BLEU: Calculates the BLEU score for sentence by sentence and saves the result to a file.

python3 compute-bleu-sentence.py Reference.txt System.txt

METEOR

Sentence METEOR: Note that METEOR works on the sentence level only.

python3 sentence-meteor.py Reference.txt System.txt

WER

Corpus WER: Calculates the WER score for the whole corpus and prints the result.

python3 corpus-wer.py Reference.txt System.txt

Sentence WER: Calculate the WER score for sentence by sentence and saves the result to a file.

python3 sentence-wer.py Reference.txt System.txt

Questions

If you have questions or suggestions, please feel free to contact me.

mt-evaluation's People

Contributors

ymoslem avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

mt-evaluation's Issues

unexpected keyword argument 'standardize'

Hi,
corpus-wer.py gets the error
Traceback (most recent call last): File "/mnt/c/Users/clara.ginovart/Desktop/alocai/corpus-wer.py", line 28, in <module> wer_score = wer(refs, preds, standardize=True) # "standardize" expands abbreviations TypeError: wer() got an unexpected keyword argument 'standardize'

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.