為評估而篩選資料集
你正在為公司用於醫院新病患報到的醫療客服聊天機器人,建立一個訓練與評估的管線。
你的任務是建立一個管線,以載入 MedQuad-MedicalQnADataset,用來評估一個 LLM 回答醫療問題的能力。請把資料集載入到變數 ds,並只包含變數 dataset_name 所指定之資料集中 train 分割的前 500 筆樣本,作為你的評估集。
本練習屬於課程
使用 Llama 3 進行微調
練習說明
- 從
datasets匯入所需的函式與類別。 - 將資料集載入變數
ds。 - 操作
ds,只保留變數dataset_name指定之資料集中train分割的前 500 筆樣本,作為評估集。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Load neccesary imports from library
from datasets import ____, ____
# Load the training split of the dataset
ds = load_dataset(dataset_name, split=____)
# Filter for the first 500 samples of the dataset
filtered_ds = ____