nltk.test.unit.translate.test_bleu module

Tests for BLEU translation evaluation metric

class nltk.test.unit.translate.test_bleu.TestBLEU[source]

Bases: TestCase

test_modified_precision()[source]

Examples from the original BLEU paper https://www.aclweb.org/anthology/P02-1040.pdf

test_brevity_penalty()[source]
test_zero_matches()[source]
test_full_matches()[source]
test_partial_matches_hypothesis_longer_than_reference()[source]
class nltk.test.unit.translate.test_bleu.TestBLEUFringeCases[source]

Bases: TestCase

test_case_where_n_is_bigger_than_hypothesis_length()[source]
test_empty_hypothesis()[source]
test_length_one_hypothesis()[source]
test_empty_references()[source]
test_empty_references_and_hypothesis()[source]
test_reference_or_hypothesis_shorter_than_fourgrams()[source]
class nltk.test.unit.translate.test_bleu.TestBLEUvsMteval13a[source]

Bases: TestCase

test_corpus_bleu()[source]
class nltk.test.unit.translate.test_bleu.TestBLEUWithBadSentence[source]

Bases: TestCase

test_corpus_bleu_with_bad_sentence()[source]
class nltk.test.unit.translate.test_bleu.TestBLEUWithMultipleWeights[source]

Bases: TestCase

test_corpus_bleu_with_multiple_weights()[source]