Datasets:
Tasks:
Image-to-Text
Modalities:
Text
Formats:
webdataset
Languages:
English
Size:
1K - 10K
License:
Update README.md
Browse files
README.md
CHANGED
@@ -35,6 +35,30 @@ PDFA dataset is a document dataset filtered from the SafeDocs corpus, aka CC-MAI
|
|
35 |
This instance of PDFA is in [webdataset](https://github.com/webdataset/webdataset/commits/main) .tar format and can be used with derived forms of the `webdataset` library.
|
36 |
We recommend to use it with the [chug](https://github.com/huggingface/chug) library, an optimized library for distributed data loading.
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# TODO The following example uses fitz which is AGPL. We should also recommend the same with pypdf.
|
39 |
|
40 |
```python
|
|
|
35 |
This instance of PDFA is in [webdataset](https://github.com/webdataset/webdataset/commits/main) .tar format and can be used with derived forms of the `webdataset` library.
|
36 |
We recommend to use it with the [chug](https://github.com/huggingface/chug) library, an optimized library for distributed data loading.
|
37 |
|
38 |
+
|
39 |
+
```python
|
40 |
+
dataset = load_dataset('pixparse/pdfa-english-train', streaming=True)
|
41 |
+
print(next(iter(dataset['train'])).keys())
|
42 |
+
>> dict_keys(['__key__', '__url__', 'json', 'ocr', 'pdf', 'tif'])
|
43 |
+
```
|
44 |
+
|
45 |
+
For faster download, you can use directly the `huggingface_hub` library. Make sure `hf_transfer` is installed prior to downloading and mind that you have enough space locally.
|
46 |
+
|
47 |
+
```python
|
48 |
+
import os
|
49 |
+
|
50 |
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
51 |
+
|
52 |
+
from huggingface_hub import HfApi, logging
|
53 |
+
|
54 |
+
#logging.set_verbosity_debug()
|
55 |
+
hf = HfApi()
|
56 |
+
hf.snapshot_download("pixparse/pdfa-english-train", repo_type="dataset", local_dir_use_symlinks=False)
|
57 |
+
|
58 |
+
```
|
59 |
+
On a normal setting, the 1.5TB can be downloaded in approximately 4 hours.
|
60 |
+
|
61 |
+
|
62 |
# TODO The following example uses fitz which is AGPL. We should also recommend the same with pypdf.
|
63 |
|
64 |
```python
|