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)
Files changed (8)
- README.md+21
- document.pngDeleted
- document_2.pngDeleted
- fixtures_docvqa.pyDeleted-94
- image/test-00000-of-00001.parquetAdded+3
- nougat_paper.pdfDeleted
- nougat_paper.pngDeleted
- nougat_pdf.pngDeleted
123This dataset includes 2 document images of the [DocVQA](https://docvqa.org/) dataset.They are used for testing the LayoutLMv2FeatureExtractor + LayoutLMv2Processor inside the HuggingFace Transformers library.123456789101112131415161718192021222324---dataset_info:config_name: imagefeatures:- name: iddtype: string- name: filedtype: stringsplits:- name: testnum_bytes: 394num_examples: 2download_size: 1974dataset_size: 394configs:- config_name: imagedata_files:- split: testpath: image/test-*default: true---This dataset includes 2 document images of the [DocVQA](https://docvqa.org/) dataset.They are used for testing the LayoutLMv2FeatureExtractor + LayoutLMv2Processor inside the HuggingFace Transformers library.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394# coding=utf-8# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.
import textwrap
import datasets
_CITATION = """\\n"""
_DESCRIPTION = """\\n"""
class FixturesDocVQAConfig(datasets.BuilderConfig): """BuilderConfig for fixtures DocVQA"""
def __init__( self, data_url, url, task_templates=None, **kwargs, ): super(FixturesDocVQAConfig, self).__init__( version=datasets.Version("1.9.0", ""), **kwargs ) self.data_url = data_url self.url = url self.task_templates = task_templates
class FixturesDocVQA(datasets.GeneratorBasedBuilder): """Fixtures of the DocVQA dataset. Include 2 document images."""
BUILDER_CONFIGS = [ FixturesDocVQAConfig( name="image", description=textwrap.dedent(""), url="", data_url="", ) ]
DEFAULT_CONFIG_NAME = "image"
def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "id": datasets.Value("string"), "file": datasets.Value("string"), } ), supervised_keys=("file",), homepage=self.config.url, citation=_CITATION, )
def _split_generators(self, dl_manager): DL_URLS = [ f"https://huggingface.co/datasets/hf-internal-testing/fixtures_docvqa/raw/main/{name}" for name in ["document.png", "document_2.png"] ] archive_path = dl_manager.download_and_extract(DL_URLS) return [ datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={"archive_path": archive_path}, ), ]
def _generate_examples(self, archive_path): """Generate examples.""" for i, filename in enumerate(archive_path): key = str(i) example = { "id": key, "file": filename, } yield key, example123version https://git-lfs.github.com/spec/v1oid sha256:dfe218b7113157977661b58b4128e554a477e53e1c727c2e10a9cc31384054b6size 1974README.md+21
document.pngDeleted
document_2.pngDeleted
fixtures_docvqa.pyDeleted-94
image/test-00000-of-00001.parquetAdded+3
nougat_paper.pdfDeleted
nougat_paper.pngDeleted
nougat_pdf.pngDeleted