Upload 16 files
Browse files
.gitattributes
CHANGED
|
@@ -53,3 +53,16 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
体育.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
娱乐.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
家居.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
彩票.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
房产.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
教育.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
时尚.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
时政.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
游戏.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
社会.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 66 |
+
科技.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 67 |
+
股票.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 68 |
+
财经.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 一、数据集
|
| 2 |
+
|
| 3 |
+
| 数据集名称 | 用途 | 下载链接 |
|
| 4 |
+
| ---------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
| 5 |
+
| THUCNews | 文本分类、文本生成 | [THUCNews](http://thuctc.thunlp.org/#%E4%B8%AD%E6%96%87%E6%96%87%E6%9C%AC%E5%88%86%E7%B1%BB%E6%95%B0%E6%8D%AE%E9%9B%86THUCNews) |
|
| 6 |
+
|
| 7 |
+
- 由于原文件碎文件很多,这里提供脚本合并为多个单文件
|
trans_THUCNews.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'''
|
| 2 |
+
修改
|
| 3 |
+
'''
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from tqdm import tqdm
|
| 7 |
+
|
| 8 |
+
def trans_dir(data_dir, save_dir):
|
| 9 |
+
for sub_data_dir in [os.path.join(data_dir, i) for i in os.listdir(data_dir)]:
|
| 10 |
+
if not os.path.isdir(sub_data_dir):
|
| 11 |
+
continue
|
| 12 |
+
|
| 13 |
+
res = ''
|
| 14 |
+
file = sub_data_dir.split('\\')[-1]
|
| 15 |
+
count = 0
|
| 16 |
+
for file_name in tqdm(os.listdir(sub_data_dir), desc=file):
|
| 17 |
+
file_path = os.path.join(sub_data_dir, file_name)
|
| 18 |
+
text = open(file_path, encoding='utf-8').read()
|
| 19 |
+
text = text.split('\n')
|
| 20 |
+
if len(text) > 1:
|
| 21 |
+
title = text[0]
|
| 22 |
+
content = '\n'.join(text[1:])
|
| 23 |
+
res += json.dumps({'id': file_name, 'title': title, 'content': content}, ensure_ascii=False) + '\n'
|
| 24 |
+
count += 1
|
| 25 |
+
# if count > 10:
|
| 26 |
+
# break
|
| 27 |
+
if count % 100 == 0:
|
| 28 |
+
with open(f'{save_dir}/{file}.jsonl', 'a', encoding='utf-8') as f:
|
| 29 |
+
f.write(res)
|
| 30 |
+
res = ''
|
| 31 |
+
if res != '':
|
| 32 |
+
with open(f'{save_dir}/{file}.jsonl', 'a', encoding='utf-8') as f:
|
| 33 |
+
f.write(res)
|
| 34 |
+
train_dataloader = trans_dir('F:/data/corpus/sentence_classification/THUCNews', 'F:/data/corpus/sentence_classification/THUCNews')
|
体育.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2131fe5cc53dda324d79d14a28b2409a5aa606860657bdea5b9081c19f01e2a
|
| 3 |
+
size 403371070
|
娱乐.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c4ce21e310248751c1dd6557023aa8063cc8e84d62d8e7b757538ec8f0315c1b
|
| 3 |
+
size 222136632
|
家居.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ee05d752841c4d7b461746d8449ee7070b5e97d5696b35abcb8f3c3afd2c264
|
| 3 |
+
size 70465915
|
彩票.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfe250cbcfb44a3af778b509ed7ebec9f79e6b282d3f64b3fc3c51680c35550b
|
| 3 |
+
size 25246141
|
房产.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f61433c160056eb295f58d6ddd88205e6e7c28cf872b94c750c9014a15f8bbf
|
| 3 |
+
size 54569213
|
教育.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f83bf206143e6280be403341adf5c0dfd83b065265eb8716416b48aca1e29b3
|
| 3 |
+
size 151403113
|
时尚.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af3bf2372bb093112610c848f7aa333284d3d5687687f89be4c7917f52f994b9
|
| 3 |
+
size 24688110
|
时政.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c85e2108515fd33aefe5b5fea3bfd04c3cf3c67cd2217889e3f9ac21d2ca8a0b
|
| 3 |
+
size 128032662
|
星座.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
游戏.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1c9a6eb01abc930423a8bc5703ccf3b3790131120880a1294a7c381738ca38da
|
| 3 |
+
size 60252410
|
社会.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56aa898021cdadc57d6dfd13d2a9884098d0b7c48bbe6da54ae5325fe02e79bd
|
| 3 |
+
size 173013126
|
科技.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3a3903b043b46573046f69f2f559ca616cf0e6a722c8cda83bc76899a5d39e85
|
| 3 |
+
size 407870046
|
股票.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d719c4212fe731bbdf972b7ac03bbf6097c2a2995e337a75a84bc138717e067
|
| 3 |
+
size 385986451
|
财经.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f3c79083f6080814b2298bd00343cb54bbc65fd173826bdb3260b4b6db6c7b6
|
| 3 |
+
size 125513829
|