Datasets:
Upload 5 files
Browse files- README.md +107 -0
- train-0000.parquet +3 -0
- train-0001.parquet +3 -0
- train-0002.parquet +3 -0
- train-0003.parquet +3 -0
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
features:
|
| 4 |
+
- name: page_filename
|
| 5 |
+
dtype: string
|
| 6 |
+
- name: pdf_filename
|
| 7 |
+
dtype: string
|
| 8 |
+
- name: image
|
| 9 |
+
dtype: image
|
| 10 |
+
struct:
|
| 11 |
+
- name: bytes
|
| 12 |
+
dtype: binary
|
| 13 |
+
- name: path
|
| 14 |
+
dtype: string
|
| 15 |
+
- name: ocr_text
|
| 16 |
+
dtype: string
|
| 17 |
+
- name: has_line
|
| 18 |
+
dtype: bool
|
| 19 |
+
- name: perspective_tr_x_shift
|
| 20 |
+
dtype: float32
|
| 21 |
+
- name: perspective_tr_y_shift
|
| 22 |
+
dtype: float32
|
| 23 |
+
- name: apply_lighting
|
| 24 |
+
dtype: bool
|
| 25 |
+
- name: blur_radius
|
| 26 |
+
dtype: float32
|
| 27 |
+
- name: lighting_center_x
|
| 28 |
+
dtype: float32
|
| 29 |
+
- name: lighting_center_y
|
| 30 |
+
dtype: float32
|
| 31 |
+
- name: perspective_br_y_shift
|
| 32 |
+
dtype: float32
|
| 33 |
+
- name: brightness_factor
|
| 34 |
+
dtype: float32
|
| 35 |
+
- name: num_spots
|
| 36 |
+
dtype: float32
|
| 37 |
+
- name: spots
|
| 38 |
+
dtype: list
|
| 39 |
+
- name: perspective_tl_x_shift
|
| 40 |
+
dtype: float32
|
| 41 |
+
- name: line_width
|
| 42 |
+
dtype: float32
|
| 43 |
+
- name: line_color
|
| 44 |
+
dtype: float32
|
| 45 |
+
- name: has_spots
|
| 46 |
+
dtype: bool
|
| 47 |
+
- name: line_pos
|
| 48 |
+
dtype: float32
|
| 49 |
+
- name: noise_level
|
| 50 |
+
dtype: float32
|
| 51 |
+
- name: perspective_tl_y_shift
|
| 52 |
+
dtype: float32
|
| 53 |
+
- name: is_horizontal
|
| 54 |
+
dtype: bool
|
| 55 |
+
- name: jpeg_quality
|
| 56 |
+
dtype: int64
|
| 57 |
+
- name: max_perspective_angle
|
| 58 |
+
dtype: float32
|
| 59 |
+
- name: shadow_intensity
|
| 60 |
+
dtype: float32
|
| 61 |
+
- name: perspective_br_x_shift
|
| 62 |
+
dtype: float32
|
| 63 |
+
- name: apply_artifacts
|
| 64 |
+
dtype: bool
|
| 65 |
+
- name: perspective_bl_x_shift
|
| 66 |
+
dtype: float32
|
| 67 |
+
- name: perspective_bl_y_shift
|
| 68 |
+
dtype: float32
|
| 69 |
+
- name: contrast_factor
|
| 70 |
+
dtype: float32
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
# OCR-PDF-Degraded Dataset
|
| 74 |
+
|
| 75 |
+
This dataset contains degraded document images with OCR text and degradation parameters.
|
| 76 |
+
|
| 77 |
+
## Features
|
| 78 |
+
|
| 79 |
+
- **page_filename**: Filename of the degraded image
|
| 80 |
+
- **pdf_filename**: Original PDF from which the image was extracted
|
| 81 |
+
- **image**: The degraded document image (viewable in the Hugging Face dataset viewer)
|
| 82 |
+
- **ocr_text**: Extracted OCR text from the document
|
| 83 |
+
- Various degradation parameters related to the document degradation process
|
| 84 |
+
|
| 85 |
+
## Usage
|
| 86 |
+
|
| 87 |
+
```python
|
| 88 |
+
from datasets import load_dataset
|
| 89 |
+
|
| 90 |
+
# Load the dataset
|
| 91 |
+
dataset = load_dataset("racineai/ocr-pdf-degraded")
|
| 92 |
+
|
| 93 |
+
# Display an example image
|
| 94 |
+
import matplotlib.pyplot as plt
|
| 95 |
+
from PIL import Image
|
| 96 |
+
import io
|
| 97 |
+
|
| 98 |
+
# Get an image from the dataset
|
| 99 |
+
image_data = dataset['train'][0]['image']['bytes']
|
| 100 |
+
img = Image.open(io.BytesIO(image_data))
|
| 101 |
+
plt.imshow(img)
|
| 102 |
+
plt.axis('off')
|
| 103 |
+
plt.show()
|
| 104 |
+
|
| 105 |
+
# View the OCR text
|
| 106 |
+
print(dataset['train'][0]['ocr_text'])
|
| 107 |
+
```
|
train-0000.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4655d94c6a1b0c8efde681de6fdeee855ddf38edcdc7311b009537abed76ca71
|
| 3 |
+
size 793508696
|
train-0001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce1c761d6a8f85c8c264d4c2fc109056b77f357ee0249d7ac7d86495a8d896b2
|
| 3 |
+
size 516167430
|
train-0002.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3902341e7e72e71c4a22a3b0850764a4ad11e0dd4b21c2247a094d615029956f
|
| 3 |
+
size 719125702
|
train-0003.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:366b5b5af45b3ed08cc2db4fb55c86e5bffbbfd52dc7f0593dee99a8ae897718
|
| 3 |
+
size 654720176
|