Giter Club home page Giter Club logo

rouge-2.0's Introduction

ROUGE 2.0

ROUGE 2.0 is an easy to use evaluation toolkit for Automatic Summarization tasks. It uses the ROUGE system of metrics which works by comparing an automatically produced summary or translation against a set of reference summaries (typically human-produced). ROUGE is one of the standard ways to compute effectiveness of auto generated summaries. To understand how ROUGE works you can read this article.

Features

The latest version of ROUGE 2.0 supports the following:

  • Evaluation of ROUGE-N (unigram, bigrams, trigrams, etc)
  • Evaluation of ROUGE-L (summary level LCS)
  • Evaluation of ROUGE-S and ROUGE-SU (skip-gram and skip-gram with unigrams)
  • Evaluation of multiple ROUGE metrics at one go
  • Stemming for different languages
  • Stopword removal with customizable stop words
  • Evaluation of unicode texts (e.g. Persian)
  • Minimal formatting requirements for system and reference summaries
  • Output in CSV โ€“ this makes it super easy for score analysis
  • Full documentation and support via GitHub Issues

This is an open-source project, so if you want to implement other measures, please read the documentation on how to contribute to this project.

Quick Start

  • Ensure you have Java 1.8 and above installed. You only need the JRE.
  • Download latest version of ROUGE 2.0 distribution zip file
  • Unpack the zip file
  • Move into the ROUGE 2.0 directory cd <rouge2-1.x-runnable>
  • Do a test run: java -jar rouge2-1.x.jar. You should see results in the console and in rouge2-1.x-runnable/results.csv
  • The above step uses the sample summarization tasks under rouge2-1.x-runnable/projects/test-summarization and the default settings in rouge2-1.x-runnable/rouge.properties file.
  • Use the full documentation for summary formatting guidelines and making changes to the settings, etc.
  • To make changes to the ROUGE 2.0 code base, follow the installation steps below.

Citation

To cite the ROUGE 2.0 package, please use the following:

@article{ganesan2015rouge,
  title={ROUGE 2.0: Updated and Improved Measures for Evaluation of Summarization Tasks},
  author={Ganesan, Kavita},
  year={2015}
}

You can download the ROUGE 2.0 report from arXiv.

Installation

To build on the source code of ROUGE 2.0, clone the repository and import the project as a Maven project by selecting the pom.xml file in the root directory from Eclipse, IntelliJ or other IDE's. Next, add the jars under the lib directory to your build path for the code to compile. Note that you can also install the jars in the lib directory by creating a local maven repository for those jar files. All you would need to do after that is to add the local dependencies to your pom.xml.

Reporting Issues & Feature Requests

When reporting issues please use "Github Issues" and include as much detail as possible about your operating system and java version. Whenever possible, please also include a brief, self-contained code example that demonstrates the problem. Visuals are appreciated!

If you need new features that would be useful to the community in general, please open up an issue and label it as feature-request.

Contributing to ROUGE 2.0

Thanks for your interest in contributing code to ROUGE2.0! To contribute code to ROUGE2.0, please create a new branch and submit a pull request early on with your ideas and planned changes or enhancement. Once you get the thumbs up, you can use your usual workflow for development. Your changes will be reviewed and finally accepted for inclusion. Please use meaningful commit messages that intuitively explain what you are trying to achieve.

If you are proposing new evaluation measures, your changes will be included once your paper is accepted at a conference or journal.

License

Please check this license information.

rouge-2.0's People

Contributors

kavgan avatar rxnlp avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rouge-2.0's Issues

API and deploying to maven

Hi,
Don't you have plans to create API and deploy this project as maven artifact (in any public repository)? So the other people be able to use it as a maven dependency in their project.

Why I'm asking :
I have maven project with long dataflow with text simplification, summarazation, question generation and so on. And in some parts of data processing pipeline I want to evaluate score between hypothesis and some reference. And such kind of API will be very helpful.

Thanks!

Number format exception

I want to specify multiple rouge metrics .therefore, I give ngarm properties like that
ngram=L,1,2,SU4. The error occurs "number format exception:", please help me. thank you

Exception in thread "main" java.lang.NumberFormatException: For input string: "L,1,2,SU4"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at com.rxnlp.tools.rouge.SettingsUtil.loadProps(SettingsUtil.java:62)
at com.rxnlp.tools.rouge.SettingsUtil.loadProps(SettingsUtil.java:40)
at com.rxnlp.tools.rouge.ROUGECalculator.start(ROUGECalculator.java:92)
at com.rxnlp.tools.rouge.ROUGECalculator.main(ROUGECalculator.java:86)

running the code with 'stemming=true'

I need ROUGE scores with stemming applied on summaries.
I can get the scores with default settings. But, when I change the 'rouge.properties' and set the stemmer to true (stemmer.use=true), the following exceptions are caught:

