AlexKoff88
commited on
Commit
•
d881699
1
Parent(s):
41ea0e3
Replaced google drive with HF Hub as a source for files
Browse files- feedbackQA.py +10 -12
feedbackQA.py
CHANGED
@@ -35,13 +35,13 @@ It has two parts: the first part contains a conventional RQA dataset, \
|
|
35 |
whilst this repo contains the second part, which contains feedback(ratings and natural language explanations) for QA pairs.
|
36 |
"""
|
37 |
|
38 |
-
#
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
43 |
|
44 |
-
_URL = 'https://drive.google.com/uc?export=download&id=14KV6yKgdjzb6fbFzshGuNvEp9zGv_gol'
|
45 |
|
46 |
class FeedbackConfig(datasets.BuilderConfig):
|
47 |
"""BuilderConfig for FeedbackQA."""
|
@@ -91,11 +91,9 @@ class FeedbackQA(datasets.GeneratorBasedBuilder):
|
|
91 |
)
|
92 |
|
93 |
def _split_generators(self, dl_manager):
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
test_file = os.path.join(downloaded_files_path, 'feedback_test.json')
|
98 |
-
print(test_file)
|
99 |
return [
|
100 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_file}),
|
101 |
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": val_file}),
|
@@ -126,4 +124,4 @@ class FeedbackQA(datasets.GeneratorBasedBuilder):
|
|
126 |
"explanation": dict_item['feedback'],
|
127 |
},
|
128 |
}
|
129 |
-
key += 1
|
|
|
35 |
whilst this repo contains the second part, which contains feedback(ratings and natural language explanations) for QA pairs.
|
36 |
"""
|
37 |
|
38 |
+
#_URL = 'https://drive.google.com/uc?export=download&id=14KV6yKgdjzb6fbFzshGuNvEp9zGv_gol'
|
39 |
+
_URLS = {
|
40 |
+
"train": "https://huggingface.co/datasets/McGill-NLP/feedbackQA/resolve/main/data/feedback_train.json",
|
41 |
+
"val": "https://huggingface.co/datasets/McGill-NLP/feedbackQA/resolve/main/data/feedback_valid.json",
|
42 |
+
"test": "https://huggingface.co/datasets/McGill-NLP/feedbackQA/resolve/main/data/feedback_test.json"
|
43 |
+
}
|
44 |
|
|
|
45 |
|
46 |
class FeedbackConfig(datasets.BuilderConfig):
|
47 |
"""BuilderConfig for FeedbackQA."""
|
|
|
91 |
)
|
92 |
|
93 |
def _split_generators(self, dl_manager):
|
94 |
+
train_file = dl_manager.download(_URLS["train"])
|
95 |
+
val_file = dl_manager.download(_URLS["val"])
|
96 |
+
test_file = dl_manager.download(_URLS["test"])
|
|
|
|
|
97 |
return [
|
98 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_file}),
|
99 |
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": val_file}),
|
|
|
124 |
"explanation": dict_item['feedback'],
|
125 |
},
|
126 |
}
|
127 |
+
key += 1
|