REILX/neo_sft_phase2_single
收藏Hugging Face2024-06-12 更新2024-06-29 收录
下载链接:
https://hf-mirror.com/datasets/REILX/neo_sft_phase2_single
下载链接
链接失效反馈官方服务:
资源简介:
---
license: apache-2.0
task_categories:
- text-generation
language:
- en
- zh
size_categories:
- 10K<n<100K
---
### dataset
The original dataset can be found at: https://huggingface.co/datasets/m-a-p/neo_sft_phase2</br>
Use the following code to select two-turn conversations for your SFT dataset.
### code
```python
import json
def process_conversations(input_file, output_file):
with open(input_file, 'r', encoding='utf-8') as f_in, \
open(output_file, 'w', encoding='utf-8') as f_out:
data = json.load(f_in)
for item in data:
conversations = item.get("conversations", [])
if len(conversations) == 2:
human_value = conversations[0].get("value", "")
gpt_value = conversations[1].get("value", "")
output_data = {
"instruction": human_value,
"output": gpt_value
}
f_out.write(json.dumps(output_data, ensure_ascii=False) + "\n")
if __name__ == "__main__":
input_json_file = "neo_sft_phase2.json"
output_jsonl_file = "neo_sft_phase2_conversation2.json"
process_conversations(input_json_file, output_jsonl_file)
```
提供机构:
REILX
原始信息汇总
数据集概述
- 许可证: Apache 2.0
- 任务类别: 文本生成
- 语言:
- 英语
- 中文
- 数据规模: 10K<n<100K
数据处理
- 原始数据集: https://huggingface.co/datasets/m-a-p/neo_sft_phase2
- 数据处理代码:
- 用于从原始数据集中提取两轮对话,并将其转换为指令-输出格式的JSONL文件。
- 代码功能:
- 读取原始JSON文件。
- 筛选出包含两轮对话的数据。
- 将每轮对话的指令和输出分别提取并保存为新的JSONL文件。



