• This repository has been archived on 06/Feb/2018
  • Stars
    star
    195
  • Rank 199,374 (Top 4 %)
  • Language
    HTML
  • License
    Other
  • Created about 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An interface to and, in time, a Python reimplementation of the ROUGE package for evaluating summarization

pyrouge

A Python interface to the ROUGE package.

Right now, only the basic functionality is in place. You can score one summary at a time with respect to multiple reference summaries. Down the road, the plan is to reimplement (parts of) ROUGE in pure Python. The motivation is that the ROUGE package, while standard in evaluation of extractive summaries, can be a challenge to obtain and install, and also does not fit well in a Python workflow.

Contributions and suggestions are very welcome.

Usage example

from pyrouge import Rouge155
from pprint import pprint

ref_texts = {'A': "Poor nations pressurise developed countries into granting trade subsidies.",
             'B': "Developed countries should be pressurized. Business exemptions to poor nations.",
             'C': "World's poor decide to urge developed nations for business concessions."}
summary_text = "Poor nations demand trade subsidies from developed nations."


rouge = Rouge155(n_words=100)
score = rouge.score_summary(summary_text, ref_texts)
pprint(score)

The output will be this:

{'rouge_1_f_score': 0.76879,
 'rouge_1_f_score_cb': 0.76879,
 'rouge_1_f_score_ce': 0.76879,
 'rouge_1_precision': 0.86928,
 'rouge_1_precision_cb': 0.86928,
 'rouge_1_precision_ce': 0.86928,
 'rouge_1_recall': 0.68912,
 'rouge_1_recall_cb': 0.68912,
 'rouge_1_recall_ce': 0.68912,
 'rouge_2_f_score': 0.52941,
 'rouge_2_f_score_cb': 0.52941,
 'rouge_2_f_score_ce': 0.52941,
 'rouge_2_precision': 0.6,
 'rouge_2_precision_cb': 0.6,
 'rouge_2_precision_ce': 0.6,
 'rouge_2_recall': 0.47368,
 'rouge_2_recall_cb': 0.47368,
 'rouge_2_recall_ce': 0.47368,
 'rouge_3_f_score': 0.39521,
 'rouge_3_f_score_cb': 0.39521,
 'rouge_3_f_score_ce': 0.39521,
 'rouge_3_precision': 0.44898,
 'rouge_3_precision_cb': 0.44898,
 'rouge_3_precision_ce': 0.44898,
 'rouge_3_recall': 0.35294,
 'rouge_3_recall_cb': 0.35294,
 'rouge_3_recall_ce': 0.35294,
 'rouge_4_f_score': 0.34147,
 'rouge_4_f_score_cb': 0.34147,
 'rouge_4_f_score_ce': 0.34147,
 'rouge_4_precision': 0.38889,
 'rouge_4_precision_cb': 0.38889,
 'rouge_4_precision_ce': 0.38889,
 'rouge_4_recall': 0.30435,
 'rouge_4_recall_cb': 0.30435,
 'rouge_4_recall_ce': 0.30435,
 'rouge_su4_f_score': 0.61313,
 'rouge_su4_f_score_cb': 0.61313,
 'rouge_su4_f_score_ce': 0.61313,
 'rouge_su4_precision': 0.6977,
 'rouge_su4_precision_cb': 0.6977,
 'rouge_su4_precision_ce': 0.6977,
 'rouge_su4_recall': 0.54685,
 'rouge_su4_recall_cb': 0.54685,
 'rouge_su4_recall_ce': 0.54685}

Run tests

The unit tests can be run be issuing ``nosetests´´ from the root directory of the package.

More Repositories

1

framenet-annotation

Browser-based annotation tool for Framenet
Python
16
star
2

dependency_decoding

Chu-Lui-Edmonds decoding extracted from TurboParser
C++
14
star
3

word2vec_sampler

A Python implementation of word2vec that allows custom sampling strategies
Python
9
star
4

scientific-programming-2015

Course website for Scientific Programming 2015. IT & Cognition, University of Copenhagen
Python
6
star
5

andreord-public

A Danish Wordnet (Dannet) browser
Ruby
6
star
6

danish_dependency_parser

Scripts for training and running a part-of-speech tagger and a dependency parser for Danish
Python
5
star
7

any-language-frames

Multilingual datasets for the paper "Any-language frame-semantic parsing"
5
star
8

fortuitous-esslli

Slides and supplementary material for ESSLLI 2016 course on fortuitous data
JavaScript
2
star
9

active_schema

Association discovery with foreign keys
Ruby
1
star
10

scientific-programming-2014

Course in scientific programming 2014 at University of Copenhagen
Python
1
star
11

hanstholm

Hanstholm is a dependency parser that deals with ambiguity in part-of-speech tags
C++
1
star
12

xrff

TODO: one-line summary of your gem
Ruby
1
star
13

activerecord-mysql2legacydb-adapter

TODO: one-line summary of your gem
Ruby
1
star
14

arff

TODO: one-line summary of your gem
Ruby
1
star
15

gem_geometry

TODO: one-line summary of your gem
Ruby
1
star
16

babelnet-query

A few command line tools for querying the BabelNet API
Java
1
star
17

nlpkit

Python
1
star
18

cpr_adressematch

"API" for parsing and preparing files for Adressematch from Det Centrale Personregister
Ruby
1
star
19

inverted_index_embeddings

Create cross-lingual embeddings from comparable text (e.g. wikipedia articles in different languages)
1
star