开始使用免费开始使用

为评估筛选数据集

您正在为公司的一款医疗聊天机器人构建训练与评估流水线,该机器人被医院用于新患者入院引导。

您的任务是创建一条流水线,加载 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 = ____
编辑并运行代码