Mulin commited on
Commit
64b9f55
1 Parent(s): a69a697

Update sg-holiday.py

Browse files
Files changed (1) hide show
  1. sg-holiday.py +9 -4
sg-holiday.py CHANGED
@@ -15,7 +15,7 @@ _CITATION = '''\\n@inproceedings{Casanueva2022,
15
  }'''
16
 
17
  _DESCRIPTION = """\
18
- This news dataset is a holiday information of singapore from 2017 to 2022.
19
  """
20
 
21
  _DATE = "Date"
@@ -25,7 +25,8 @@ _HOLIDAY = "Holiday"
25
  _HOMEPAGE = ""
26
  _LICENSE = "MIT"
27
 
28
- _FILENAME = "https://raw.githubusercontent.com/ZhangLe59151/sg-dataset/main/holiday/holiday.csv"
 
29
 
30
 
31
  class TimesOfHoliday(datasets.GeneratorBasedBuilder):
@@ -42,8 +43,12 @@ class TimesOfHoliday(datasets.GeneratorBasedBuilder):
42
  )
43
 
44
  def _split_generators(self, dl_manager):
45
- data_dir = dl_manager.download_and_extract(_FILENAME)
46
- return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": _FILENAME})]
 
 
 
 
47
 
48
  def _generate_examples(self, path=None):
49
  """Yields examples."""
 
15
  }'''
16
 
17
  _DESCRIPTION = """\
18
+ This news dataset is holiday information of Singapore from 2017 to 2022.
19
  """
20
 
21
  _DATE = "Date"
 
25
  _HOMEPAGE = ""
26
  _LICENSE = "MIT"
27
 
28
+ _TRAIN_DOWNLOAD_URL = 'https://raw.githubusercontent.com/ZhangLe59151/sg-dataset/main/holiday/holiday.csv'
29
+ _TEST_DOWNLOAD_URL = 'https://raw.githubusercontent.com/ZhangLe59151/sg-dataset/main/holiday/holiday.csv'
30
 
31
 
32
  class TimesOfHoliday(datasets.GeneratorBasedBuilder):
 
43
  )
44
 
45
  def _split_generators(self, dl_manager):
46
+ train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
47
+ test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
48
+ return [
49
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
50
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path})
51
+ ]
52
 
53
  def _generate_examples(self, path=None):
54
  """Yields examples."""