$ java -jar rouge2-1.2.1.jar
2019-06-03 15:43:07 INFO SettingsUtil:33 - Using rouge.properties='/data/azs5955/ppt_generation/rouge/java/rouge.properties'
2019-06-03 15:43:07 INFO ROUGECalculator:203 - Working on task1008 ngram=L
2019-06-03 15:43:07 INFO ROUGECalculator:203 - Working on task1008 ngram=1
2019-06-03 15:43:07 INFO ROUGECalculator:203 - Working on task1008 ngram=2
2019-06-03 15:43:07 INFO ROUGECalculator:203 - Working on task1008 ngram=SU4
2019-06-03 15:43:07 INFO ROUGECalculator:203 - Working on task1129 ngram=L
2019-06-03 15:43:07 ERROR ROUGECalculator:180 - 0
2019-06-03 15:43:07 ERROR ROUGECalculator:181 -
You need to have a valid 'references' and 'system' folder under projects/test-summarization. Please check your rouge.properties file
2019-06-03 15:43:07 ERROR ROUGECalculator:183 - 0
java.lang.ArrayIndexOutOfBoundsException: 0
at com.rxnlp.tools.rouge.ROUGECalculator.applyStemming(ROUGECalculator.java:735)
at com.rxnlp.tools.rouge.ROUGECalculator.computeRouge(ROUGECalculator.java:503)
at com.rxnlp.tools.rouge.ROUGECalculator.evaluate(ROUGECalculator.java:213)
at com.rxnlp.tools.rouge.ROUGECalculator.start(ROUGECalculator.java:172)
at com.rxnlp.tools.rouge.ROUGECalculator.main(ROUGECalculator.java:96)

any suggestion is appreciated.

Long Running Time

Hi, I am trying to get ROUGE-L of a dataset that contains around 10000 news articles and it has taken more than half an hour. Is that normal?

Running ROUGE2.jar in NodeJS and getting "stderr: java.lang.OutOfMemoryError: Java heap space" for rouge.type=topic or topicUniq

5ffb561265dba11148a76314.zip
Hi there,

I'm developing a GUI and API in NodeJS to execute ROUGE-2.0 and I'm getting some issues when I select the topic and topicUniq rouge.type.

