Dataset Viewer
Full Screen
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'train' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    ArrowInvalid
Message:      JSON parse error: Column(/answer/[]/[]) changed from string to number in row 4
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
                  dataset = json.load(f)
                File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
                  return loads(fp.read(),
                File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                  return _default_decoder.decode(s)
                File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
                  raise JSONDecodeError("Extra data", s, end)
              json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1026)
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 240, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2216, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1239, in _head
                  return _examples_to_batch(list(self.take(n)))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1389, in __iter__
                  for key, example in ex_iterable:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1044, in __iter__
                  yield from islice(self.ex_iterable, self.n)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 282, in __iter__
                  for key, pa_table in self.generate_tables_fn(**self.kwargs):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Column(/answer/[]/[]) changed from string to number in row 4

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

WikiDT: Wikipedia Table Document dataset for table extraction and visual question answering

Dataset Summary

The WikiDT contains multi-level annotations and labels for the question-answering task based on images. Meanwhile, as the questions are answered from some table on the image, and WikiDT provides the table annotation to facilitate the diagnosis of the models and decompose the problem, WikiDT can be also directly used as a table recognition dataset.

The dataset contains 16,887 Wikipedia screenshot, which are segmented to 54,032 subpages since the full screenshots are potentially long. In total, there's 159,905 tables in the dataset. The number of question-answer samples is 70,652. Each QA sample contains triplets of <question, answer, full-page screenshot filename>, and is additionally annotated with retrieval labels (which subpage, and which table). 53,698 QA samples also have SQL annotation.

For each subpage, OCR and table extraction annotations from two sources are available. While rendering the screenshots, the ground truth table annotation is recorded. Meanwhile, to make the dataset realistic, we also requested OCR and table extraction from Amazon Textract for each subpage (results obtained during Feb.28, 2023 - Mar.6, 2023).

Languages

English

Dataset Structure

Once downloaded, the WikiDT has the following parts. The downloaded files are around 77GB. Please ensure you have at least 160GB since we will be extract individual files from the tars.

.
β”œβ”€β”€ WikiTableExtraction
β”‚   β”œβ”€β”€ detection.partaa
β”‚   β”œβ”€β”€ detection.partab
β”‚   β”œβ”€β”€ detection.partac
β”‚   β”œβ”€β”€ detection.partad
β”‚   β”œβ”€β”€ detection.partae
β”‚   β”œβ”€β”€ detection.partaf
β”‚   β”œβ”€β”€ detection.partag
β”‚   β”œβ”€β”€ structure.partaa
β”‚   β”œβ”€β”€ structure.partab
β”‚   β”œβ”€β”€ structure.partac
β”‚   β”œβ”€β”€ structure.partad
β”‚   └── structure.partae
β”œβ”€β”€ images.partaa
β”œβ”€β”€ images.partab
β”œβ”€β”€ images.partac
β”œβ”€β”€ images.partad
β”œβ”€β”€ images.partae
β”œβ”€β”€ images.partaf
β”œβ”€β”€ images.partag
β”œβ”€β”€ images.partah
β”œβ”€β”€ images.partai
β”œβ”€β”€ ocr.tar
β”œβ”€β”€ samples
β”‚   β”œβ”€β”€ test.json
β”‚   β”œβ”€β”€ train.json
β”‚   └── val.json
└── tsv.tar

Please concat the part files and extract them into respective folder. For example, run

cd WikiTableExtraction/
cat detection.parta* | tar x

to extract the detection folder. Once you extracted all the tar files, the WikiDT dataset has the following file structure.

