lara-martin commited on
Commit
e3472b5
1 Parent(s): 301651f

Update Scifi_TV_Shows.py

Browse files
Files changed (1) hide show
  1. Scifi_TV_Shows.py +14 -65
Scifi_TV_Shows.py CHANGED
@@ -33,8 +33,13 @@ url={https://ojs.aaai.org//index.php/AAAI/article/view/6232}
33
 
34
  _DESCRIPTION = 'Loading script for the science fiction TV show plot dataset.'
35
 
36
- _URLS = {"scifiTVshows":
37
- 'https://huggingface.co/datasets/lara-martin/Scifi_TV_Shows/tree/main/scifiTVshows.zip'}
 
 
 
 
 
38
 
39
  _INPUT_OUTPUT = ["all-sci-fi-data-test_input.txt", "all-sci-fi-data-test_output.txt", "all-sci-fi-data-train_input.txt", "all-sci-fi-data-train_output.txt", "all-sci-fi-data-val_input.txt", "all-sci-fi-data-val_output.txt"]
40
 
@@ -43,9 +48,9 @@ class ScifiTV(datasets.GeneratorBasedBuilder):
43
  BUILDER_CONFIGS = [
44
  datasets.BuilderConfig(
45
  version=datasets.Version('1.1.0'),
46
- name=lang,
47
  description=f'Science fiction TV show plot summaries.'
48
- ) for lang in languages
49
  ]
50
 
51
  def _info(self):
@@ -73,72 +78,16 @@ class ScifiTV(datasets.GeneratorBasedBuilder):
73
  )
74
 
75
  def _split_generators(self, dl_manager):
76
- lang = self.config.name
77
- downloaded_files = dl_manager.download_and_extract(_URLS)
78
 
79
  splits = [
80
  datasets.SplitGenerator(
81
- name=datasets.Split.TEST,
82
- gen_kwargs={
83
- 'filepath': 'Test-Train-Val/all-sci-fi-data-test.txt',
84
- },
85
- ),
86
- datasets.SplitGenerator(
87
- name=datasets.Split.VALIDATION,
88
- gen_kwargs={
89
- 'filepath': 'Test-Train-Val/all-sci-fi-data-val.txt',
90
- },
91
- ),
92
- datasets.SplitGenerator(
93
- name=datasets.Split.TRAIN,
94
- gen_kwargs={
95
- 'filepath': 'Test-Train-Val/all-sci-fi-data-train.txt',
96
- },
97
- ),
98
- datasets.SplitGenerator(
99
- name="all",
100
- gen_kwargs={
101
- 'filepath': 'all-sci-fi-data.txt',
102
- },
103
- ),
104
- """
105
- datasets.SplitGenerator(
106
- name="test-input",
107
- gen_kwargs={
108
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-test_input.txt',
109
- },
110
- ),
111
- datasets.SplitGenerator(
112
- name="test-output",
113
- gen_kwargs={
114
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-test_output.txt',
115
- },
116
- ),
117
- datasets.SplitGenerator(
118
- name="val-input",
119
- gen_kwargs={
120
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-val_input.txt',
121
- },
122
- ),
123
- datasets.SplitGenerator(
124
- name="val-input",
125
- gen_kwargs={
126
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-val_output.txt',
127
- },
128
- ),
129
- datasets.SplitGenerator(
130
- name="train-input",
131
- gen_kwargs={
132
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-train_input.txt',
133
- },
134
- ),
135
- datasets.SplitGenerator(
136
- name="train-input",
137
  gen_kwargs={
138
- 'filepath': 'Input_OutputFiles/all-sci-fi-data-train_output.txt',
139
  },
140
- ),
141
- """
142
  ]
143
  return splits
144
 
 
33
 
34
  _DESCRIPTION = 'Loading script for the science fiction TV show plot dataset.'
35
 
36
+ URL = 'https://huggingface.co/datasets/lara-martin/Scifi_TV_Shows/blob/main/'
37
+ _URLS = {
38
+ 'test':'Test-Train-Val/all-sci-fi-data-test.txt',
39
+ 'train':'Test-Train-Val/all-sci-fi-data-train.txt',
40
+ 'val':'Test-Train-Val/all-sci-fi-data-val.txt',
41
+ 'all':'all-sci-fi-data.txt',
42
+ }
43
 
44
  _INPUT_OUTPUT = ["all-sci-fi-data-test_input.txt", "all-sci-fi-data-test_output.txt", "all-sci-fi-data-train_input.txt", "all-sci-fi-data-train_output.txt", "all-sci-fi-data-val_input.txt", "all-sci-fi-data-val_output.txt"]
45
 
 
48
  BUILDER_CONFIGS = [
49
  datasets.BuilderConfig(
50
  version=datasets.Version('1.1.0'),
51
+ name=k,
52
  description=f'Science fiction TV show plot summaries.'
53
+ ) for k in _URLS.keys()
54
  ]
55
 
56
  def _info(self):
 
78
  )
79
 
80
  def _split_generators(self, dl_manager):
81
+ data = self.config.name
82
+ downloaded_files = dl_manager.download(_URLS)
83
 
84
  splits = [
85
  datasets.SplitGenerator(
86
+ name=data,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  gen_kwargs={
88
+ 'filepath': downloaded_files[data],
89
  },
90
+ ),
 
91
  ]
92
  return splits
93