始める無料で始める

EM による評価

Exact Matchは、抽出型の質問応答においてモデルを評価するのに役立ちます。というのも、そう、完全一致を探すからです! ここでも、評価のために predictions と references があなたに提供されています。evaluate ライブラリはあらかじめ読み込まれています。

この演習はコースの一部です

Python で学ぶ LLM の入門

コースを見る

演習の手順

  • Exact Match メトリクスを読み込みましょう。
  • Exact Match スコアを計算し、結果を表示しましょう。

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# Load the metric
exact_match = ___

predictions = ["It's a wonderful day", "I love dogs", "DataCamp has great AI courses", "Sunshine and flowers"]
references = ["What a wonderful day", "I love cats", "DataCamp has great AI courses", "Sunsets and flowers"]

# Compute the exact match and print the results
results = ____
print("EM results: ", ____)
コードを編集して実行