Giter Site home page Giter Site logo

evalnmt's Introduction

evalNMT

Automatic evaluation metrics used in text generation tasks, including BLEU, ROUGE-L and METEOR, ...

Preinstall

Install package psutil prettytable through pip:

pip install psutil prettytable

Result Evaluation

Compute the metrics score by running eval.py with the reference file path and the inference result path specified.

python eval.py  --gold_dir  [The path of the reference file] --prd_dir [The path of the predicted file]

If your predict file or gold file already have row ids, you can choose option --prd_index and --gold_index instead.

For example,

  • With files without contain row ids

    python3 eval.py --prd_dir results/test.output --gold_dir results/test.gold

    Ouput

    Refs:  6406
    Preds:  6406
    BLEU: 16.72
    Meteor:  10.67
    Rouge-L:  14.82
    Cider:  0.98
    EM:  8.57
    Precision:  15.2
    Recall:  15.15
    
  • With files contain row ids

    python3 eval.py --prd_dir results/index.test.output --gold_dir results/index.test.gold --prd_index --gold_index

    Ouput

    Refs:  25726
    Preds:  25726
    BLEU: 18.11
    Meteor:  10.12
    Rouge-L:  22.49
    Cider:  0.43
    EM:  0.72
    Precision:  27.34
    Recall:  22.28
    

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.