Convert dataset to Parquet (#1)
Browse files- Convert dataset to Parquet (bdfabe7128645b351e8c115c2ad902b5da93c887)
- Delete loading script (2a70c7a78d055036c3ce4915bc0ed34ae3bb627c)
- Delete data file (510ad4155f62a59630e5bfd8a32efd1716320c29)
- Delete data file (4dc433d42ab5eff103f344957a6cc20ae9061b95)
- Delete data file (8e77cb72f8675d14854be4d785f0c53254e07ba1)
- Delete data file (698e1fd328452dfc7a2f2cdb6632e190cdf4a6ec)
- Delete data file (775fb71162486fb048bea63a175129d3b2e48d61)
- README.md +21 -0
- document.png +0 -0
- document_2.png +0 -0
- fixtures_docvqa.py +0 -94
- image/test-00000-of-00001.parquet +3 -0
- nougat_paper.pdf +0 -0
- nougat_paper.png +0 -0
- nougat_pdf.png +0 -0
README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
This dataset includes 2 document images of the [DocVQA](https://docvqa.org/) dataset.
|
| 2 |
|
| 3 |
They are used for testing the LayoutLMv2FeatureExtractor + LayoutLMv2Processor inside the HuggingFace Transformers library.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
config_name: image
|
| 4 |
+
features:
|
| 5 |
+
- name: id
|
| 6 |
+
dtype: string
|
| 7 |
+
- name: file
|
| 8 |
+
dtype: string
|
| 9 |
+
splits:
|
| 10 |
+
- name: test
|
| 11 |
+
num_bytes: 394
|
| 12 |
+
num_examples: 2
|
| 13 |
+
download_size: 1974
|
| 14 |
+
dataset_size: 394
|
| 15 |
+
configs:
|
| 16 |
+
- config_name: image
|
| 17 |
+
data_files:
|
| 18 |
+
- split: test
|
| 19 |
+
path: image/test-*
|
| 20 |
+
default: true
|
| 21 |
+
---
|
| 22 |
This dataset includes 2 document images of the [DocVQA](https://docvqa.org/) dataset.
|
| 23 |
|
| 24 |
They are used for testing the LayoutLMv2FeatureExtractor + LayoutLMv2Processor inside the HuggingFace Transformers library.
|
document.png
DELETED
|
Binary file (534 kB)
|
|
|
document_2.png
DELETED
|
Binary file (1.27 MB)
|
|
|
fixtures_docvqa.py
DELETED
|
@@ -1,94 +0,0 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
| 3 |
-
#
|
| 4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
-
# you may not use this file except in compliance with the License.
|
| 6 |
-
# You may obtain a copy of the License at
|
| 7 |
-
#
|
| 8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
-
#
|
| 10 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
-
# See the License for the specific language governing permissions and
|
| 14 |
-
# limitations under the License.
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
import textwrap
|
| 18 |
-
|
| 19 |
-
import datasets
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
_CITATION = """\\n"""
|
| 23 |
-
|
| 24 |
-
_DESCRIPTION = """\\n"""
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
class FixturesDocVQAConfig(datasets.BuilderConfig):
|
| 28 |
-
"""BuilderConfig for fixtures DocVQA"""
|
| 29 |
-
|
| 30 |
-
def __init__(
|
| 31 |
-
self,
|
| 32 |
-
data_url,
|
| 33 |
-
url,
|
| 34 |
-
task_templates=None,
|
| 35 |
-
**kwargs,
|
| 36 |
-
):
|
| 37 |
-
super(FixturesDocVQAConfig, self).__init__(
|
| 38 |
-
version=datasets.Version("1.9.0", ""), **kwargs
|
| 39 |
-
)
|
| 40 |
-
self.data_url = data_url
|
| 41 |
-
self.url = url
|
| 42 |
-
self.task_templates = task_templates
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
class FixturesDocVQA(datasets.GeneratorBasedBuilder):
|
| 46 |
-
"""Fixtures of the DocVQA dataset. Include 2 document images."""
|
| 47 |
-
|
| 48 |
-
BUILDER_CONFIGS = [
|
| 49 |
-
FixturesDocVQAConfig(
|
| 50 |
-
name="image",
|
| 51 |
-
description=textwrap.dedent(""),
|
| 52 |
-
url="",
|
| 53 |
-
data_url="",
|
| 54 |
-
)
|
| 55 |
-
]
|
| 56 |
-
|
| 57 |
-
DEFAULT_CONFIG_NAME = "image"
|
| 58 |
-
|
| 59 |
-
def _info(self):
|
| 60 |
-
return datasets.DatasetInfo(
|
| 61 |
-
description=_DESCRIPTION,
|
| 62 |
-
features=datasets.Features(
|
| 63 |
-
{
|
| 64 |
-
"id": datasets.Value("string"),
|
| 65 |
-
"file": datasets.Value("string"),
|
| 66 |
-
}
|
| 67 |
-
),
|
| 68 |
-
supervised_keys=("file",),
|
| 69 |
-
homepage=self.config.url,
|
| 70 |
-
citation=_CITATION,
|
| 71 |
-
)
|
| 72 |
-
|
| 73 |
-
def _split_generators(self, dl_manager):
|
| 74 |
-
DL_URLS = [
|
| 75 |
-
f"https://huggingface.co/datasets/hf-internal-testing/fixtures_docvqa/raw/main/{name}"
|
| 76 |
-
for name in ["document.png", "document_2.png"]
|
| 77 |
-
]
|
| 78 |
-
archive_path = dl_manager.download_and_extract(DL_URLS)
|
| 79 |
-
return [
|
| 80 |
-
datasets.SplitGenerator(
|
| 81 |
-
name=datasets.Split.TEST,
|
| 82 |
-
gen_kwargs={"archive_path": archive_path},
|
| 83 |
-
),
|
| 84 |
-
]
|
| 85 |
-
|
| 86 |
-
def _generate_examples(self, archive_path):
|
| 87 |
-
"""Generate examples."""
|
| 88 |
-
for i, filename in enumerate(archive_path):
|
| 89 |
-
key = str(i)
|
| 90 |
-
example = {
|
| 91 |
-
"id": key,
|
| 92 |
-
"file": filename,
|
| 93 |
-
}
|
| 94 |
-
yield key, example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dfe218b7113157977661b58b4128e554a477e53e1c727c2e10a9cc31384054b6
|
| 3 |
+
size 1974
|
nougat_paper.pdf
DELETED
|
Binary file (138 kB)
|
|
|
nougat_paper.png
DELETED
|
Binary file (208 kB)
|
|
|
nougat_pdf.png
DELETED
|
Binary file (208 kB)
|
|
|