This is the console output: (I'm getting this error when I run spawn a childprocess in NodeJS, but it happens when I run rouge from terminal only.)

I'm only using the samples references and system, in total 11 files with minor changings. I don't know if the problem is in my machine with 8GB RAM or if the references and system are not formatted properly to run rouge in topic or topicUniq.
In rouge.type=normal I can run quickly without any problem.

I can send the files I'm using

stderr: Reading POS tagger model from resources/taggers/english-bidirectional-distsim.tagger ...
stderr: done [1,4 sec].
stderr:

stdout: 2021-01-11 11:25:27 INFO ROUGECalculator:127 - Loaded...POS tagger.

stdout: 2021-01-11 11:25:27 INFO ROUGECalculator:203 - Working on task1 ngram=1

stdout: 2021-01-11 11:25:38 INFO ROUGECalculator:203 - Working on task1 ngram=2

stdout: 2021-01-11 11:25:48 INFO ROUGECalculator:203 - Working on task2 ngram=1

stderr: jan 11, 2021 11:25:48 AM edu.stanford.nlp.process.PTBLexer next
WARNING: Untokenizable: (U+8C, decimal: 140)

stderr: jan 11, 2021 11:26:28 AM edu.stanford.nlp.process.PTBLexer next
WARNING: Untokenizable: (U+87, decimal: 135)

stderr: Exception in thread "main"
stderr: java.lang.OutOfMemoryError: Java heap space
at edu.stanford.nlp.sequences.ExactBestSequenceFinder.bestSequence(ExactBestSequenceFinder.java:108)
at edu.stanford.nlp.sequences.ExactBestSequenceFinder.bestSequence(ExactBestSequenceFinder.java:31)
at edu.stanford.nlp.tagger.maxent.TestSentence.runTagInference(TestSentence.java:309)
stderr:
at edu.stanford.nlp.tagger.maxent.TestSentence.testTagInference(TestSentence.java:299)
at edu.stanford.nlp.tagger.maxent.TestSentence.tagSentence(TestSentence.java:134)
at edu.stanford.nlp.tagger.maxent.MaxentTagger.tagSentence(MaxentTagger.java:990)

stderr: at edu.stanford.nlp.tagger.maxent.MaxentTagger.tagCoreLabelsOrHasWords(MaxentTagger.java:1765)
at edu.stanford.nlp.tagger.maxent.MaxentTagger$TaggerWrapper.apply(MaxentTagger.java:1282)

stderr: at edu.stanford.nlp.tagger.maxent.MaxentTagger.tagString(MaxentTagger.java:926)
at com.rxnlp.tools.rouge.ROUGECalculator.getPOSTagged(ROUGECalculator.java:405)
at com.rxnlp.tools.rouge.ROUGECalculator.computeRouge(ROUGECalculator.java:484)

stderr: at com.rxnlp.tools.rouge.ROUGECalculator.evaluate(ROUGECalculator.java:213)
at com.rxnlp.tools.rouge.ROUGECalculator.start(ROUGECalculator.java:172)

stderr: at com.rxnlp.tools.rouge.ROUGECalculator.main(ROUGECalculator.java:96)

child process exited with code 1

Changing the path of the rouge.properties file

Hi!

I want to run ROUGE under different configurations (with and without stem and with and without stopwords) with the help of using a batch file. As such I can't keep amending the rouge.properties file.

I see there is an option the change the path to the properties file. I have tried this but it doesn't seem to work and it still reads the default properties file. I have put the rouge.properties file into a folder that uses stemming and stopwords named "stemStopword".

java -jar rouge2-1.2.1.jar -Drouge.prop="stemStopword\rouge.properties"

Can you help me with this please? Thanks!

Cheers,
Wenyi

stemming for Persian

In the name of Allah
Hello,
Thank you for your program.
I want to use it for Persian language. According to Readme I set use_synonyms to false.
Now, result when set stemmer.use=false or stemmer.use=true is the same.
Should I set anythings?
Thank you

trouble with specifying ngram= L, SU4

rouge 2.0 calculator works fine when
screenshots.docx
n-gram size assigned is an integer value (1,2,3) but throws exception in java main class when ngram is assigned a string value , eg. ngram=L,SU4 (in the rouge.properties folder). Any clue how to go about this error?

Incorrect LCS implementation

LCS algorithm is implemented incorrectly (hence the large rouge-L differences in #18 ). Function:

private static List<String> getLCSInternal(String s1, String s2) {

should not search for the longest common subsequence in a greedy way.
The following example should have rouge-L equal to 1.0:

f.stefaniuk@AMDC3754:~/Documents/other/rouge2.0$ cat ./projects/test-lcs/reference/task1_ref1.txt 
token0 xxxx token1 token2 token3 token4 xxxx token5
f.stefaniuk@AMDC3754:~/Documents/other/rouge2.0$ diff ./projects/test-lcs/reference/task1_ref1.txt ./projects/test-lcs/system/task1_system1.txt 
f.stefaniuk@AMDC3754:~/Documents/other/rouge2.0$ java -jar ./target/rouge-calculator-1.2.1-shaded.jar 

========Results Summary=======

ROUGE-L+StopWordRemoval	TASK1	SYSTEM1.TXT	Average_R:0.66667	Average_P:0.66667	Average_F:0.66667	Num Reference Summaries:1


======Results Summary End======

The correct results (using ROUGE-1.5.5 with pyrouge):

pyrouge_evaluate_plain_text_files -s ./projects/test-lcs/system/ -sfp "task(\d+)_system1.txt" -m ./projects/test-lcs/reference/ -mfp task#ID#_ref1.txt
2019-11-27 19:38:56,486 [MainThread  ] [INFO ]  Writing summaries.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Processing summaries. Saving system files to /tmp/tmpmalj10/system and model files to /tmp/tmpmalj10/model.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Processing files in ./projects/test-lcs/system/.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Processing task1_system1.txt.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Saved processed files to /tmp/tmpmalj10/system.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Processing files in ./projects/test-lcs/reference/.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Processing task1_ref1.txt.
2019-11-27 19:38:56,488 [MainThread  ] [INFO ]  Saved processed files to /tmp/tmpmalj10/model.
2019-11-27 19:38:56,489 [MainThread  ] [INFO ]  Written ROUGE configuration to /tmp/tmp7pU4tY/rouge_conf.xml
2019-11-27 19:38:56,489 [MainThread  ] [INFO ]  Running ROUGE with command /usr/local/lib/RELEASE-1.5.5/ROUGE-1.5.5.pl -e /usr/local/lib/RELEASE-1.5.5/data -c 95 -2 -1 -U -r 1000 -n 4 -w 1.2 -a -m /tmp/tmp7pU4tY/rouge_conf.xml
---------------------------------------------
1 ROUGE-1 Average_R: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-1 Average_P: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-1 Average_F: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
---------------------------------------------
1 ROUGE-2 Average_R: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-2 Average_P: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-2 Average_F: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
---------------------------------------------
1 ROUGE-3 Average_R: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-3 Average_P: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-3 Average_F: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
---------------------------------------------
1 ROUGE-4 Average_R: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-4 Average_P: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-4 Average_F: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
---------------------------------------------
1 ROUGE-L Average_R: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-L Average_P: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
1 ROUGE-L Average_F: 1.00000 (95%-conf.int. 1.00000 - 1.00000)
---------------------------------------------

Python implementation

I love all the improvements you guys made and I would love them even more if I had a quick and simple python interface like you guys have for the V1 metric.

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.