使用 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: ", ____)