ThienTriAI commited on
Commit ·
7df5961
1
Parent(s): d5b3c40
Rename dataset.py to pricer-data.py and fix class name
Browse files- dataset.py → pricer-data.py +35 -35
dataset.py → pricer-data.py
RENAMED
|
@@ -1,35 +1,35 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import datasets
|
| 3 |
-
|
| 4 |
-
_CITATION = ""
|
| 5 |
-
_DESCRIPTION = "Giá dữ liệu tài chính (Price dataset)"
|
| 6 |
-
_HOMEPAGE = ""
|
| 7 |
-
_LICENSE = "mit"
|
| 8 |
-
|
| 9 |
-
class
|
| 10 |
-
def _info(self):
|
| 11 |
-
return datasets.DatasetInfo(
|
| 12 |
-
description=_DESCRIPTION,
|
| 13 |
-
features=datasets.Features({
|
| 14 |
-
"text": datasets.Value("string"),
|
| 15 |
-
}),
|
| 16 |
-
supervised_keys=None,
|
| 17 |
-
homepage=_HOMEPAGE,
|
| 18 |
-
citation=_CITATION,
|
| 19 |
-
)
|
| 20 |
-
|
| 21 |
-
def _split_generators(self, dl_manager):
|
| 22 |
-
data_files = dl_manager.download_and_extract({
|
| 23 |
-
"train": "train.jsonl",
|
| 24 |
-
"test": "test.jsonl",
|
| 25 |
-
})
|
| 26 |
-
|
| 27 |
-
return [
|
| 28 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_files["train"]}),
|
| 29 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": data_files["test"]}),
|
| 30 |
-
]
|
| 31 |
-
|
| 32 |
-
def _generate_examples(self, filepath):
|
| 33 |
-
with open(filepath, encoding="utf-8") as f:
|
| 34 |
-
for i, line in enumerate(f):
|
| 35 |
-
yield i, json.loads(line)
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import datasets
|
| 3 |
+
|
| 4 |
+
_CITATION = ""
|
| 5 |
+
_DESCRIPTION = "Giá dữ liệu tài chính (Price dataset)"
|
| 6 |
+
_HOMEPAGE = ""
|
| 7 |
+
_LICENSE = "mit"
|
| 8 |
+
|
| 9 |
+
class PricerData(datasets.GeneratorBasedBuilder):
|
| 10 |
+
def _info(self):
|
| 11 |
+
return datasets.DatasetInfo(
|
| 12 |
+
description=_DESCRIPTION,
|
| 13 |
+
features=datasets.Features({
|
| 14 |
+
"text": datasets.Value("string"),
|
| 15 |
+
}),
|
| 16 |
+
supervised_keys=None,
|
| 17 |
+
homepage=_HOMEPAGE,
|
| 18 |
+
citation=_CITATION,
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
def _split_generators(self, dl_manager):
|
| 22 |
+
data_files = dl_manager.download_and_extract({
|
| 23 |
+
"train": "train.jsonl",
|
| 24 |
+
"test": "test.jsonl",
|
| 25 |
+
})
|
| 26 |
+
|
| 27 |
+
return [
|
| 28 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_files["train"]}),
|
| 29 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": data_files["test"]}),
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
def _generate_examples(self, filepath):
|
| 33 |
+
with open(filepath, encoding="utf-8") as f:
|
| 34 |
+
for i, line in enumerate(f):
|
| 35 |
+
yield i, json.loads(line)
|