Commit
•
7c0cdc2
1
Parent(s):
17206ff
Update direitodigital.py
Browse files- direitodigital.py +11 -17
direitodigital.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
# coding=utf-8
|
2 |
'''
|
3 |
-
Reference: https://huggingface.co/datasets/nielsr/funsd/blob/main/funsd.py
|
4 |
'''
|
5 |
import ast
|
6 |
import os
|
@@ -31,38 +31,32 @@ logger = datasets.logging.get_logger(__name__)
|
|
31 |
|
32 |
|
33 |
_CITATION = """\
|
34 |
-
|
35 |
-
title={FUNSD: A Dataset for Form Understanding in Noisy Scanned Documents},
|
36 |
-
author={Guillaume Jaume and H. K. Ekenel and J. Thiran},
|
37 |
-
journal={2019 International Conference on Document Analysis and Recognition Workshops (ICDARW)},
|
38 |
-
year={2019},
|
39 |
-
volume={2},
|
40 |
-
pages={1-6}
|
41 |
}
|
42 |
"""
|
43 |
|
44 |
_DESCRIPTION = """\
|
45 |
-
|
46 |
"""
|
47 |
|
48 |
|
49 |
-
class
|
50 |
-
"""BuilderConfig for
|
51 |
|
52 |
def __init__(self, **kwargs):
|
53 |
-
"""BuilderConfig for
|
54 |
Args:
|
55 |
**kwargs: keyword arguments forwarded to super.
|
56 |
"""
|
57 |
-
super(
|
58 |
|
59 |
|
60 |
|
61 |
-
class
|
62 |
"""Conll2003 dataset."""
|
63 |
|
64 |
BUILDER_CONFIGS = [
|
65 |
-
|
66 |
]
|
67 |
|
68 |
|
@@ -83,7 +77,7 @@ class Funsd(datasets.GeneratorBasedBuilder):
|
|
83 |
}
|
84 |
),
|
85 |
supervised_keys=None,
|
86 |
-
#homepage="https://
|
87 |
citation=_CITATION,
|
88 |
)
|
89 |
|
@@ -220,7 +214,7 @@ class Funsd(datasets.GeneratorBasedBuilder):
|
|
220 |
"image": image}
|
221 |
|
222 |
def main():
|
223 |
-
dataset =
|
224 |
for example in dataset._generate_examples('/home/marlon/LayoutLM_dataset/trainmini'):
|
225 |
print(example)
|
226 |
|
|
|
1 |
# coding=utf-8
|
2 |
'''
|
3 |
+
Reference: https://huggingface.co/datasets/nielsr/funsd-layoutlmv3/blob/main/funsd-layoutlmv3.py
|
4 |
'''
|
5 |
import ast
|
6 |
import os
|
|
|
31 |
|
32 |
|
33 |
_CITATION = """\
|
34 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
"""
|
37 |
|
38 |
_DESCRIPTION = """\
|
39 |
+
|
40 |
"""
|
41 |
|
42 |
|
43 |
+
class DireitoDigitalConfig(datasets.BuilderConfig):
|
44 |
+
"""BuilderConfig for DIREITO DIGITAL"""
|
45 |
|
46 |
def __init__(self, **kwargs):
|
47 |
+
"""BuilderConfig for DIREITODIGITAL.
|
48 |
Args:
|
49 |
**kwargs: keyword arguments forwarded to super.
|
50 |
"""
|
51 |
+
super(DireitoDigitalConfig, self).__init__(**kwargs)
|
52 |
|
53 |
|
54 |
|
55 |
+
class DireitoDigital(datasets.GeneratorBasedBuilder):
|
56 |
"""Conll2003 dataset."""
|
57 |
|
58 |
BUILDER_CONFIGS = [
|
59 |
+
DireitoDigitalConfig(name="direitodigital", version=datasets.Version("1.0.0"), description="DIREITO DIGITAL dataset"),
|
60 |
]
|
61 |
|
62 |
|
|
|
77 |
}
|
78 |
),
|
79 |
supervised_keys=None,
|
80 |
+
#homepage="https://direitodigital.ufms.br/direitodigital/",
|
81 |
citation=_CITATION,
|
82 |
)
|
83 |
|
|
|
214 |
"image": image}
|
215 |
|
216 |
def main():
|
217 |
+
dataset = DireitoDigital()
|
218 |
for example in dataset._generate_examples('/home/marlon/LayoutLM_dataset/trainmini'):
|
219 |
print(example)
|
220 |
|