Datasets:

Languages:
English
ArXiv:
License:
File size: 3,814 Bytes
234f610
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Source Records

This folder stores supplemental source-side information for the packaged benchmark samples.

## Contents

- `by_id/<id>.json`: one merged JSON record per packaged sample ID.
- `html_metadata.json`: filtered HTML-derived metadata for packaged sample IDs.
- `summary.json`: coverage summary for the supplemental export.

## Why this exists

The canonical benchmark splits are intentionally task-oriented. They are good for training and evaluation, but some users may want richer provenance fields from the original Glazy pages, such as:

- page title
- author name
- author URL
- long-form description
- page-level status
- HTML-derived UMF and related ratios

The per-sample JSON files expose these fields without forcing users to parse the raw HTML themselves.

## Relationship to canonical benchmark files

These files are supplemental. The benchmark-facing train/test splits remain the authoritative interface for evaluation.

## Reader script

Use `../tools/read_source_record.py` to inspect the packaged source-side data without writing your own loader.

The script supports both quick one-off inspection and small batch exports.

### What it can do

- Read one or many sample IDs.
- Read IDs from a text file.
- Return the full merged sample record.
- Return shortcuts such as `title`, `author`, `description`, `umf`, and `raw_html_path`.
- Drill into nested fields with a dotted `--path` lookup.
- Preview the raw HTML directly, with optional tag stripping.
- Export results as `json`, `jsonl`, or plain text.
- Save output to a file instead of stdout.

### Common examples

Quick summary:

```bash

python huggingface/tools/read_source_record.py --summary

```

List the first 10 packaged sample IDs:

```bash

python huggingface/tools/read_source_record.py --list-sample-ids 10

```

Read the full merged record for one sample:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 --field full

```

Read a convenience field:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 --field umf

python huggingface/tools/read_source_record.py --sample-id 100018 --field html_metadata

python huggingface/tools/read_source_record.py --sample-id 100018 --field title

python huggingface/tools/read_source_record.py --sample-id 100018 --field raw_html_path

```

Read a nested path inside the selected field:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 --field full --path property_prediction.test.recipe.umf

python huggingface/tools/read_source_record.py --sample-id 100018 --field full --path html_metadata.title

```

Preview the raw HTML:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 --html-preview-chars 500

python huggingface/tools/read_source_record.py --sample-id 100018 --html-preview-chars 500 --html-preview-strip-tags

```

Read multiple samples at once:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 10009 10023 --field title

```

Read sample IDs from a file:

```bash

python huggingface/tools/read_source_record.py --sample-id-file sample_ids.txt --field raw_html_path --output-format jsonl

```

Export to a file:

```bash

python huggingface/tools/read_source_record.py --sample-id 100018 10009 --field full --output-format jsonl --output out/source_records.jsonl

```

### Notes

- `--field umf` returns the first available UMF found in the merged sample record, preferring split-aligned recipe data and then HTML-derived metadata.
- `--path` is applied after `--field` selection, so `--field full --path image_generation.train.metadata.image_path` works as expected.
- For batch usage, `jsonl` is usually the easiest format to consume downstream.