All Projects → pltrdy → Files2rouge

pltrdy / Files2rouge

Licence: mit
Calculating ROUGE score between two files (line-by-line)

Programming Languages

perl
6916 projects

Projects that are alternatives of or similar to Files2rouge

Pythonrouge
Python wrapper for evaluating summarization quality by ROUGE package
Stars: ✭ 155 (+29.17%)
Mutual labels:  natural-language-processing, summarization
Unified Summarization
Official codes for the paper: A Unified Model for Extractive and Abstractive Summarization using Inconsistency Loss.
Stars: ✭ 114 (-5%)
Mutual labels:  natural-language-processing, summarization
Neusum
Code for the ACL 2018 paper "Neural Document Summarization by Jointly Learning to Score and Select Sentences"
Stars: ✭ 143 (+19.17%)
Mutual labels:  natural-language-processing, summarization
Text summarization with tensorflow
Implementation of a seq2seq model for summarization of textual data. Demonstrated on amazon reviews, github issues and news articles.
Stars: ✭ 226 (+88.33%)
Mutual labels:  natural-language-processing, summarization
Summarization Papers
Summarization Papers
Stars: ✭ 238 (+98.33%)
Mutual labels:  natural-language-processing, summarization
Nlp Papers
Papers and Book to look at when starting NLP 📚
Stars: ✭ 111 (-7.5%)
Mutual labels:  natural-language-processing, summarization
Textrank
TextRank implementation for Python 3.
Stars: ✭ 1,008 (+740%)
Mutual labels:  natural-language-processing, summarization
Pytextrank
Python implementation of TextRank for phrase extraction and summarization of text documents
Stars: ✭ 1,675 (+1295.83%)
Mutual labels:  natural-language-processing, summarization
Cogcomp Nlpy
CogComp's light-weight Python NLP annotators
Stars: ✭ 115 (-4.17%)
Mutual labels:  natural-language-processing
Haystack
🔍 Haystack is an open source NLP framework that leverages Transformer models. It enables developers to implement production-ready neural search, question answering, semantic document search and summarization for a wide range of applications.
Stars: ✭ 3,409 (+2740.83%)
Mutual labels:  summarization
Rbert
Implementation of BERT in R
Stars: ✭ 114 (-5%)
Mutual labels:  natural-language-processing
Dat8
General Assembly's 2015 Data Science course in Washington, DC
Stars: ✭ 1,516 (+1163.33%)
Mutual labels:  natural-language-processing
Pymetamap
Python wraper for MetaMap
Stars: ✭ 119 (-0.83%)
Mutual labels:  natural-language-processing
Declutr
The corresponding code from our paper "DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations". Do not hesitate to open an issue if you run into any trouble!
Stars: ✭ 111 (-7.5%)
Mutual labels:  natural-language-processing
Dialoglue
DialoGLUE: A Natural Language Understanding Benchmark for Task-Oriented Dialogue
Stars: ✭ 120 (+0%)
Mutual labels:  natural-language-processing
Tensorflow Nlp
NLP and Text Generation Experiments in TensorFlow 2.x / 1.x
Stars: ✭ 1,487 (+1139.17%)
Mutual labels:  natural-language-processing
Turkish Morphology
A two-level morphological analyzer for Turkish.
Stars: ✭ 121 (+0.83%)
Mutual labels:  natural-language-processing
Nlpcc Wordseg Weibo
NLPCC 2016 微博分词评测项目
Stars: ✭ 120 (+0%)
Mutual labels:  natural-language-processing
Nonautoreggenprogress
Tracking the progress in non-autoregressive generation (translation, transcription, etc.)
Stars: ✭ 118 (-1.67%)
Mutual labels:  natural-language-processing
Dynamic Coattention Network Plus
Dynamic Coattention Network Plus (DCN+) TensorFlow implementation. Question answering using Deep NLP.
Stars: ✭ 117 (-2.5%)
Mutual labels:  natural-language-processing

Files2ROUGE

Motivations

Given two files with the same number of lines, files2rouge calculates the average ROUGE scores of each sequence (=line). Each sequence may contain multiple sentences. In this case, the end of sentence string must be passed using the --eos flag (default: "."). Running files2rouge with a wrong eos delimiter may lead to incorrect ROUGE-L score.

You may also be interested in a Python implementation (instead of a wrapper): https://github.com/pltrdy/rouge.

$ files2rouge --help
usage: files2rouge [-h] [-v] [-a ARGS] [-s SAVETO] [-e EOS] [-m] [-i]
                   reference summary

Calculating ROUGE score between two files (line-by-line)

positional arguments:
  reference             Path of references file
  summary               Path of summary file

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Prints ROUGE logs
  -a ARGS, --args ARGS  ROUGE Arguments
  -s SAVETO, --saveto SAVETO
                        File to save scores
  -e EOS, --eos EOS     End of sentence separator (for multisentence).
                        Default: "."
  -m, --stemming        DEPRECATED: stemming is now default behavior
  -nm, --no_stemming    Switch off stemming
  -i, --ignore_empty

Getting Started

0) Install prerequisites

pip install -U git+https://github.com/pltrdy/pyrouge

(NOTE: running pip install pyrouge would not work as the package is out of date on PyPI)

1) Clone the repo, setup the module and ROUGE

git clone https://github.com/pltrdy/files2rouge.git     
cd files2rouge
python setup_rouge.py
python setup.py install

Do not forget to run setup_rouge

2) Run files2rouge.py

files2rouge references.txt summaries.txt 

Outputs: When --verbose is set, the script prints progress and remaining time on stderr. This can be changed using --verbose in order to outputs ROUGE execution logs.

Default output example:

Preparing documents...
Running ROUGE...
---------------------------------------------
1 ROUGE-1 Average_R: 0.28242 (95%-conf.int. 0.25721 - 0.30877)
1 ROUGE-1 Average_P: 0.30157 (95%-conf.int. 0.27114 - 0.33506)
1 ROUGE-1 Average_F: 0.28196 (95%-conf.int. 0.25704 - 0.30722)
---------------------------------------------
1 ROUGE-2 Average_R: 0.10395 (95%-conf.int. 0.08298 - 0.12600)
1 ROUGE-2 Average_P: 0.11458 (95%-conf.int. 0.08873 - 0.14023)
1 ROUGE-2 Average_F: 0.10489 (95%-conf.int. 0.08303 - 0.12741)
---------------------------------------------
1 ROUGE-L Average_R: 0.25231 (95%-conf.int. 0.22709 - 0.27771)
1 ROUGE-L Average_P: 0.26830 (95%-conf.int. 0.23834 - 0.29818)
1 ROUGE-L Average_F: 0.25142 (95%-conf.int. 0.22741 - 0.27533)

Elapsed time: 0.458 secondes

Call files2rouge from Python

import files2rouge
files2rouge.run(hyp_path, ref_path)

ROUGE Args

One can specify which ROUGE args to use using the flag --args (or -a).
The default behavior is equivalent to:

files2rouge reference.txt summary.txt -a "-c 95 -r 1000 -n 2 -a" # be sure to write args betwen double-quotes

You can find more informations about these arguments here

Known issues

  • ROUGE-1.5.5.pl - XML::Parser dependency error: see issue #9.

More informations

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].