ccdv commited on
Commit
aa39e4e
1 Parent(s): 7b08769
Files changed (1) hide show
  1. QR-AN.py +25 -11
QR-AN.py CHANGED
@@ -105,23 +105,37 @@ class QRANDataset(datasets.GeneratorBasedBuilder):
105
 
106
  def _info(self):
107
 
108
- return datasets.DatasetInfo(
109
- description=_DESCRIPTION,
110
- features=datasets.Features(
111
- {
112
- "question": datasets.Value("string"),
113
- "answer": datasets.Value("string"),
114
- }
115
- ),
116
- supervised_keys=None,
117
- citation=_CITATION,
118
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
 
121
  def _split_generators(self, dl_manager):
122
  train_path = dl_manager.download_and_extract(self._TRAIN_FILE)
123
  val_path = dl_manager.download_and_extract(self._VAL_FILE)
124
  test_path = dl_manager.download_and_extract(self._TEST_FILE)
 
125
 
126
  return [
127
  datasets.SplitGenerator(
 
105
 
106
  def _info(self):
107
 
108
+ if self.config.name == "qran_generation":
109
+ return datasets.DatasetInfo(
110
+ description=_DESCRIPTION,
111
+ features=datasets.Features(
112
+ {
113
+ "question": datasets.Value("string"),
114
+ "answer": datasets.Value("string"),
115
+ }
116
+ ),
117
+ supervised_keys=None,
118
+ citation=_CITATION,
119
+ )
120
+ else:
121
+ return datasets.DatasetInfo(
122
+ description=_DESCRIPTION,
123
+ features=datasets.Features(
124
+ {
125
+ "text": datasets.Value("string"),
126
+ "label": datasets.features.ClassLabel(names=_LABELS),
127
+ }
128
+ ),
129
+ supervised_keys=None,
130
+ citation=_CITATION,
131
+ )
132
 
133
 
134
  def _split_generators(self, dl_manager):
135
  train_path = dl_manager.download_and_extract(self._TRAIN_FILE)
136
  val_path = dl_manager.download_and_extract(self._VAL_FILE)
137
  test_path = dl_manager.download_and_extract(self._TEST_FILE)
138
+ print(train_path, val_path, test_path)
139
 
140
  return [
141
  datasets.SplitGenerator(