five

macadeliccc/distilabel-neurology-preferences-2k

收藏
Hugging Face2024-02-18 更新2024-03-04 收录
下载链接:
https://hf-mirror.com/datasets/macadeliccc/distilabel-neurology-preferences-2k
下载链接
链接失效反馈
官方服务:
资源简介:
--- dataset_info: features: - name: input dtype: string - name: generation_model sequence: string - name: generation_prompt list: list: - name: content dtype: string - name: role dtype: string - name: raw_generation_responses sequence: string - name: generations sequence: string - name: labelling_model dtype: string - name: labelling_prompt list: - name: content dtype: string - name: role dtype: string - name: raw_labelling_response dtype: string - name: rating sequence: float64 - name: rationale sequence: string splits: - name: train num_bytes: 36980005 num_examples: 2000 download_size: 12336689 dataset_size: 36980005 configs: - config_name: default data_files: - split: train path: data/train-* --- # Dataset Card for "distilabel-neurology-preferences-2k" ## Preprocessing used on distilabel preferences ```python from datasets import load_dataset # Load your dataset dataset_identifier = "macadeliccc/distilabel-neurology-dpo" dataset = load_dataset(dataset_identifier, split='train') def process_item(item): # Step 1: Identify the highest-rated generation ratings = item['rating'] highest_rating_index = ratings.index(max(ratings)) # Step 2: Select the corresponding prompt selected_prompt_pair = item['generation_prompt'][highest_rating_index] system_message = next((prompt['content'] for prompt in selected_prompt_pair if prompt['role'] == 'system'), "") user_query = next((prompt['content'] for prompt in selected_prompt_pair if prompt['role'] == 'user'), "") # Step 3: Construct the combined prompt prompt = f"{system_message}\n\n{user_query}" # Select the chosen and rejected responses based on ratings chosen = item['generations'][highest_rating_index] rejected = [resp for i, resp in enumerate(item['generations']) if i != highest_rating_index] return { "prompt": prompt, "chosen": chosen, "rejected": rejected } # Apply the processing function to each item in the dataset transformed_dataset = dataset.map(process_item) # Example of inspecting the first transformed item print(transformed_dataset[0]) ``` ## Prompt format For use during fine tuning ```python from datasets import load_dataset dataset_identifier = "macadeliccc/distilabel-neurology-dpo" disti_neuro = load_dataset(dataset_identifier, split='train') def chatml_format(disti_neuro): # get everything except the last message as input prompt = tokenizer.apply_chat_template(disti_neuro["prompt"][:-1], tokenize=False) # get the last assistant responses chosen = example["chosen"][-1]["content"] + "</s>" rejected = example["rejected"][-1]["content"] + "</s>" return { "prompt": system + prompt, "chosen": chosen, "rejected": rejected, } # Save columns original_columns = disti_neuro.column_names # Format dataset disti_neuro = disti_neuro.map( chatml_format, remove_columns=original_columns ) ```
提供机构:
macadeliccc
原始信息汇总

数据集信息

特征

  • input: 类型为字符串。
  • generation_model: 序列类型为字符串。
  • generation_prompt: 列表类型,包含以下子项:
    • content: 类型为字符串。
    • role: 类型为字符串。
  • raw_generation_responses: 序列类型为字符串。
  • generations: 序列类型为字符串。
  • labelling_model: 类型为字符串。
  • labelling_prompt: 列表类型,包含以下子项:
    • content: 类型为字符串。
    • role: 类型为字符串。
  • raw_labelling_response: 类型为字符串。
  • rating: 序列类型为浮点数。
  • rationale: 序列类型为字符串。

分割

  • train: 包含2000个样本,总字节数为36980005。

大小

  • download_size: 12336689字节。
  • dataset_size: 36980005字节。

配置

  • default: 数据文件路径为data/train-*
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作