File size: 934 Bytes
96c6379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
license: mit
task_categories:
- table-question-answering
language:
- en
tags:
- OCR
- Tables
- IDP
size_categories:
- n<1K
---

This dataset is generated syhthetically to create tables with following characteristics:
1. Empty cell percentage in following range [40,70] (Sparse)
2. There is no seperator between rows and columns (un-structured).
3. 4 <= num rows <= 10, 2 <= num columns <= 6 (Small)

### Load the dataset

```python
import io
import pandas as pd
from PIL import Image

def bytes_to_image(self, image_bytes: bytes):
  return Image.open(io.BytesIO(image_bytes))

def parse_annotations(self, annotations: str) -> pd.DataFrame:
  return pd.read_json(StringIO(annotations), orient="records")

test_data = load_dataset('nanonets/small_sparse_unstructured_table', split='test')
data_point = test_data[0]
image, gt_table = (
    bytes_to_image(data_point["images"]),
    parse_annotations(data_point["annotation"]),
)
```