Convert dataset to Parquet
#2
by
dchichkov
- opened
This view is limited to 50 files because it contains too many changes.
See the raw diff here.
- README.md +29 -0
- images/1000_miles_north.png → data/train-00000-of-00001.parquet +2 -2
- explainxkcd.py +0 -55
- explainxkcd_2795.json +0 -0
- images/10000_hours.png +0 -3
- images/1000_comics_small.png +0 -3
- images/1000_times.png +0 -3
- images/10_day_forecast.png +0 -3
- images/11th_grade.png +0 -3
- images/1337_part_1.png +0 -3
- images/1337_part_2.png +0 -3
- images/1337_part_3.png +0 -3
- images/1337_part_4.png +0 -3
- images/1337_part_5.png +0 -3
- images/1921_fact_checker.png +0 -3
- images/1991_and_2021.png +0 -3
- images/1_100000th_scale_world.png +0 -3
- images/1_10000th_scale_world.png +0 -3
- images/1_1000th_scale_world.png +0 -3
- images/1_to_10.png +0 -3
- images/1_to_1_scale_2x.png +0 -3
- images/2008_christmas_special.png +0 -3
- images/2009_called.png +0 -3
- images/2010_and_2020.png +0 -3
- images/2016_conversation_guide.png +0 -3
- images/2016_election_map.png +0 -3
- images/2018_cve_list.png +0 -3
- images/2020_election_map.png +0 -3
- images/2020_google_trends.png +0 -3
- images/2445.png +0 -3
- images/26_second_pulse.png +0 -3
- images/28_hour_day.png +0 -3
- images/30_days_hath_september.png +0 -3
- images/3d.png +0 -3
- images/3d_printer.png +0 -3
- images/3x9.png +0 -3
- images/4_5_degrees.png +0 -3
- images/4th_of_july.png +0 -3
- images/50_ccs.png +0 -3
- images/50_ways.png +0 -3
- images/53_cards.png +0 -3
- images/65_years.png +0 -3
- images/6_6_time.png +0 -3
- images/6_foot_zone.png +0 -3
- images/7_eleven.png +0 -3
- images/90s_flowchart.png +0 -3
- images/90s_kid.png +0 -3
- images/90s_kid_space_program.png +0 -3
- images/Astronomer_Hotline.png +0 -3
- images/Greatest_Scientist.png +0 -3
README.md
CHANGED
|
@@ -9,6 +9,35 @@ tags:
|
|
| 9 |
pretty_name: Explain XKCD
|
| 10 |
size_categories:
|
| 11 |
- 1K<n<10K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# Dataset Card for Explain XKCD
|
|
|
|
| 9 |
pretty_name: Explain XKCD
|
| 10 |
size_categories:
|
| 11 |
- 1K<n<10K
|
| 12 |
+
dataset_info:
|
| 13 |
+
features:
|
| 14 |
+
- name: number
|
| 15 |
+
dtype: string
|
| 16 |
+
- name: date
|
| 17 |
+
dtype: string
|
| 18 |
+
- name: title
|
| 19 |
+
dtype: string
|
| 20 |
+
- name: before
|
| 21 |
+
dtype: string
|
| 22 |
+
- name: image
|
| 23 |
+
dtype: image
|
| 24 |
+
- name: titletext
|
| 25 |
+
dtype: string
|
| 26 |
+
- name: transcript
|
| 27 |
+
dtype: string
|
| 28 |
+
- name: explanation
|
| 29 |
+
dtype: string
|
| 30 |
+
splits:
|
| 31 |
+
- name: train
|
| 32 |
+
num_bytes: 183315711.73
|
| 33 |
+
num_examples: 2795
|
| 34 |
+
download_size: 226687075
|
| 35 |
+
dataset_size: 183315711.73
|
| 36 |
+
configs:
|
| 37 |
+
- config_name: default
|
| 38 |
+
data_files:
|
| 39 |
+
- split: train
|
| 40 |
+
path: data/train-*
|
| 41 |
---
|
| 42 |
|
| 43 |
# Dataset Card for Explain XKCD
|
images/1000_miles_north.png → data/train-00000-of-00001.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:7df70ee38a314ef119dc5ad729719ed295ea91afecc1b0134ed2d889070063d5
|
| 3 |
+
size 226687075
|
explainxkcd.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import os
|
| 3 |
-
import datasets
|
| 4 |
-
|
| 5 |
-
class ExplainXKCD(datasets.GeneratorBasedBuilder):
|
| 6 |
-
"""DatasetBuilder for Explain XKCD (JSONL + images)."""
|
| 7 |
-
VERSION = datasets.Version("1.0.0")
|
| 8 |
-
BUILDER_CONFIGS = [
|
| 9 |
-
datasets.BuilderConfig(
|
| 10 |
-
name="default",
|
| 11 |
-
version=VERSION,
|
| 12 |
-
description="Explain XKCD comics with image loading",
|
| 13 |
-
),
|
| 14 |
-
]
|
| 15 |
-
|
| 16 |
-
def _info(self):
|
| 17 |
-
return datasets.DatasetInfo(
|
| 18 |
-
description="xkcd comics imported from JSONL with local image files",
|
| 19 |
-
features=datasets.Features({
|
| 20 |
-
"number": datasets.Value("string"),
|
| 21 |
-
"date": datasets.Value("string"),
|
| 22 |
-
"title": datasets.Value("string"),
|
| 23 |
-
"before": datasets.Value("string"),
|
| 24 |
-
"image": datasets.Image(), # will resolve local file paths
|
| 25 |
-
"titletext": datasets.Value("string"),
|
| 26 |
-
"transcript": datasets.Value("string"),
|
| 27 |
-
"explanation": datasets.Value("string"),
|
| 28 |
-
}),
|
| 29 |
-
supervised_keys=None,
|
| 30 |
-
homepage="https://www.explainxkcd.com/wiki/index.php/Main_Page",
|
| 31 |
-
citation="See repository licensing and citation information.",
|
| 32 |
-
)
|
| 33 |
-
|
| 34 |
-
def _split_generators(self, dl_manager):
|
| 35 |
-
# No remote download: assume both JSONL and images/ live in repo root
|
| 36 |
-
return [
|
| 37 |
-
datasets.SplitGenerator(
|
| 38 |
-
name=datasets.Split.TRAIN,
|
| 39 |
-
gen_kwargs={
|
| 40 |
-
"jsonl_path": "explainxkcd_2795.json",
|
| 41 |
-
"images_dir": "images",
|
| 42 |
-
},
|
| 43 |
-
),
|
| 44 |
-
]
|
| 45 |
-
|
| 46 |
-
def _generate_examples(self, jsonl_path, images_dir):
|
| 47 |
-
"""Yields examples as (key, example_dict)."""
|
| 48 |
-
with open(jsonl_path, encoding="utf-8") as f:
|
| 49 |
-
for idx, line in enumerate(f):
|
| 50 |
-
record = json.loads(line)
|
| 51 |
-
# Attach local image file path, if present
|
| 52 |
-
img_file = record.get("image")
|
| 53 |
-
if img_file:
|
| 54 |
-
record["image"] = os.path.join(images_dir, img_file)
|
| 55 |
-
yield idx, record
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
explainxkcd_2795.json
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
images/10000_hours.png
DELETED
Git LFS Details
|
images/1000_comics_small.png
DELETED
Git LFS Details
|
images/1000_times.png
DELETED
Git LFS Details
|
images/10_day_forecast.png
DELETED
Git LFS Details
|
images/11th_grade.png
DELETED
Git LFS Details
|
images/1337_part_1.png
DELETED
Git LFS Details
|
images/1337_part_2.png
DELETED
Git LFS Details
|
images/1337_part_3.png
DELETED
Git LFS Details
|
images/1337_part_4.png
DELETED
Git LFS Details
|
images/1337_part_5.png
DELETED
Git LFS Details
|
images/1921_fact_checker.png
DELETED
Git LFS Details
|
images/1991_and_2021.png
DELETED
Git LFS Details
|
images/1_100000th_scale_world.png
DELETED
Git LFS Details
|
images/1_10000th_scale_world.png
DELETED
Git LFS Details
|
images/1_1000th_scale_world.png
DELETED
Git LFS Details
|
images/1_to_10.png
DELETED
Git LFS Details
|
images/1_to_1_scale_2x.png
DELETED
Git LFS Details
|
images/2008_christmas_special.png
DELETED
Git LFS Details
|
images/2009_called.png
DELETED
Git LFS Details
|
images/2010_and_2020.png
DELETED
Git LFS Details
|
images/2016_conversation_guide.png
DELETED
Git LFS Details
|
images/2016_election_map.png
DELETED
Git LFS Details
|
images/2018_cve_list.png
DELETED
Git LFS Details
|
images/2020_election_map.png
DELETED
Git LFS Details
|
images/2020_google_trends.png
DELETED
Git LFS Details
|
images/2445.png
DELETED
Git LFS Details
|
images/26_second_pulse.png
DELETED
Git LFS Details
|
images/28_hour_day.png
DELETED
Git LFS Details
|
images/30_days_hath_september.png
DELETED
Git LFS Details
|
images/3d.png
DELETED
Git LFS Details
|
images/3d_printer.png
DELETED
Git LFS Details
|
images/3x9.png
DELETED
Git LFS Details
|
images/4_5_degrees.png
DELETED
Git LFS Details
|
images/4th_of_july.png
DELETED
Git LFS Details
|
images/50_ccs.png
DELETED
Git LFS Details
|
images/50_ways.png
DELETED
Git LFS Details
|
images/53_cards.png
DELETED
Git LFS Details
|
images/65_years.png
DELETED
Git LFS Details
|
images/6_6_time.png
DELETED
Git LFS Details
|
images/6_foot_zone.png
DELETED
Git LFS Details
|
images/7_eleven.png
DELETED
Git LFS Details
|
images/90s_flowchart.png
DELETED
Git LFS Details
|
images/90s_kid.png
DELETED
Git LFS Details
|
images/90s_kid_space_program.png
DELETED
Git LFS Details
|
images/Astronomer_Hotline.png
DELETED
Git LFS Details
|
images/Greatest_Scientist.png
DELETED
Git LFS Details
|