Commit ·
38b0b4c
1
Parent(s): 4e9eb38
Delete mannbot.py
Browse files- mannbot.py +0 -51
mannbot.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import datasets
|
| 3 |
-
|
| 4 |
-
_DESCRIPTION = """Your dataset description here."""
|
| 5 |
-
_LICENSE = "Your dataset license here"
|
| 6 |
-
_HOMEPAGE = "Your dataset homepage here"
|
| 7 |
-
|
| 8 |
-
class CustomDataset(datasets.GeneratorBasedBuilder):
|
| 9 |
-
VERSION = datasets.Version("1.0.0")
|
| 10 |
-
|
| 11 |
-
BUILDER_CONFIGS = [
|
| 12 |
-
datasets.BuilderConfig(
|
| 13 |
-
name="custom_dataset",
|
| 14 |
-
version=datasets.Version("1.0.0"),
|
| 15 |
-
description="Custom dataset with Date, text, and ctext columns.",
|
| 16 |
-
),
|
| 17 |
-
]
|
| 18 |
-
|
| 19 |
-
def _info(self):
|
| 20 |
-
features = datasets.Features(
|
| 21 |
-
{
|
| 22 |
-
"Date": datasets.Value("string"),
|
| 23 |
-
"text": datasets.Value("string"),
|
| 24 |
-
"ctext": datasets.Value("string"),
|
| 25 |
-
}
|
| 26 |
-
)
|
| 27 |
-
return datasets.DatasetInfo(
|
| 28 |
-
description=_DESCRIPTION,
|
| 29 |
-
features=features,
|
| 30 |
-
supervised_keys=None,
|
| 31 |
-
homepage=_HOMEPAGE,
|
| 32 |
-
license=_LICENSE,
|
| 33 |
-
)
|
| 34 |
-
|
| 35 |
-
def _split_generators(self, dl_manager):
|
| 36 |
-
train_file = "https://huggingface.co/datasets/riddhiparakh/mannbot/blob/main/train.jsonl"
|
| 37 |
-
test_file = "https://huggingface.co/datasets/riddhiparakh/mannbot/blob/main/val.jsonl"
|
| 38 |
-
return [
|
| 39 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"file_path": train_file}),
|
| 40 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"file_path": test_file}),
|
| 41 |
-
]
|
| 42 |
-
|
| 43 |
-
def _generate_examples(self, file_path):
|
| 44 |
-
with open(file_path, "r") as f:
|
| 45 |
-
data = json.load(f)
|
| 46 |
-
for i, item in enumerate(data):
|
| 47 |
-
yield i, {
|
| 48 |
-
"Date": item["Date"],
|
| 49 |
-
"text": item["text"],
|
| 50 |
-
"ctext": item["ctext"],
|
| 51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|