# n-gram individual BLEU
from nltk.translate.bleu_score import sentence_bleu
reference = [["this", "is", "a", "test"]]
candidate = ["this", "is", "a", "test"]
print(
"Individual 1-gram: %f" % sentence_bleu(reference, candidate, weights=(1, 0, 0, 0))
)
print(
"Individual 2-gram: %f" % sentence_bleu(reference, candidate, weights=(0, 1, 0, 0))
)
print(
"Individual 3-gram: %f" % sentence_bleu(reference, candidate, weights=(0, 0, 1, 0))
)
print(
"Individual 4-gram: %f" % sentence_bleu(reference, candidate, weights=(0, 0, 0, 1))
)