WebColor dataset

January 23, 2023 ยท View on GitHub

A dataset for web page coloring task consisting of e-commerce mobile web pages, adapted from the Klarna Product Page Dataset.

Training examplesData structure

Download dataset

./download.sh {main,cache,text,image}
  • "main" (1.5 GB)

    • Main dataset
    • Split file
    • Note: Processing to DGL format takes about 50 minutes.
  • "cache" (693 MB, recommended)

    • Processed DGL cache
    • Split file
  • "text" (356 MB, optional)

    • Text data for reference
  • "image" (6.3 GB, optional)

    • Image data for reference

Data format

The dataset is organized in HDF5 format, and its contents can be accessed using the h5py library as follows:

import h5py

f = h5py.File('data/webcolor_v1.1.hdf5')
for data_name, grp in f.items():
    for node_id, dset in grp.items():
        node_id = int(node_id)
        parent_id = int(dset[()])
        node_attrs = dict(dset.attrs)
VariableTypeDescription
data_namestrName to identify the web page in the original datasets
node_idintNode ID
parent_idintParent node ID (-1 indicates no parent, i.e., root)
node_attrsdictMetadata corresponding to the node (element)

The contents of node_attrs are listed below.

KeyValue typeDescription
"text_color"strText color (computed value of the CSS property color, text elements only)
"background_color"strBackground color (computed value of the CSS property background-color)
"sibling_order"intOrder between sibling elements
"html_tag"strHTML tag
"text_feat"numpy.ndarray
(dtype=float32,
shape=(13,))
Low-level features of text (text elements only)
"img_feat"numpy.ndarray
(dtype=float32,
shape=(13,))
Low-level features of image (image elements only)
"bgimg_feat"numpy.ndarray
(dtype=float32,
shape=(12,))
Low-level features of background image (only for elements with a background image)

Details of the text and image features can be found in the supplemental material.

Data split

Train: 27,630 pages
Val: 3,190 pages
Test: 13,228 pages

License

This dataset is based on the Klarna Product Page Dataset and is licensed under CC BY-NC-SA 4.0.

Versions

1.1: fix bug on text color (Dec 29, 2022)

1.0: v1 release (Dec 23, 2022)