acul3 commited on
Commit
07d3317
1 Parent(s): 79439d5

init commit

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. conceptual_12m_indo.py +82 -0
  3. data/cc12m.jsonl +3 -0
.gitattributes CHANGED
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *.mp3 filter=lfs diff=lfs merge=lfs -text
36
  *.ogg filter=lfs diff=lfs merge=lfs -text
37
  *.wav filter=lfs diff=lfs merge=lfs -text
 
 
35
  *.mp3 filter=lfs diff=lfs merge=lfs -text
36
  *.ogg filter=lfs diff=lfs merge=lfs -text
37
  *.wav filter=lfs diff=lfs merge=lfs -text
38
+ *.jsonl filter=lfs diff=lfs merge=lfs -text
conceptual_12m_indo.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """Conceptual 12M dataset."""
16
+
17
+ import datasets
18
+ import ast
19
+ import json
20
+
21
+
22
+ _CITATION = """\
23
+ @inproceedings{changpinyo2021cc12m,
24
+ title = {{Conceptual 12M}: Pushing Web-Scale Image-Text Pre-Training To Recognize Long-Tail Visual Concepts},
25
+ author = {Changpinyo, Soravit and Sharma, Piyush and Ding, Nan and Soricut, Radu},
26
+ booktitle = {CVPR},
27
+ year = {2021},
28
+ }
29
+ """
30
+
31
+ _DESCRIPTION = """\
32
+ Conceptual 12M is a large-scale dataset of 12 million
33
+ image-text pairs specifically meant to be used for visionand-language pre-training.
34
+ Its data collection pipeline is a relaxed version of the one used in Conceptual Captions 3M.
35
+ """
36
+
37
+ _HOMEPAGE = "https://github.com/google-research-datasets/conceptual-12m"
38
+
39
+ _LICENSE = """\
40
+ The dataset may be freely used for any purpose, although acknowledgement of
41
+ Google LLC ("Google") as the data source would be appreciated. The dataset is
42
+ provided "AS IS" without any warranty, express or implied. Google disclaims all
43
+ liability for any damages, direct or indirect, resulting from the use of the
44
+ dataset.
45
+ """
46
+
47
+ _URL = "https://huggingface.co/datasets/munggok/CC_12M_Indonesia/resolve/main/data/cc12m.jsonl"
48
+
49
+
50
+ class Conceptual12M(datasets.GeneratorBasedBuilder):
51
+ """Conceptual 12M Indonesia dataset."""
52
+
53
+ def _info(self):
54
+ features = datasets.Features({"image_url": datasets.Value("string"), "caption": datasets.Value("string")})
55
+
56
+ return datasets.DatasetInfo(
57
+ description=_DESCRIPTION,
58
+ features=features,
59
+ homepage=_HOMEPAGE,
60
+ license=_LICENSE,
61
+ citation=_CITATION,
62
+ )
63
+
64
+ def _split_generators(self, dl_manager):
65
+ file = dl_manager.download(_URL)
66
+ return [
67
+ datasets.SplitGenerator(
68
+ name=datasets.Split.TRAIN,
69
+ gen_kwargs={
70
+ "file": file,
71
+ },
72
+ ),
73
+ ]
74
+
75
+ def _generate_examples(self, file):
76
+ id_ = 0
77
+ with open(file, "r", encoding="utf-8") as fi:
78
+ for line in fi:
79
+ if line:
80
+ example = ast.literal_eval(line)
81
+ yield id_, {"image_url": example['url'], "caption": example['caption']}
82
+ id_ += 1
data/cc12m.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4314733a42fa7cf45191cd9314e3c1583f8fabe7705c5c9663dcf1eafed8f2b
3
+ size 3095287567