Witold Wydmański
commited on
Commit
•
d86b2fe
1
Parent(s):
cd847b5
feat: update
Browse files- load_script.py +32 -0
load_script.py
CHANGED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
from datasets.tasks import TaskTemplate
|
3 |
+
from sklearn.model_selection import train_test_split
|
4 |
+
|
5 |
+
_ORIGIN = "https://ieeexplore.ieee.org/document/291440"
|
6 |
+
_CITATION = """\
|
7 |
+
J. J. Hull, "A database for handwritten text recognition research," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 16, no. 5, pp. 550-554, May 1994, doi: 10.1109/34.291440.
|
8 |
+
"""
|
9 |
+
_DESCRIPTION = """\
|
10 |
+
An image database for handwritten text recognition research is described. Digital images of approximately 5000 city names, 5000 state names, 10000 ZIP Codes, and 50000 alphanumeric characters are included. Each image was scanned from mail in a working post office at 300 pixels/in in 8-bit gray scale on a high-quality flat bed digitizer. The data were unconstrained for the writer, style, and method of preparation. These characteristics help overcome the limitations of earlier databases that contained only isolated characters or were prepared in a laboratory setting under prescribed circumstances. Also, the database is divided into explicit training and testing sets to facilitate the sharing of results among researchers as well as performance comparisons."""
|
11 |
+
|
12 |
+
class WisconsinBreastCancer(datasets.GeneratorBasedBuilder):
|
13 |
+
def _info(self) -> datasets.DatasetInfo:
|
14 |
+
return datasets.DatasetInfo(
|
15 |
+
description=_DESCRIPTION,
|
16 |
+
citation=_CITATION,
|
17 |
+
homepage=_ORIGIN,
|
18 |
+
license="",
|
19 |
+
)
|
20 |
+
|
21 |
+
|
22 |
+
def _split_generators(self, dl_manager):
|
23 |
+
return [
|
24 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": "train.csv"}),
|
25 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": "test.csv"}),
|
26 |
+
]
|
27 |
+
|
28 |
+
def _generate_examples(self, filepath):
|
29 |
+
with open(filepath, "r") as f:
|
30 |
+
next(f)
|
31 |
+
for key, row in enumerate(f):
|
32 |
+
yield key, {"data": row[:-1], "label": row[-1]}
|