Update load_script.py
Browse files- load_script.py +4 -6
load_script.py
CHANGED
|
@@ -5,8 +5,7 @@ import datasets
|
|
| 5 |
from PIL import Image
|
| 6 |
import numpy as np
|
| 7 |
logger = datasets.logging.get_logger(__name__)
|
| 8 |
-
_CITATION = """
|
| 9 |
-
@article{Jaume2019FUNSDAD,
|
| 10 |
title={FUNSD: A Dataset for Form Understanding in Noisy Scanned Documents},
|
| 11 |
author={Guillaume Jaume and H. K. Ekenel and J. Thiran},
|
| 12 |
journal={2019 International Conference on Document Analysis and Recognition Workshops (ICDARW)},
|
|
@@ -15,8 +14,7 @@ _CITATION = """\
|
|
| 15 |
pages={1-6}
|
| 16 |
}
|
| 17 |
"""
|
| 18 |
-
_DESCRIPTION = """
|
| 19 |
-
https://guillaumejaume.github.io/FUNSD/
|
| 20 |
"""
|
| 21 |
def load_image(image_path):
|
| 22 |
image = Image.open(image_path).convert("RGB")
|
|
@@ -71,10 +69,10 @@ class Funsd(datasets.GeneratorBasedBuilder):
|
|
| 71 |
"""Returns SplitGenerators."""
|
| 72 |
return [
|
| 73 |
datasets.SplitGenerator(
|
| 74 |
-
name=datasets.Split.TRAIN, gen_kwargs={"filepath": "
|
| 75 |
),
|
| 76 |
datasets.SplitGenerator(
|
| 77 |
-
name=datasets.Split.TEST, gen_kwargs={"filepath": "
|
| 78 |
),
|
| 79 |
]
|
| 80 |
def _generate_examples(self, filepath):
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
import numpy as np
|
| 7 |
logger = datasets.logging.get_logger(__name__)
|
| 8 |
+
_CITATION = """\\n@article{Jaume2019FUNSDAD,
|
|
|
|
| 9 |
title={FUNSD: A Dataset for Form Understanding in Noisy Scanned Documents},
|
| 10 |
author={Guillaume Jaume and H. K. Ekenel and J. Thiran},
|
| 11 |
journal={2019 International Conference on Document Analysis and Recognition Workshops (ICDARW)},
|
|
|
|
| 14 |
pages={1-6}
|
| 15 |
}
|
| 16 |
"""
|
| 17 |
+
_DESCRIPTION = """\\nhttps://guillaumejaume.github.io/FUNSD/
|
|
|
|
| 18 |
"""
|
| 19 |
def load_image(image_path):
|
| 20 |
image = Image.open(image_path).convert("RGB")
|
|
|
|
| 69 |
"""Returns SplitGenerators."""
|
| 70 |
return [
|
| 71 |
datasets.SplitGenerator(
|
| 72 |
+
name=datasets.Split.TRAIN, gen_kwargs={"filepath": "training_data/"}
|
| 73 |
),
|
| 74 |
datasets.SplitGenerator(
|
| 75 |
+
name=datasets.Split.TEST, gen_kwargs={"filepath": "testing_data/"}
|
| 76 |
),
|
| 77 |
]
|
| 78 |
def _generate_examples(self, filepath):
|