Datasets:
parquet-converter
commited on
Commit
·
4762eec
1
Parent(s):
162574e
Update parquet files
Browse files- data/train-00003-of-00006-9f022966b6bb9cf8.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00000-of-00006.parquet +2 -2
- data/train-00000-of-00006-5fe89370890da24f.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00001-of-00006.parquet +2 -2
- data/train-00001-of-00006-aab9b1bf52a2df3f.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00002-of-00006.parquet +2 -2
- data/train-00002-of-00006-1c4b4049541a99d4.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00003-of-00006.parquet +2 -2
- Bingsu--laion2B-multi-korean-subset/parquet-train-00004-of-00006.parquet +3 -0
- Bingsu--laion2B-multi-korean-subset/parquet-train-00005-of-00006.parquet +3 -0
- README.md +0 -179
- data/train-00004-of-00006-829cbdc252d37dd4.parquet +0 -3
- data/train-00005-of-00006-5435e409ba6a048d.parquet +0 -3
- dataset_infos.json +0 -78
- laion2B-multi-korean-subset.csv.zst +0 -3
data/train-00003-of-00006-9f022966b6bb9cf8.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00000-of-00006.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:88d6f5a9400d32e2aa384eaac3bf11a168212b07239a090f680b569f5e85307a
|
3 |
+
size 339174840
|
data/train-00000-of-00006-5fe89370890da24f.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00001-of-00006.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c08a52b27072b5f9dc8b2ee63cbd51acc002ace57d8c4f8a1fd1fb5eb9e0c8e9
|
3 |
+
size 339140397
|
data/train-00001-of-00006-aab9b1bf52a2df3f.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00002-of-00006.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:505e55e6575fc5394ea52b9178d1e48646c4521b2aa0cc2ad287a25f95934437
|
3 |
+
size 339081494
|
data/train-00002-of-00006-1c4b4049541a99d4.parquet → Bingsu--laion2B-multi-korean-subset/parquet-train-00003-of-00006.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:061a9785b3c7c46b658d1381a5d2446ff6b7bc88c1bee633d15db8d3cb169668
|
3 |
+
size 339173062
|
Bingsu--laion2B-multi-korean-subset/parquet-train-00004-of-00006.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2dfe87f30ff93eea509dc27575684271fb2bb5790706de9bf4ee7f8ac6e307aa
|
3 |
+
size 339135877
|
Bingsu--laion2B-multi-korean-subset/parquet-train-00005-of-00006.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2a42981b0d7f28f972fc3057dc3f5d39f459ee0c5748c8880324b54f33c8af95
|
3 |
+
size 29718019
|
README.md
DELETED
@@ -1,179 +0,0 @@
|
|
1 |
-
---
|
2 |
-
annotations_creators:
|
3 |
-
- crowdsourced
|
4 |
-
language_creators:
|
5 |
-
- crowdsourced
|
6 |
-
language:
|
7 |
-
- ko
|
8 |
-
license:
|
9 |
-
- cc-by-4.0
|
10 |
-
multilinguality:
|
11 |
-
- monolingual
|
12 |
-
pretty_name: laion2B-multi-korean-subset
|
13 |
-
size_categories:
|
14 |
-
- 10M<n<100M
|
15 |
-
task_categories:
|
16 |
-
- feature-extraction
|
17 |
-
---
|
18 |
-
# laion2B-multi-korean-subset
|
19 |
-
|
20 |
-
## Dataset Description
|
21 |
-
- **Homepage:** [laion-5b](https://laion.ai/blog/laion-5b/)
|
22 |
-
- **Huggingface:** [laion/laion2B-multi](https://huggingface.co/datasets/laion/laion2B-multi)
|
23 |
-
|
24 |
-
## About dataset
|
25 |
-
a subset data of [laion/laion2B-multi](https://huggingface.co/datasets/laion/laion2B-multi), including only korean
|
26 |
-
|
27 |
-
### Lisence
|
28 |
-
CC-BY-4.0
|
29 |
-
## Data Structure
|
30 |
-
|
31 |
-
### Data Instance
|
32 |
-
|
33 |
-
```py
|
34 |
-
>>> from datasets import load_dataset
|
35 |
-
>>> dataset = load_dataset("Bingsu/laion2B-multi-korean-subset")
|
36 |
-
>>> dataset
|
37 |
-
DatasetDict({
|
38 |
-
train: Dataset({
|
39 |
-
features: ['SAMPLE_ID', 'URL', 'TEXT', 'HEIGHT', 'WIDTH', 'LICENSE', 'LANGUAGE', 'NSFW', 'similarity'],
|
40 |
-
num_rows: 11376263
|
41 |
-
})
|
42 |
-
})
|
43 |
-
```
|
44 |
-
|
45 |
-
```py
|
46 |
-
>>> dataset["train"].features
|
47 |
-
{'SAMPLE_ID': Value(dtype='int64', id=None),
|
48 |
-
'URL': Value(dtype='string', id=None),
|
49 |
-
'TEXT': Value(dtype='string', id=None),
|
50 |
-
'HEIGHT': Value(dtype='int32', id=None),
|
51 |
-
'WIDTH': Value(dtype='int32', id=None),
|
52 |
-
'LICENSE': Value(dtype='string', id=None),
|
53 |
-
'LANGUAGE': Value(dtype='string', id=None),
|
54 |
-
'NSFW': Value(dtype='string', id=None),
|
55 |
-
'similarity': Value(dtype='float32', id=None)}
|
56 |
-
```
|
57 |
-
|
58 |
-
### Data Size
|
59 |
-
|
60 |
-
download: 1.56 GiB<br>
|
61 |
-
generated: 2.37 GiB<br>
|
62 |
-
total: 3.93 GiB
|
63 |
-
|
64 |
-
### Data Field
|
65 |
-
|
66 |
-
- 'SAMPLE_ID': `int`
|
67 |
-
- 'URL': `string`
|
68 |
-
- 'TEXT': `string`
|
69 |
-
- 'HEIGHT': `int`
|
70 |
-
- 'WIDTH': `int`
|
71 |
-
- 'LICENSE': `string`
|
72 |
-
- 'LANGUAGE': `string`
|
73 |
-
- 'NSFW': `string`
|
74 |
-
- 'similarity': `float`
|
75 |
-
|
76 |
-
### Data Splits
|
77 |
-
|
78 |
-
| | train |
|
79 |
-
| --------- | -------- |
|
80 |
-
| # of data | 11376263 |
|
81 |
-
|
82 |
-
|
83 |
-
## Note
|
84 |
-
|
85 |
-
### Height, Width
|
86 |
-
|
87 |
-
이미지의 가로가 `HEIGHT`로, 세로가 `WIDTH`로 되어있는 것 같습니다.
|
88 |
-
|
89 |
-
```pycon
|
90 |
-
>>> dataset["train"][98]
|
91 |
-
{'SAMPLE_ID': 2937471001780,
|
92 |
-
'URL': 'https://image.ajunews.com/content/image/2019/04/12/20190412175643597949.png',
|
93 |
-
'TEXT': '인천시교육청, 인천 시군구발전협의회 임원진과의 간담회 개최',
|
94 |
-
'HEIGHT': 640,
|
95 |
-
'WIDTH': 321,
|
96 |
-
'LICENSE': '?',
|
97 |
-
'LANGUAGE': 'ko',
|
98 |
-
'NSFW': 'UNLIKELY',
|
99 |
-
'similarity': 0.33347243070602417}
|
100 |
-
```
|
101 |
-
|
102 |
-
![image](https://image.ajunews.com/content/image/2019/04/12/20190412175643597949.png)
|
103 |
-
|
104 |
-
### csv file, pandas
|
105 |
-
|
106 |
-
```py
|
107 |
-
# pip install zstandard
|
108 |
-
import pandas as pd
|
109 |
-
from huggingface_hub import hf_hub_url
|
110 |
-
|
111 |
-
url = hf_hub_url("Bingsu/laion2B-multi-korean-subset", filename="laion2B-multi-korean-subset.csv.zst", repo_type="dataset")
|
112 |
-
# url = "https://huggingface.co/datasets/Bingsu/laion2B-multi-korean-subset/resolve/main/laion2B-multi-korean-subset.csv.zst"
|
113 |
-
df = pd.read_csv(url)
|
114 |
-
```
|
115 |
-
|
116 |
-
<https://huggingface.co/datasets/Bingsu/laion2B-multi-korean-subset/resolve/main/laion2B-multi-korean-subset.csv.zst>
|
117 |
-
|
118 |
-
778 MB
|
119 |
-
|
120 |
-
### Code used to generate
|
121 |
-
|
122 |
-
```py
|
123 |
-
import csv
|
124 |
-
import re
|
125 |
-
|
126 |
-
from datasets import load_dataset
|
127 |
-
from tqdm import tqdm
|
128 |
-
|
129 |
-
|
130 |
-
pattern = re.compile(r"[가-힣]")
|
131 |
-
|
132 |
-
|
133 |
-
def quote(s: str) -> str:
|
134 |
-
s = s.replace('"""', "")
|
135 |
-
return s
|
136 |
-
|
137 |
-
|
138 |
-
def filter_func(example) -> bool:
|
139 |
-
lang = example.get("LANGUAGE")
|
140 |
-
text = example.get("TEXT")
|
141 |
-
if not isinstance(lang, str) or not isinstance(text, str):
|
142 |
-
return False
|
143 |
-
return lang == "ko" or pattern.search(text) is not None
|
144 |
-
|
145 |
-
|
146 |
-
file = open("./laion2B-mulit_korean_subset.csv", "w", encoding="utf-8", newline="")
|
147 |
-
|
148 |
-
ds = load_dataset("laion/laion2B-multi", split="train", streaming=True)
|
149 |
-
dsf = ds.filter(filter_func)
|
150 |
-
header = [
|
151 |
-
"SAMPLE_ID",
|
152 |
-
"URL",
|
153 |
-
"TEXT",
|
154 |
-
"HEIGHT",
|
155 |
-
"WIDTH",
|
156 |
-
"LICENSE",
|
157 |
-
"LANGUAGE",
|
158 |
-
"NSFW",
|
159 |
-
"similarity",
|
160 |
-
]
|
161 |
-
writer = csv.DictWriter(file, fieldnames=header)
|
162 |
-
writer.writeheader()
|
163 |
-
|
164 |
-
try:
|
165 |
-
for data in tqdm(dsf): # total=11378843
|
166 |
-
data["TEXT"] = quote(data.get("TEXT", ""))
|
167 |
-
if data["TEXT"]:
|
168 |
-
writer.writerow(data)
|
169 |
-
finally:
|
170 |
-
file.close()
|
171 |
-
|
172 |
-
print("Done!")
|
173 |
-
```
|
174 |
-
|
175 |
-
실행에 약 8시간이 소요되었습니다. 이후에 `HEIGHT`나 `WIDTH`가 None인 데이터를 제거하고 업로드하였습니다.
|
176 |
-
|
177 |
-
### img2dataset
|
178 |
-
|
179 |
-
[img2dataset](https://github.com/rom1504/img2dataset)을 사용하여 URL로된 이미지들을 데이터셋 형태로 만들 수 있습니다.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/train-00004-of-00006-829cbdc252d37dd4.parquet
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:10c442a19ccfd200ca32a29604b8489df0751ff65d3575d0fdb5710849587174
|
3 |
-
size 279020475
|
|
|
|
|
|
|
|
data/train-00005-of-00006-5435e409ba6a048d.parquet
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f88201423bd8a15ff63e3213252b434765f3e09baf1d9878279ffcb768328816
|
3 |
-
size 278693962
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
{"Bingsu--laion2B-multi-korean-subset": {
|
2 |
-
"description": "",
|
3 |
-
"citation": "",
|
4 |
-
"homepage": "",
|
5 |
-
"license": "",
|
6 |
-
"features": {
|
7 |
-
"SAMPLE_ID": {
|
8 |
-
"dtype": "int64",
|
9 |
-
"id": null,
|
10 |
-
"_type": "Value"
|
11 |
-
},
|
12 |
-
"URL": {
|
13 |
-
"dtype": "string",
|
14 |
-
"id": null,
|
15 |
-
"_type": "Value"
|
16 |
-
},
|
17 |
-
"TEXT": {
|
18 |
-
"dtype": "string",
|
19 |
-
"id": null,
|
20 |
-
"_type": "Value"
|
21 |
-
},
|
22 |
-
"HEIGHT": {
|
23 |
-
"dtype": "int32",
|
24 |
-
"id": null,
|
25 |
-
"_type": "Value"
|
26 |
-
},
|
27 |
-
"WIDTH": {
|
28 |
-
"dtype": "int32",
|
29 |
-
"id": null,
|
30 |
-
"_type": "Value"
|
31 |
-
},
|
32 |
-
"LICENSE": {
|
33 |
-
"dtype": "string",
|
34 |
-
"id": null,
|
35 |
-
"_type": "Value"
|
36 |
-
},
|
37 |
-
"LANGUAGE": {
|
38 |
-
"dtype": "string",
|
39 |
-
"id": null,
|
40 |
-
"_type": "Value"
|
41 |
-
},
|
42 |
-
"NSFW": {
|
43 |
-
"dtype": "string",
|
44 |
-
"id": null,
|
45 |
-
"_type": "Value"
|
46 |
-
},
|
47 |
-
"similarity": {
|
48 |
-
"dtype": "float32",
|
49 |
-
"id": null,
|
50 |
-
"_type": "Value"
|
51 |
-
}
|
52 |
-
},
|
53 |
-
"post_processed": null,
|
54 |
-
"supervised_keys": null,
|
55 |
-
"task_templates": null,
|
56 |
-
"builder_name": "csv",
|
57 |
-
"config_name": "default",
|
58 |
-
"version": {
|
59 |
-
"version_str": "0.0.0",
|
60 |
-
"description": null,
|
61 |
-
"major": 0,
|
62 |
-
"minor": 0,
|
63 |
-
"patch": 0
|
64 |
-
},
|
65 |
-
"splits": {
|
66 |
-
"train": {
|
67 |
-
"name": "train",
|
68 |
-
"num_bytes": 2541688237,
|
69 |
-
"num_examples": 11376263,
|
70 |
-
"dataset_name": "laion2B-multi-korean-subset"
|
71 |
-
}
|
72 |
-
},
|
73 |
-
"download_checksums": null,
|
74 |
-
"download_size": 1672858560,
|
75 |
-
"post_processing_size": null,
|
76 |
-
"dataset_size": 2541688237,
|
77 |
-
"size_in_bytes": 4214546797
|
78 |
-
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
laion2B-multi-korean-subset.csv.zst
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:71728d8307432ed640e1b41fff234d89be7e5360012c090e94657a983a84655b
|
3 |
-
size 778353379
|
|
|
|
|
|
|
|