Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.BLEU Class Reference

List of all members.

Static Public Member Functions

static double computeSentenceBleu (String[] refSents, String hypSent)
static double computeSentenceBleu (String[] refSents, String hypSent, boolean doNgramClip, int bleuOrder, boolean useShortestRef)
static double computeEffectiveLen (int[] refLens, boolean useShortestRef)
static HashMap< String, Integer > constructMaxRefCountTable (String[] refSents, int bleuOrder)
static HashMap< String, Integer > computeMaxRefCountTbl (List< HashMap< String, Integer >> listRefNgramTbl)
static double computeSentenceBleu (double effectiveRefLen, HashMap< String, Integer > maxRefCountTbl, int hypLen, HashMap< String, Integer > hypNgramTbl, boolean doNgramClip, int bleuOrder)
static double computeSentenceBleu (String refSent, String hypSent, boolean doNgramClip, int bleuOrder)
static double computeSentenceBleu (int refLen, HashMap< String, Integer > refNgramTbl, int hypLen, HashMap< String, Integer > hypNgramTbl, boolean doNgramClip, int bleuOrder)
static double computeBleu (int hypLen, double refLen, int[] numNgramMatch, int bleuOrder)
static HashMap< String, Integer > constructNgramTable (String sentence, int bleuOrder)
static double computeLinearCorpusGain (double[] linearCorpusGainThetas, String[] refSents, String hypSent)
static double computeLinearCorpusGain (double[] linearCorpusGainThetas, int hypLength, Map< String, Integer > hypNgramTable, Map< String, Integer > referenceNgramTable)
static int[] computeNgramMatches (String[] refSents, String hypSent)
static int[] computeNgramMatches (int hypLength, Map< String, Integer > hypNgramTable, Map< String, Integer > referenceNgramTable, int highestOrder)
static double[] computeLinearCorpusThetas (int numUnigramTokens, double unigramPrecision, double decayRatio)

Detailed Description

this class implements: (1) sentence-level bleu, with smoothing

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Member Function Documentation

static double joshua.decoder.BLEU.computeBleu ( int  hypLen,
double  refLen,
int[]  numNgramMatch,
int  bleuOrder 
) [static]

Here is the caller graph for this function:

static double joshua.decoder.BLEU.computeEffectiveLen ( int[]  refLens,
boolean  useShortestRef 
) [static]

Here is the caller graph for this function:

static double joshua.decoder.BLEU.computeLinearCorpusGain ( double[]  linearCorpusGainThetas,
String[]  refSents,
String  hypSent 
) [static]

Here is the call graph for this function:

static double joshua.decoder.BLEU.computeLinearCorpusGain ( double[]  linearCorpusGainThetas,
int  hypLength,
Map< String, Integer >  hypNgramTable,
Map< String, Integer >  referenceNgramTable 
) [static]

speed consideration: assume hypNgramTable has a smaller size than referenceNgramTable does

Here is the call graph for this function:

static double [] joshua.decoder.BLEU.computeLinearCorpusThetas ( int  numUnigramTokens,
double  unigramPrecision,
double  decayRatio 
) [static]
static HashMap<String, Integer> joshua.decoder.BLEU.computeMaxRefCountTbl ( List< HashMap< String, Integer >>  listRefNgramTbl) [static]

compute max_ref_count for each ngram in the reference sentences

Here is the caller graph for this function:

static int [] joshua.decoder.BLEU.computeNgramMatches ( String[]  refSents,
String  hypSent 
) [static]

Here is the call graph for this function:

static int [] joshua.decoder.BLEU.computeNgramMatches ( int  hypLength,
Map< String, Integer >  hypNgramTable,
Map< String, Integer >  referenceNgramTable,
int  highestOrder 
) [static]

Here is the call graph for this function:

static double joshua.decoder.BLEU.computeSentenceBleu ( String[]  refSents,
String  hypSent 
) [static]

Here is the caller graph for this function:

static double joshua.decoder.BLEU.computeSentenceBleu ( String[]  refSents,
String  hypSent,
boolean  doNgramClip,
int  bleuOrder,
boolean  useShortestRef 
) [static]
Parameters:
refSents
hypSent
doNgramClipShould usually be true
bleuOrderShould usually be 4
useShortestRefProbably use false

Here is the call graph for this function:

static double joshua.decoder.BLEU.computeSentenceBleu ( double  effectiveRefLen,
HashMap< String, Integer >  maxRefCountTbl,
int  hypLen,
HashMap< String, Integer >  hypNgramTbl,
boolean  doNgramClip,
int  bleuOrder 
) [static]

Here is the call graph for this function:

static double joshua.decoder.BLEU.computeSentenceBleu ( String  refSent,
String  hypSent,
boolean  doNgramClip,
int  bleuOrder 
) [static]

Here is the call graph for this function:

static double joshua.decoder.BLEU.computeSentenceBleu ( int  refLen,
HashMap< String, Integer >  refNgramTbl,
int  hypLen,
HashMap< String, Integer >  hypNgramTbl,
boolean  doNgramClip,
int  bleuOrder 
) [static]

Here is the call graph for this function:

static HashMap<String, Integer> joshua.decoder.BLEU.constructMaxRefCountTable ( String[]  refSents,
int  bleuOrder 
) [static]

words in the ngrams are using integer symbol ID

Here is the call graph for this function:

Here is the caller graph for this function:

static HashMap<String, Integer> joshua.decoder.BLEU.constructNgramTable ( String  sentence,
int  bleuOrder 
) [static]

Here is the call graph for this function:

Here is the caller graph for this function: