Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -99,6 +99,20 @@ next(iter(dataset["train"])).keys()
|
|
99 |
```
|
100 |
`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](https://arxiv.org/abs/1905.13648).
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
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.
|
103 |
|
104 |
### Data Splits
|
|
|
99 |
```
|
100 |
`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](https://arxiv.org/abs/1905.13648).
|
101 |
|
102 |
+
Calling
|
103 |
+
|
104 |
+
```python
|
105 |
+
from PIL import Image
|
106 |
+
from io import BytesIO
|
107 |
+
image = Image.open(BytesIO(docvqa_dataset["train"][0]["image"]['bytes']))
|
108 |
+
```
|
109 |
+
will yield the image
|
110 |
+
|
111 |
+
<center>
|
112 |
+
<img src="https://huggingface.co/datasets/pixparse/docvqa-single-page-questions/resolve/main/doc_images_docvqa/docvqa_example.png" alt="An example of document available in docVQA" width="600" height="300">
|
113 |
+
<p><em>A document overlapping with tobacco on which questions are asked such as 'When is the contract effective date?' with the answer ['7 - 1 - 99']</em></p>
|
114 |
+
</center>
|
115 |
+
|
116 |
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.
|
117 |
|
118 |
### Data Splits
|