+--WikiDT-dataset
|  +--WikiTableExtraction
|  |  +--detection
|  |  |  +--images  # sub page images
|  |  |  +--train  # xml table bbox annotation
|  |  |  +--test  # xml table bbox annotation
|  |  |  +--val  # xml table bbox annotation
|  |  |  images_filelist.txt  # index of 54,032 images
|  |  |  test_filelist.txt  # index of 5,410 test samples 
|  |  |  train_filelist.txt  # index of 43,248 train samples
|  |  |  val_filelist.txt  # index of 5,347 val samples
|  |  +--structure
|  |  |  +--images  # images cropped to table region
|  |  |  +--train  # xml table bbox annotation
|  |  |  +--test  # xml table bbox annotation
|  |  |  +--val  # xml table bbox annotation
|  |  |  images_filelist.txt  # index of 159,898 images
|  |  |  test_filelist.txt  # index of 15,989 test samples
|  |  |  train_filelist.txt  # index of 129,980 train samples
|  |  |  val_filelist.txt  # index of 15,991 val samples
|  +--samples  # in total 70,652 TableVQA samples from the three json files 
|  |  +--train.json  #
|  |  +--test.json  #
|  |  +--val.json  #
|  +--images  # full page image
|  +--ocr  #  text and bbox for the table content
|  |  +--textract # detected by Amazon Textract API
|  |  +--web # extracted from HTML information
|  +--tsv  # extracted table in tsv format
|  |  +--textract # detected by Amazon Textract API
|  |  +--web # extracted from HTML information

Table VQA annotation example

Here is an example of an xml table bbox annotation from WikiDT-dataset/samples/[train|test|val].json/.

{'all_ocr_files_textract': ['ocr/textract/16301437_page_seg_0.json',
                            'ocr/textract/16301437_page_seg_1.json'],
 'all_ocr_files_web': ['ocr/web/16301437_page_seg_0.json',
                       'ocr/web/16301437_page_seg_1.json'],
 'all_table_files_textract': ['tsv/textract/16301437_page_0.tsv',
                              'tsv/textract/16301437_page_1.tsv'],
 'all_table_files_web': ['tsv/web/16301437_1.tsv', 'tsv/web/16301437_0.tsv'],
 'answer': [['don johnson buckeye st. classic']],
 'image': '16301437_page.png',
 'ocr_retrieval_file_textract': 'ocr/textract/16301437_page_seg_0.json',
 'ocr_retrieval_file_web': 'ocr/web/16301437_page_seg_0.json',
 'question': 'Name the Event which has a Score of 209-197?',
 'sample_id': '14190',
 'sql_str': "SELECT `event` FROM cur_table WHERE  `score` = '209-197'  ",
 'sub_page': ['16301437_page_seg_0.png', '16301437_page_seg_1.png'],
 'sub_page_retrieved': '16301437_page_seg_0.png',
 'subset': 'TFC',
 'table_id': '2-16301437-1',
 'table_retrieval_file_textract': 'tsv/textract/16301437_page_0.tsv',
 'table_retrieval_file_web': 'tsv/web/16301437_1.tsv'}

Table Detection annotation example

Here is an example of an xml table bbox annotation from WikiDT-dataset/WikiTableExtraction/structure/[train|test|val]/.

<annotation>
  <folder />
  <filename>204_147_page_crop_5.png</filename>
  <source>WikiDT Dataset</source>
  <size>
    <width>788</width>
    <height>540.0</height>
    <depth>3</depth>
  </size>
  <object>
    <name>table</name>
    <rowspan />
    <colspan />
    <bndbox>
      <xmin>10</xmin>
      <ymin>10</ymin>
      <xmax>778</xmax>
      <ymax>530</ymax>
    </bndbox>
  </object>
  <object>
    <name>header row</name>
    <rowspan />
    <colspan />
    <bndbox>
      <xmin>10</xmin>
      <ymin>10</ymin>
      <xmax>778</xmax>
      <ymax>33</ymax>
    </bndbox>
  </object> 
  <object>
    <name>header cell</name>
    <rowspan />
    <colspan>10</colspan>
    <bndbox>
      <xmin>12</xmin>
      <ymin>35</ymin>
      <xmax>776</xmax>
      <ymax>58</ymax>
    </bndbox>
  </object>
  <object>
    <name>table row</name>
    <rowspan />
    <colspan />
    <bndbox>
      <xmin>10</xmin>
      <ymin>60</ymin>
      <xmax>778</xmax>
      <ymax>530</ymax>
    </bndbox>
  </object>
</annotation>

Licensing Information

CC BY SA 3.0

Contributors

Hui Shi (Work done during her internship at Amazon)

Yusheng Xie (corresponding person)

Luis Goncalves

Downloads last month
254