Datasets:

Modalities:
Image
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
Dask
License:
Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
397
7.19k
question_id
int64
339
65.4k
question
stringlengths
11
166
answers
sequencelengths
1
6
data_split
stringclasses
1 value
ocr_results
dict
other_metadata
dict
9,951
When is the contract effective date?
[ "7 - 1 - 99" ]
train
{ "page": 1, "clockwise_orientation": 359.96, "width": 1692, "height": 2245, "unit": "pixel", "lines": [ { "bounding_box": [ 622, 138, 1137, 136, 1138, 167, 622, 168 ], "text": "R. J. REYNOLDS TOBACCO COMPANY", "word...
{ "ucsf_document_id": "ffbf0023", "ucsf_document_page_no": "4", "doc_id": 3278, "image": "ffbf0023_4.png" }
9,952
What is the type of organization?
[ "Corporation" ]
train
{ "page": 1, "clockwise_orientation": 359.96, "width": 1692, "height": 2245, "unit": "pixel", "lines": [ { "bounding_box": [ 622, 138, 1137, 136, 1138, 167, 622, 168 ], "text": "R. J. REYNOLDS TOBACCO COMPANY", "word...
{ "ucsf_document_id": "ffbf0023", "ucsf_document_page_no": "4", "doc_id": 3278, "image": "ffbf0023_4.png" }
9,953
What is the corporation name?
[ "USA Petroleum", "USA PETROLEUM" ]
train
{ "page": 1, "clockwise_orientation": 359.96, "width": 1692, "height": 2245, "unit": "pixel", "lines": [ { "bounding_box": [ 622, 138, 1137, 136, 1138, 167, 622, 168 ], "text": "R. J. REYNOLDS TOBACCO COMPANY", "word...
{ "ucsf_document_id": "ffbf0023", "ucsf_document_page_no": "4", "doc_id": 3278, "image": "ffbf0023_4.png" }
10,212
What is written in the Zip code Field ?
[ "91301" ]
train
{"page":1,"clockwise_orientation":0.33,"width":1692,"height":2245,"unit":"pixel","lines":[{"bounding(...TRUNCATED)
{ "ucsf_document_id": "ffbf0023", "ucsf_document_page_no": "6", "doc_id": 3343, "image": "ffbf0023_6.png" }
10,213
What is the Contract Effective Date ?
[ "7-1-99" ]
train
{"page":1,"clockwise_orientation":0.33,"width":1692,"height":2245,"unit":"pixel","lines":[{"bounding(...TRUNCATED)
{ "ucsf_document_id": "ffbf0023", "ucsf_document_page_no": "6", "doc_id": 3343, "image": "ffbf0023_6.png" }
36,060
what is the price at bottom of the page ?
[ "$1.90" ]
train
{"page":1,"clockwise_orientation":0.2,"width":1684,"height":2186,"unit":"pixel","lines":[{"bounding_(...TRUNCATED)
{ "ucsf_document_id": "ffbf0227", "ucsf_document_page_no": "1", "doc_id": 10388, "image": "ffbf0227_1.png" }
26,902
What is the abbreviation used for BIOMETRICS?
[ "BIO.", "Bio." ]
train
{"page":1,"clockwise_orientation":359.95,"width":1784,"height":2283,"unit":"pixel","lines":[{"boundi(...TRUNCATED)
{ "ucsf_document_id": "ffbg0227", "ucsf_document_page_no": "3", "doc_id": 7502, "image": "ffbg0227_3.png" }
26,905
What does Clin. PM stand for?
[ "CLINICAL PREVENTIVE MEDICINE" ]
train
{"page":1,"clockwise_orientation":359.95,"width":1784,"height":2283,"unit":"pixel","lines":[{"boundi(...TRUNCATED)
{ "ucsf_document_id": "ffbg0227", "ucsf_document_page_no": "3", "doc_id": 7502, "image": "ffbg0227_3.png" }
26,914
What does Pop. D/Dem denote?
[ "POPULATION DYNAMICS/DEMOGRAPHY" ]
train
{"page":1,"clockwise_orientation":359.95,"width":1784,"height":2283,"unit":"pixel","lines":[{"boundi(...TRUNCATED)
{ "ucsf_document_id": "ffbg0227", "ucsf_document_page_no": "3", "doc_id": 7502, "image": "ffbg0227_3.png" }
26,916
What is the abbreviation of MILITARY PREVENTIVE MEDICINE?
[ "M. PREV. M.", "M. Prev. M." ]
train
{"page":1,"clockwise_orientation":359.95,"width":1784,"height":2283,"unit":"pixel","lines":[{"boundi(...TRUNCATED)
{ "ucsf_document_id": "ffbg0227", "ucsf_document_page_no": "3", "doc_id": 7502, "image": "ffbg0227_3.png" }
End of preview. Expand in Data Studio

Dataset Card for DocVQA Dataset

Dataset Summary

DocVQA dataset is a document dataset introduced in Mathew et al. (2021) consisting of 50,000 questions defined on 12,000+ document images.

Please visit the challenge page (https://rrc.cvc.uab.es/?ch=17) and paper (https://arxiv.org/abs/2007.00398) for further information.

Usage

This dataset can be used with current releases of Hugging Face datasets library. Here is an example using a custom collator to bundle batches in a trainable way on the train split


from datasets import load_dataset

docvqa_dataset = load_dataset("pixparse/docvqa-single-page-questions", split="train"
)
next(iter(dataset["train"])).keys()
>>> dict_keys(['image', 'question_id', 'question', 'answers', 'data_split', 'ocr_results', 'other_metadata'])

image will be a byte string containing the image contents. answers is a list of possible answers, aligned with the expected inputs to the ANLS metric.

Calling

from PIL import Image
from io import BytesIO
image = Image.open(BytesIO(docvqa_dataset["train"][0]["image"]['bytes']))

will yield the image

An example of document available in docVQA

A document overlapping with tobacco on which questions are asked such as 'When is the contract effective date?' with the answer ['7 - 1 - 99']

The loader can then be iterated on normally and yields questions. Many questions rely on the same image, so there is some amount of data duplication.

For this sample 0, the question has just one possible answer, but in general answers is a list of strings.

# int identifier of the question

print(dataset["train"][0]['question_id'])
>>> 9951

# actual question

print(dataset["train"][0]['question'])
>>>'When is the contract effective date?'

# one-element list of accepted/ground truth answers for this question

print(dataset["train"][0]['answers'])
>>> ['7 - 1 - 99']

ocr_results contains OCR information about all files, which can be used for models that don't leverage only the image input.

Data Splits

Train

  • 10194 images, 39463 questions and answers.

Validation

  • 1286 images, 5349 questions and answers.

Test

  • 1,287 images, 5,188 questions.

Additional Information

Dataset Curators

For original authors of the dataset, see citation below.

Hugging Face points of contact for this instance: Pablo Montalvo, Ross Wightman

Licensing Information

MIT

Citation Information

@InProceedings{docvqa_wacv,
    author    = {Mathew, Minesh and Karatzas, Dimosthenis and Jawahar, C.V.},
    title     = {DocVQA: A Dataset for VQA on Document Images},
    booktitle = {WACV},
    year      = {2021},
    pages     = {2200-2209}
}
Downloads last month
1,227

Models trained or fine-tuned on pixparse/docvqa-single-page-questions

Collection including pixparse/docvqa-single-page-questions

Papers for pixparse/docvqa-single-page-questions