Update sg-holiday.py
Browse files- sg-holiday.py +6 -9
sg-holiday.py
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
"""Times of India News Headlines Dataset"""
|
2 |
import csv
|
3 |
-
import os
|
4 |
-
import pandas as pd
|
5 |
import datasets
|
6 |
|
7 |
-
_CITATION = '''\\n@inproceedings{
|
8 |
author = Mulin,
|
9 |
title = Holiday Dataset,
|
10 |
year = {2022},
|
@@ -15,7 +13,7 @@ _CITATION = '''\\n@inproceedings{Casanueva2022,
|
|
15 |
}'''
|
16 |
|
17 |
_DESCRIPTION = """\
|
18 |
-
This news dataset is holiday information of
|
19 |
"""
|
20 |
|
21 |
_DATE = "Date"
|
@@ -33,10 +31,10 @@ class TimesOfHoliday(datasets.GeneratorBasedBuilder):
|
|
33 |
VERSION = datasets.Version("1.1.0")
|
34 |
|
35 |
def _info(self):
|
36 |
-
|
37 |
return datasets.DatasetInfo(
|
38 |
description=_DESCRIPTION,
|
39 |
-
features=
|
40 |
supervised_keys=None,
|
41 |
homepage=_HOMEPAGE,
|
42 |
citation=_CITATION,
|
@@ -50,7 +48,7 @@ class TimesOfHoliday(datasets.GeneratorBasedBuilder):
|
|
50 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path})
|
51 |
]
|
52 |
|
53 |
-
def _generate_examples(self,
|
54 |
with open(filepath, encoding='utf-8') as f:
|
55 |
csv_reader = csv.reader(f, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True)
|
56 |
next(csv_reader)
|
@@ -60,5 +58,4 @@ class TimesOfHoliday(datasets.GeneratorBasedBuilder):
|
|
60 |
_DATE: str(Date),
|
61 |
_DAY: Day,
|
62 |
_HOLIDAY: Holiday,
|
63 |
-
}
|
64 |
-
|
|
|
1 |
"""Times of India News Headlines Dataset"""
|
2 |
import csv
|
|
|
|
|
3 |
import datasets
|
4 |
|
5 |
+
_CITATION = '''\\n@inproceedings{Casanueva2020,
|
6 |
author = Mulin,
|
7 |
title = Holiday Dataset,
|
8 |
year = {2022},
|
|
|
13 |
}'''
|
14 |
|
15 |
_DESCRIPTION = """\
|
16 |
+
This news dataset is a holiday information of singapore from 2017 to 2022.
|
17 |
"""
|
18 |
|
19 |
_DATE = "Date"
|
|
|
31 |
VERSION = datasets.Version("1.1.0")
|
32 |
|
33 |
def _info(self):
|
34 |
+
features = datasets.Features({_DATE: datasets.Value('string'), _DAY: datasets.Value('string'), _HOLIDAY: datasets.Value('string')}),
|
35 |
return datasets.DatasetInfo(
|
36 |
description=_DESCRIPTION,
|
37 |
+
features=features,
|
38 |
supervised_keys=None,
|
39 |
homepage=_HOMEPAGE,
|
40 |
citation=_CITATION,
|
|
|
48 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path})
|
49 |
]
|
50 |
|
51 |
+
def _generate_examples(self, filepath):
|
52 |
with open(filepath, encoding='utf-8') as f:
|
53 |
csv_reader = csv.reader(f, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True)
|
54 |
next(csv_reader)
|
|
|
58 |
_DATE: str(Date),
|
59 |
_DAY: Day,
|
60 |
_HOLIDAY: Holiday,
|
61 |
+
}
|
|