Update README.md
Browse files
README.md
CHANGED
@@ -10,4 +10,30 @@ tags:
|
|
10 |
- Tables
|
11 |
size_categories:
|
12 |
- n<1K
|
13 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
- Tables
|
11 |
size_categories:
|
12 |
- n<1K
|
13 |
+
---
|
14 |
+
|
15 |
+
This dataset is generated syhthetically to create tables with following characteristics:
|
16 |
+
1. Empty cell percentage in following range [0,30] (Dense)
|
17 |
+
2. There is clear seperator between rows and columns (Structured).
|
18 |
+
3. 15 <= num rows <= 30, 7 <= num columns <= 15 (Large)
|
19 |
+
|
20 |
+
### Load the dataset
|
21 |
+
|
22 |
+
```python
|
23 |
+
import io
|
24 |
+
import pandas as pd
|
25 |
+
from PIL import Image
|
26 |
+
|
27 |
+
def bytes_to_image(self, image_bytes: bytes):
|
28 |
+
return Image.open(io.BytesIO(image_bytes))
|
29 |
+
|
30 |
+
def parse_annotations(self, annotations: str) -> pd.DataFrame:
|
31 |
+
return pd.read_json(StringIO(annotations), orient="records")
|
32 |
+
|
33 |
+
test_data = load_dataset('nanonets/long_dense_structured_table', split='test')
|
34 |
+
data_point = test_data[0]
|
35 |
+
image, gt_table = (
|
36 |
+
bytes_to_image(data_point["images"]),
|
37 |
+
parse_annotations(data_point["annotation"]),
|
38 |
+
)
|
39 |
+
```
|