使用 METEOR 进行评估
METEOR 擅长评估文本中更偏语义的特征。它的工作方式与 ROUGE 类似,通过将模型生成的输出与参考输出进行比较来打分。现在已为您提供了 generated 和 reference 这两段文本;请您来评估它们的分数。
evaluate 库已为您加载。
本练习是课程的一部分
Python 中的 LLM 入门
练习说明
- 计算并打印 METEOR 分数。
交互式实操练习
通过完成这段示例代码来试试这个练习。
meteor = evaluate.load("meteor")
generated = ["The burrow stretched forward like a narrow corridor for a while, then plunged abruptly downward, so quickly that Alice had no chance to stop herself before she was tumbling into an extremely deep shaft."]
reference = ["The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well."]
# Compute and print the METEOR score
results = ____
print("Meteor: ", ____)