Datasets:
Delete dataset.py
Browse files- dataset.py +0 -37
dataset.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
from datasets import DatasetInfo, Features, Value, Image, load_dataset_builder
|
| 2 |
-
|
| 3 |
-
logger = None
|
| 4 |
-
|
| 5 |
-
_CITATION = ""
|
| 6 |
-
_DESCRIPTION = "FruitBench with CSV-based metadata."
|
| 7 |
-
|
| 8 |
-
_HOMEPAGE = "https://huggingface.co/datasets/TJIET/FruitBench"
|
| 9 |
-
|
| 10 |
-
_URL = "."
|
| 11 |
-
|
| 12 |
-
class FruitBench:
|
| 13 |
-
def _info(self):
|
| 14 |
-
return DatasetInfo(
|
| 15 |
-
description=_DESCRIPTION,
|
| 16 |
-
features=Features({
|
| 17 |
-
"fruit_type": Value("string"),
|
| 18 |
-
"image_name": Value("string"),
|
| 19 |
-
"image": Image(),
|
| 20 |
-
"growth_stage": Value("string"),
|
| 21 |
-
"recommendation": Value("string"),
|
| 22 |
-
"consumer_score": Value("int32")
|
| 23 |
-
}),
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
def _split_generators(self, dl_manager):
|
| 27 |
-
data_file = "fruit_dataset.csv"
|
| 28 |
-
return [
|
| 29 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_file}),
|
| 30 |
-
]
|
| 31 |
-
|
| 32 |
-
def _generate_examples(self, filepath):
|
| 33 |
-
import csv
|
| 34 |
-
with open(filepath, encoding="utf-8") as f:
|
| 35 |
-
reader = csv.DictReader(f)
|
| 36 |
-
for i, row in enumerate(reader):
|
| 37 |
-
yield i, row
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|