qgyd2021 commited on
Commit
dcca2ec
1 Parent(s): fbfc94b

[update]add data

Browse files
README.md CHANGED
@@ -9,15 +9,18 @@ size_categories:
9
  ---
10
  ## 中文闲聊数据集
11
 
 
 
12
 
13
  数据集从网上收集整理如下:
14
 
15
  | 数据 | 原始数据/项目地址 | 样本个数 | 语料描述 | 替代数据下载地址 |
16
  | :--- | :---: | :---: | :---: | :---: |
17
  | ChatterBot | [ChatterBot](https://github.com/gunthercox/ChatterBot); [chatterbot-corpus](https://github.com/gunthercox/chatterbot-corpus) | 560 | 按类型分类,质量较高 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
18
- | douban | [Douban Conversation Corpus](https://github.com/MarkWuNLP/MultiTurnResponseSelection) | 352W | 来自北航和微软的paper, 开源项目, 噪音相对较少,原本是多轮 (平均7.6轮) | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
19
  | ptt | [PTT中文語料](https://github.com/zake7749/Gossiping-Chinese-Corpus) | 77W | 开源项目, 台湾PTT论坛八卦版, 繁体, 语料较生活化, 有噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
20
- | subtitle | [电视剧对白语料](https://github.com/aceimnorstuvwxz/dgk_lost_conv) | 274W | 开源项目, 来自爬取的电影和美剧的字幕, 有一些噪音, 对白不一定是严谨的对话, 原本是多轮 (平均5.3轮) | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
 
21
  | tieba | [贴吧论坛回帖语料](https://pan.baidu.com/s/1mUknfwy1nhSM7XzH8xi7gQ); 密码:i4si | 232W | 多轮, 有噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
22
  | weibo | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao | 443W | 来自华为的paper | |
23
  | xiaohuangji | [小黄鸡语料](https://github.com/candlewill/Dialog_Corpus) | 45W | 原人人网项目语料, 有一些不雅对话, 少量噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
@@ -27,11 +30,8 @@ size_categories:
27
  <summary>参考的数据来源,展开查看</summary>
28
  <pre>
29
  <code>
30
-
31
  https://github.com/codemayq/chinese_chatbot_corpus
32
-
33
  https://github.com/yangjianxin1/GPT2-chitchat
34
-
35
  </code>
36
  </pre>
37
  </details>
 
9
  ---
10
  ## 中文闲聊数据集
11
 
12
+ role 的取值有: "unknown", "human", "assistant", 三种.
13
+
14
 
15
  数据集从网上收集整理如下:
16
 
17
  | 数据 | 原始数据/项目地址 | 样本个数 | 语料描述 | 替代数据下载地址 |
18
  | :--- | :---: | :---: | :---: | :---: |
19
  | ChatterBot | [ChatterBot](https://github.com/gunthercox/ChatterBot); [chatterbot-corpus](https://github.com/gunthercox/chatterbot-corpus) | 560 | 按类型分类,质量较高 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
20
+ | douban | [Douban Conversation Corpus](https://github.com/MarkWuNLP/MultiTurnResponseSelection) | 352W | 来自北航和微软的paper, 噪音相对较少, 多轮(平均7.6轮) | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
21
  | ptt | [PTT中文語料](https://github.com/zake7749/Gossiping-Chinese-Corpus) | 77W | 开源项目, 台湾PTT论坛八卦版, 繁体, 语料较生活化, 有噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
22
+ | qingyun | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao | 10W | 青云语料, 相对不错, 生活化 | |
23
+ | subtitle | [电视剧对白语料](https://github.com/aceimnorstuvwxz/dgk_lost_conv) | 274W | 来自爬取的电影和美剧的字幕, 有一些噪音, 不严谨的对话, 说话人无法对应起来, 多轮(平均5.3轮) | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
24
  | tieba | [贴吧论坛回帖语料](https://pan.baidu.com/s/1mUknfwy1nhSM7XzH8xi7gQ); 密码:i4si | 232W | 多轮, 有噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
25
  | weibo | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao | 443W | 来自华为的paper | |
26
  | xiaohuangji | [小黄鸡语料](https://github.com/candlewill/Dialog_Corpus) | 45W | 原人人网项目语料, 有一些不雅对话, 少量噪音 | [阿里云盘](https://www.aliyundrive.com/s/qXBdAYtz5j5); 提取码: 81ao |
 
30
  <summary>参考的数据来源,展开查看</summary>
31
  <pre>
32
  <code>
 
33
  https://github.com/codemayq/chinese_chatbot_corpus
 
34
  https://github.com/yangjianxin1/GPT2-chitchat
 
35
  </code>
36
  </pre>
37
  </details>
chinese_chitchat.py CHANGED
@@ -12,6 +12,7 @@ _URLS = {
12
  "chatterbot": "data/chatterbot.jsonl",
13
  "douban": "data/douban.jsonl",
14
  "ptt": "data/ptt.jsonl",
 
15
  "subtitle": "data/subtitle.jsonl",
16
  "tieba": "data/tieba.jsonl",
17
  "weibo": "data/weibo.jsonl",
 
12
  "chatterbot": "data/chatterbot.jsonl",
13
  "douban": "data/douban.jsonl",
14
  "ptt": "data/ptt.jsonl",
15
+ "qingyun": "data/qingyun.jsonl",
16
  "subtitle": "data/subtitle.jsonl",
17
  "tieba": "data/tieba.jsonl",
18
  "weibo": "data/weibo.jsonl",
data/qingyun.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e0b4d1f69df4085d6d54c7449174ab62a22167dd31e301704e4d5883e5f3d3b
3
+ size 22507854
examples/process/process_qingyun.py ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/python3
2
+ # -*- coding: utf-8 -*-
3
+ import argparse
4
+ import json
5
+ from pathlib import Path
6
+
7
+ import pandas as pd
8
+ from tqdm import tqdm
9
+
10
+ from project_settings import project_path
11
+
12
+
13
+ def get_args():
14
+ parser = argparse.ArgumentParser()
15
+
16
+ parser.add_argument(
17
+ "--data_file",
18
+ default=(project_path / "original_data/qingyun-11w/12万对话语料青云库.csv").as_posix(),
19
+ type=str
20
+ )
21
+ parser.add_argument(
22
+ "--output_file",
23
+ default=(project_path / "data/qingyun.jsonl"),
24
+ type=str
25
+ )
26
+
27
+ args = parser.parse_args()
28
+ return args
29
+
30
+
31
+ def main():
32
+ args = get_args()
33
+
34
+ with open(args.data_file, "r", encoding="utf-8") as fin, \
35
+ open(args.output_file, "w", encoding="utf-8") as fout:
36
+ for row in fin:
37
+ row = str(row).strip()
38
+ splits = row.split(" | ")
39
+ if len(splits) != 2:
40
+ print(row)
41
+ raise AssertionError
42
+
43
+ question = splits[0].strip()
44
+ answer = splits[1].strip()
45
+
46
+ row = {
47
+ "conversation": [
48
+ {
49
+ "role": "human",
50
+ "message": question,
51
+ },
52
+ {
53
+ "role": "assistant",
54
+ "message": answer,
55
+ },
56
+ ],
57
+ "category": None,
58
+ "data_source": "qingyun",
59
+ }
60
+ row = json.dumps(row, ensure_ascii=False)
61
+ fout.write("{}\n".format(row))
62
+
63
+ return
64
+
65
+
66
+ if __name__ == '__main__':
67
+ main()