NLTK: corpus-level bleu vs sentence-level BLEU score

后端 未结 2 1869
我在风中等你
我在风中等你 2020-12-14 10:06

I have imported nltk in python to calculate BLEU Score on Ubuntu. I understand how sentence-level BLEU score works, but I don\'t understand how corpus-level BLEU score work.

2条回答
  •  轮回少年
    2020-12-14 10:48

    Let's take a look:

    >>> help(nltk.translate.bleu_score.corpus_bleu)
    Help on function corpus_bleu in module nltk.translate.bleu_score:
    
    corpus_bleu(list_of_references, hypotheses, weights=(0.25, 0.25, 0.25, 0.25), smoothing_function=None)
        Calculate a single corpus-level BLEU score (aka. system-level BLEU) for all 
        the hypotheses and their respective references.  
    
        Instead of averaging the sentence level BLEU scores (i.e. marco-average 
        precision), the original BLEU metric (Papineni et al. 2002) accounts for 
        the micro-average precision (i.e. summing the numerators and denominators
        for each hypothesis-reference(s) pairs before the division).
        ...
    

    You're in a better position than me to understand the description of the algorithm, so I won't try to "explain" it to you. If the docstring does not clear things up enough, take a look at the source itself. Or find it locally:

    >>> nltk.translate.bleu_score.__file__
    '.../lib/python3.4/site-packages/nltk/translate/bleu_score.py'
    

提交回复
热议问题