from nltk.translate.bleu_score import sentence_bleu, SmoothingFunction
#不需要分词
src='我是中人。'
tgt='我是中国人。'
smooth = SmoothingFunction()
score = sentence_bleu([src], tgt, smoothing_function=smooth.method1)
print(score)
from nltk.translate.bleu_score import sentence_bleu, SmoothingFunction
#不需要分词
src='我是中人。'
tgt='我是中国人。'
smooth = SmoothingFunction()
score = sentence_bleu([src], tgt, smoothing_function=smooth.method1)
print(score)