Kosuke-Yamada commited on
Commit
3dd2169
1 Parent(s): a8da2c3

Convert dataset to Parquet (part 00002-of-00003) (#4)

Browse files

- Convert dataset to Parquet (part 00002-of-00003) (9ca1529966933dc388fb90eb495a19262bd249f9)
- Delete loading script (9c62b4161f4711d585ad8e6f79bf453994b4091d)

Files changed (38) hide show
  1. README.md +55 -0
  2. camera.py +0 -147
  3. with-lp-images/test-00000-of-00006.parquet +3 -0
  4. with-lp-images/test-00001-of-00006.parquet +3 -0
  5. with-lp-images/test-00002-of-00006.parquet +3 -0
  6. with-lp-images/test-00003-of-00006.parquet +3 -0
  7. with-lp-images/test-00004-of-00006.parquet +3 -0
  8. with-lp-images/test-00005-of-00006.parquet +3 -0
  9. with-lp-images/train-00100-of-00103.parquet +3 -0
  10. with-lp-images/train-00101-of-00103.parquet +3 -0
  11. with-lp-images/train-00102-of-00103.parquet +3 -0
  12. with-lp-images/validation-00000-of-00027.parquet +3 -0
  13. with-lp-images/validation-00001-of-00027.parquet +3 -0
  14. with-lp-images/validation-00002-of-00027.parquet +3 -0
  15. with-lp-images/validation-00003-of-00027.parquet +3 -0
  16. with-lp-images/validation-00004-of-00027.parquet +3 -0
  17. with-lp-images/validation-00005-of-00027.parquet +3 -0
  18. with-lp-images/validation-00006-of-00027.parquet +3 -0
  19. with-lp-images/validation-00007-of-00027.parquet +3 -0
  20. with-lp-images/validation-00008-of-00027.parquet +3 -0
  21. with-lp-images/validation-00009-of-00027.parquet +3 -0
  22. with-lp-images/validation-00010-of-00027.parquet +3 -0
  23. with-lp-images/validation-00011-of-00027.parquet +3 -0
  24. with-lp-images/validation-00012-of-00027.parquet +3 -0
  25. with-lp-images/validation-00013-of-00027.parquet +3 -0
  26. with-lp-images/validation-00014-of-00027.parquet +3 -0
  27. with-lp-images/validation-00015-of-00027.parquet +3 -0
  28. with-lp-images/validation-00016-of-00027.parquet +3 -0
  29. with-lp-images/validation-00017-of-00027.parquet +3 -0
  30. with-lp-images/validation-00018-of-00027.parquet +3 -0
  31. with-lp-images/validation-00019-of-00027.parquet +3 -0
  32. with-lp-images/validation-00020-of-00027.parquet +3 -0
  33. with-lp-images/validation-00021-of-00027.parquet +3 -0
  34. with-lp-images/validation-00022-of-00027.parquet +3 -0
  35. with-lp-images/validation-00023-of-00027.parquet +3 -0
  36. with-lp-images/validation-00024-of-00027.parquet +3 -0
  37. with-lp-images/validation-00025-of-00027.parquet +3 -0
  38. with-lp-images/validation-00026-of-00027.parquet +3 -0
README.md CHANGED
@@ -1,3 +1,58 @@
1
  ---
2
  license: cc-by-nc-sa-4.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
1
  ---
2
  license: cc-by-nc-sa-4.0
3
+ dataset_info:
4
+ config_name: with-lp-images
5
+ features:
6
+ - name: asset_id
7
+ dtype: int64
8
+ - name: kw
9
+ dtype: string
10
+ - name: lp_meta_description
11
+ dtype: string
12
+ - name: title_org
13
+ dtype: string
14
+ - name: title_ne1
15
+ dtype: string
16
+ - name: title_ne2
17
+ dtype: string
18
+ - name: title_ne3
19
+ dtype: string
20
+ - name: domain
21
+ dtype: string
22
+ - name: parsed_full_text_annotation
23
+ sequence:
24
+ - name: text
25
+ dtype: string
26
+ - name: xmax
27
+ dtype: int64
28
+ - name: xmin
29
+ dtype: int64
30
+ - name: ymax
31
+ dtype: int64
32
+ - name: ymin
33
+ dtype: int64
34
+ - name: lp_image
35
+ dtype: image
36
+ splits:
37
+ - name: train
38
+ num_bytes: 51367983297.415
39
+ num_examples: 12395
40
+ - name: validation
41
+ num_bytes: 13133740369.43
42
+ num_examples: 3098
43
+ - name: test
44
+ num_bytes: 2528981570.0
45
+ num_examples: 872
46
+ download_size: 65867475365
47
+ dataset_size: 67030705236.845
48
+ configs:
49
+ - config_name: with-lp-images
50
+ data_files:
51
+ - split: train
52
+ path: with-lp-images/train-*
53
+ - split: validation
54
+ path: with-lp-images/validation-*
55
+ - split: test
56
+ path: with-lp-images/test-*
57
+ default: true
58
  ---
camera.py DELETED
@@ -1,147 +0,0 @@
1
- import ast
2
-
3
- import datasets as ds
4
- import pandas as pd
5
-
6
- _DESCRIPTION = """\
7
- CAMERA (CyberAgent Multimodal Evaluation for Ad Text GeneRAtion) is the Japanese ad text generation dataset.
8
- """
9
-
10
- _CITATION = """\
11
- @misc{mita2024striking,
12
- title={Striking Gold in Advertising: Standardization and Exploration of Ad Text Generation},
13
- author={Masato Mita and Soichiro Murakami and Akihiko Kato and Peinan Zhang},
14
- year={2024},
15
- eprint={2309.12030},
16
- archivePrefix={arXiv},
17
- primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'}
18
- }
19
- """
20
-
21
- _HOMEPAGE = "https://github.com/CyberAgentAILab/camera"
22
-
23
- _LICENSE = """\
24
- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
25
- """
26
-
27
- _URLS = {
28
- "without-lp-images": "https://storage.googleapis.com/camera-public/camera-v2.2-minimal.tar.gz",
29
- "with-lp-images": "https://storage.googleapis.com/camera-public/camera-v2.2.tar.gz",
30
- }
31
-
32
- _DESCRIPTION = {
33
- "without-lp-images": "The CAMERA dataset w/o LP images (ver.2.2.0)",
34
- "with-lp-images": "The CAMERA dataset w/ LP images (ver.2.2.0)",
35
- }
36
-
37
- _VERSION = ds.Version("2.2.0", "")
38
-
39
-
40
- class CameraConfig(ds.BuilderConfig):
41
- def __init__(self, name: str, version: ds.Version = _VERSION, **kwargs):
42
- super().__init__(
43
- name=name,
44
- description=_DESCRIPTION[name],
45
- version=version,
46
- **kwargs,
47
- )
48
-
49
-
50
- class CameraDataset(ds.GeneratorBasedBuilder):
51
- BUILDER_CONFIGS = [CameraConfig(name="with-lp-images")]
52
-
53
- DEFAULT_CONFIG_NAME = "with-lp-images"
54
-
55
- def _info(self) -> ds.DatasetInfo:
56
- features = ds.Features(
57
- {
58
- "asset_id": ds.Value("int64"),
59
- "kw": ds.Value("string"),
60
- "lp_meta_description": ds.Value("string"),
61
- "title_org": ds.Value("string"),
62
- "title_ne1": ds.Value("string"),
63
- "title_ne2": ds.Value("string"),
64
- "title_ne3": ds.Value("string"),
65
- "domain": ds.Value("string"),
66
- "parsed_full_text_annotation": ds.Sequence(
67
- {
68
- "text": ds.Value("string"),
69
- "xmax": ds.Value("int64"),
70
- "xmin": ds.Value("int64"),
71
- "ymax": ds.Value("int64"),
72
- "ymin": ds.Value("int64"),
73
- }
74
- ),
75
- }
76
- )
77
-
78
- if self.config.name == "with-lp-images":
79
- features["lp_image"] = ds.Image()
80
-
81
- return ds.DatasetInfo(
82
- description=_DESCRIPTION,
83
- citation=_CITATION,
84
- homepage=_HOMEPAGE,
85
- license=_LICENSE,
86
- features=features,
87
- )
88
-
89
- def _split_generators(self, dl_manager: ds.DownloadManager):
90
- base_dir = dl_manager.download_and_extract(_URLS[self.config.name])
91
- lp_image_dir: str | None = None
92
-
93
- if self.config.name == "without-lp-images":
94
- data_dir = f"{base_dir}/camera-v2.2-minimal"
95
- elif self.config.name == "with-lp-images":
96
- data_dir = f"{base_dir}/camera-v2.2"
97
- lp_image_dir = f"{data_dir}/lp-screenshot"
98
- else:
99
- raise ValueError(f"Invalid config name: {self.config.name}")
100
-
101
- return [
102
- ds.SplitGenerator(
103
- name=ds.Split.TRAIN,
104
- gen_kwargs={
105
- "file": f"{data_dir}/train.csv",
106
- "lp_image_dir": lp_image_dir,
107
- },
108
- ),
109
- ds.SplitGenerator(
110
- name=ds.Split.VALIDATION,
111
- gen_kwargs={
112
- "file": f"{data_dir}/dev.csv",
113
- "lp_image_dir": lp_image_dir,
114
- },
115
- ),
116
- ds.SplitGenerator(
117
- name=ds.Split.TEST,
118
- gen_kwargs={
119
- "file": f"{data_dir}/test.csv",
120
- "lp_image_dir": lp_image_dir,
121
- },
122
- ),
123
- ]
124
-
125
- def _generate_examples(self, file: str, lp_image_dir: str | None = None):
126
- df = pd.read_csv(file)
127
- for i, data_dict in enumerate(df.to_dict("records")):
128
- asset_id = data_dict["asset_id"]
129
- example_dict = {
130
- "asset_id": asset_id,
131
- "kw": data_dict["kw"],
132
- "lp_meta_description": data_dict["lp_meta_description"],
133
- "title_org": data_dict["title_org"],
134
- "title_ne1": data_dict.get("title_ne1", ""),
135
- "title_ne2": data_dict.get("title_ne2", ""),
136
- "title_ne3": data_dict.get("title_ne3", ""),
137
- "domain": data_dict.get("domain", ""),
138
- "parsed_full_text_annotation": ast.literal_eval(
139
- data_dict["parsed_full_text_annotation"]
140
- ),
141
- }
142
-
143
- if self.config.name == "with-lp-images" and lp_image_dir is not None:
144
- file_name = f"screen-1200-{asset_id}.png"
145
- example_dict["lp_image"] = f"{lp_image_dir}/{file_name}"
146
-
147
- yield i, example_dict
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
with-lp-images/test-00000-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e0806e43628295b0baf577a02f8103de6525f1c3f541c0b3ff38fb3a087572b
3
+ size 390970226
with-lp-images/test-00001-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e8ea7c74110e360ab8ad9a4389e1c9878e724519962820b9cc334a3c2b365bf
3
+ size 419011393
with-lp-images/test-00002-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca0903ad6bca9e060d562d60d6acb470dea4a41181f0fca6738662aaecd8fcf4
3
+ size 429980062
with-lp-images/test-00003-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:534676ecb87f801ffe97e8e87bb93b416c8da369275ef23c84d91fe3092e35ee
3
+ size 442024799
with-lp-images/test-00004-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0676dd50cda142502ee4359465e28a9b14c71614f22b69dcd38531ec03b3431
3
+ size 361821635
with-lp-images/test-00005-of-00006.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbb87cd2f6b1c597fefdea17d9a6af3f274689cc129a88618808cf81185d0e0b
3
+ size 462353363
with-lp-images/train-00100-of-00103.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a1c43b5f8b4db44f907801007d7c4582ffa16123013a735058a2e7decab9f50
3
+ size 459876318
with-lp-images/train-00101-of-00103.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb425d7586eba8e0d288b5d2ebbe102757373588745d59baf88f452def43c39b
3
+ size 498460276
with-lp-images/train-00102-of-00103.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7fe2b816dc5a2310962fc7b28d5f8dc2b81b0fed9620ac4eaf728d896e8b758
3
+ size 432452351
with-lp-images/validation-00000-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb8143244af8acce0730c8760200124300842b8e54ad56d002a33247d9b0b66
3
+ size 438331272
with-lp-images/validation-00001-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b53302dabc03332027280b491c24b2a91e921c92f0d1fe67aebc0aa73d1ef6b0
3
+ size 482462306
with-lp-images/validation-00002-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29a7431beb1bade3732f6b944481866c5474f42e08256f9ce5cd224c0c42355f
3
+ size 506433544
with-lp-images/validation-00003-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6b3680a4439646cebcac1a3125925b7f6c4f22da85aa3f6ac224a808b02bccd
3
+ size 498060399
with-lp-images/validation-00004-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52a68bfd86a2b784902c12446a9a75d9b3dfb0bdf37bc7ecc7a2196357baca0d
3
+ size 552869153
with-lp-images/validation-00005-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eeb51d59b4cc27ef1441b556b1443c6a4d0bfaee38217cd5fc961758baa75a47
3
+ size 438820861
with-lp-images/validation-00006-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a6c85b014cd29c563765d985dc2c38bdf968ee929498eafcdf2a66b2e21212b
3
+ size 472623336
with-lp-images/validation-00007-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6dc809db4db2fc42d14c23057e2900a215e65ca1c3269951b1d2aef16bc143fd
3
+ size 489280455
with-lp-images/validation-00008-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6519090441abce9194a262afab2d0731133e3f1b4be395fc110331c15d8d3eb
3
+ size 460378068
with-lp-images/validation-00009-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05d84d374a79b8111bdbf501337b5213feac289ab7e2da2061f9a34b343f7f4e
3
+ size 429708543
with-lp-images/validation-00010-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:464f4930ee7b303c8f57b17eac333f38b61385477431fa1579e878158d115658
3
+ size 457484838
with-lp-images/validation-00011-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91201ebcde8e4fb53644f6dc638ecb99cd4bcc4f26550d76f18c81ecdb530b62
3
+ size 476401994
with-lp-images/validation-00012-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3718bd55d617a4e732104f2686459c0b8243c5daef82c737aceb3b3fa57b3eeb
3
+ size 460572864
with-lp-images/validation-00013-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:962eb2156b64246de27df2cffa2423b5289b679b8e6a902257102b5d43a22f11
3
+ size 492650338
with-lp-images/validation-00014-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d439b11648aea7a7e20c973e6bf325b05709c5043213db17a31e192b9b4ec9b5
3
+ size 476582880
with-lp-images/validation-00015-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c6923084048734945b40f180be2f1fd9a58edef82207261f5c7bda71ce174ce
3
+ size 525163104
with-lp-images/validation-00016-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dbcc96863d880ed71e5efb8162b634e5fa03a02f7f4d5d0f8c249718861882eb
3
+ size 445490213
with-lp-images/validation-00017-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fad9cca057c1e11c17eb4406328ab016c74c363ed7b9203584a19de2c91296ff
3
+ size 405356279
with-lp-images/validation-00018-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce1896bdde9d934a3e4db0968ea5a1c49675436a3208d1f703b5ef3ebb7495e3
3
+ size 458396545
with-lp-images/validation-00019-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:792a0496c739035eaa0562c75db0f2da68256bfeed29eacd960f60d4b4088fef
3
+ size 542258743
with-lp-images/validation-00020-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57a4e41e2181f3223a729f9296545ae9dfbf16a4924556bda94fd103a0685d75
3
+ size 512317769
with-lp-images/validation-00021-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7059ef4f7890d28d28de030b992e1b479ae4125e7b9cec9c75e86ca084cf36af
3
+ size 488244510
with-lp-images/validation-00022-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47d9a3e68229df803e9844d8dce0feba2034bbe1668e1d01d13a818be31d427f
3
+ size 453565679
with-lp-images/validation-00023-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16c4296dd73ffb08a8538a3e621dc819696eb2814eb07e114df42aee17e4c3f2
3
+ size 443446934
with-lp-images/validation-00024-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0e57c8670f4a4f8fc46d57aee403479e38a1e3178cf6913f29e940908e0195d
3
+ size 444343118
with-lp-images/validation-00025-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eccf1519c4c8d69caa2aba301e17e4a963ef94d95714114218af6ab7caf570a3
3
+ size 471879316
with-lp-images/validation-00026-of-00027.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d49337ab7062523fd4ce6a800cca4fe159bb17f67683ebd70cfe6af29cf92c7
3
+ size 448405169