Delete clefip2011.py
Browse files- clefip2011.py +0 -32
clefip2011.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import datasets
|
| 3 |
-
|
| 4 |
-
class TestDataset(datasets.GeneratorBasedBuilder):
|
| 5 |
-
"""A simple test dataset loader."""
|
| 6 |
-
|
| 7 |
-
def _info(self):
|
| 8 |
-
return datasets.DatasetInfo(
|
| 9 |
-
features=datasets.Features(
|
| 10 |
-
{
|
| 11 |
-
"id": datasets.Value("int32"),
|
| 12 |
-
"text": datasets.Value("string"),
|
| 13 |
-
"label": datasets.Value("string"),
|
| 14 |
-
}
|
| 15 |
-
),
|
| 16 |
-
description="A simple test dataset with id, text, and label",
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
def _split_generators(self, dl_manager):
|
| 20 |
-
# Provide the CSV file URL or path in the repository
|
| 21 |
-
csv_path = dl_manager.download_and_extract("sample_data.csv")
|
| 22 |
-
return [
|
| 23 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": csv_path}),
|
| 24 |
-
]
|
| 25 |
-
|
| 26 |
-
def _generate_examples(self, filepath):
|
| 27 |
-
# Read data from CSV file
|
| 28 |
-
import pandas as pd
|
| 29 |
-
df = pd.read_csv(filepath)
|
| 30 |
-
|
| 31 |
-
for idx, row in df.iterrows():
|
| 32 |
-
yield idx, {"id": row["id"], "text": row["text"], "label": row["label"]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|