Package rouge

Examples of rouge.RougeN


  System.out.println("ROUGE-" + parsedArgs.getInt(Config.GRAM_SIZE.toString()));
  IRouge rouge = null;
  RougeN.DEBUG = parsedArgs.getBoolean(Config.VERBOSE.toString());
  for (IRougeSummaryModel document : results.keySet())
  {
      rouge = new RougeN(
        document,
        results.get(document),
        parsedArgs.getInt(Config.BYTE_LIMIT.toString()),
        parsedArgs.getInt(Config.WORD_LIMIT.toString()),
        parsedArgs.getInt(Config.GRAM_SIZE.toString()),
View Full Code Here


 
  System.out.println("ROUGE-N");
  IRouge rouge = null;
  for (IRougeSummaryModel system : results.keySet())
  {
      rouge = new RougeN(system, results.get(system), Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);
      Map<ScoreType, Double> scores = rouge.evaluate();
      r += scores.get(ScoreType.R);
      p += scores.get(ScoreType.P);
      f += scores.get(ScoreType.F);
  }
View Full Code Here

    @Test
    public void rouge2_SameTextAsGoldStandard()
    {
  Set<IRougeSummaryModel> s = new HashSet<IRougeSummaryModel>();
  s.add(testSummary1);
  rouge = new RougeN(testSummary1, s, Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(1, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(1, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

  text.setTitle("hello world");
  IRougeSummaryModel gs = new RougeSummaryModel(null);
  gs.setTitle("nothing of the above");
  Set<IRougeSummaryModel> s = new HashSet<IRougeSummaryModel>();
  s.add(gs);
  rouge = new RougeN(text, s, Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(0, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(0, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

    }

    @Test
    public void rouge2_textAndTwoGoldStandard()
    {
  rouge = new RougeN(testSummary1, refSummaries1, Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(0.33659, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(0.32857, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

    }

    @Test
    public void rouge2_TwoTextsWithTwoGoldStandards()
    {
  rouge = new RougeN(testSummary1, refSummaries1, Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);

  Map<ScoreType, Double> resultsTest1 = rouge.computeNGramScore();

  rouge = new RougeN(testSummary2, refSummaries2, Integer.MAX_VALUE, Integer.MAX_VALUE, 2, 'A', 0.5);

  Map<ScoreType, Double> resultsTest2 = rouge.computeNGramScore();

  double r = (resultsTest1.get(ScoreType.R) + resultsTest2.get(ScoreType.R))/2.0;
  double p = (resultsTest1.get(ScoreType.P) + resultsTest2.get(ScoreType.P))/2.0;
View Full Code Here

    @Test
    public void rouge1_SameTextAsGoldStandard()
    {
  Set<IRougeSummaryModel> s = new HashSet<IRougeSummaryModel>();
  s.add(testSummary1);
  rouge = new RougeN(testSummary1, s, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(1, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(1, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

  text.setTitle("hello world");
  IRougeSummaryModel gs = new RougeSummaryModel(null);
  gs.setTitle("nothing of the above");
  Set<IRougeSummaryModel> s = new HashSet<IRougeSummaryModel>();
  s.add(gs);
  rouge = new RougeN(text, s, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(0, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(0, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

    }

    @Test
    public void rouge1_textAndTwoGoldStandard()
    {
  rouge = new RougeN(testSummary1, refSummaries1, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 'A', 0.5);

  Map<ScoreType, Double> results = rouge.computeNGramScore();

  assertEquals(0.61353, results.get(ScoreType.R), Math.pow(10, -5));
  assertEquals(0.59906, results.get(ScoreType.P), Math.pow(10, -5));
View Full Code Here

    }

    @Test
    public void rouge1_TwoTextsWithTwoGoldStandards()
    {
  rouge = new RougeN(testSummary1, refSummaries1, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 'A', 0.5);

  Map<ScoreType, Double> resultsTest1 = rouge.computeNGramScore();

  rouge = new RougeN(testSummary2, refSummaries2, Integer.MAX_VALUE, Integer.MAX_VALUE, 1, 'A', 0.5);

  Map<ScoreType, Double> resultsTest2 = rouge.computeNGramScore();

  double r = (resultsTest1.get(ScoreType.R) + resultsTest2.get(ScoreType.R))/2.0;
  double p = (resultsTest1.get(ScoreType.P) + resultsTest2.get(ScoreType.P))/2.0;
View Full Code Here

TOP

Related Classes of rouge.RougeN

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.