Datasets:

Languages:
English
ArXiv:
License:
julianschnitzler commited on
Commit
5c3480a
·
1 Parent(s): ee25399

fix script

Browse files
Files changed (1) hide show
  1. morehopqa.py +32 -0
morehopqa.py CHANGED
@@ -3,7 +3,38 @@ from datasets import load_dataset
3
  import json
4
  import os
5
 
 
 
 
 
 
 
 
 
 
 
 
6
  class MoreHopQA(datasets.GeneratorBasedBuilder):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  def _info(self):
8
  return datasets.DatasetInfo(
9
  features=datasets.Features({
@@ -34,6 +65,7 @@ class MoreHopQA(datasets.GeneratorBasedBuilder):
34
  return [
35
  datasets.SplitGenerator(
36
  name=datasets.Split.TEST,
 
37
  )
38
  ]
39
 
 
3
  import json
4
  import os
5
 
6
+ class MoreHopQAConfig(datasets.BuilderConfig):
7
+ """BuilderConfig for MoreHopQA."""
8
+ def __init__(self, data_path, **kwargs):
9
+ """BuilderConfig for MoreHopQA.
10
+ Args:
11
+ data_path: string, path to the data files containing the dataset.
12
+ **kwargs: keyword arguments forwarded to super.
13
+ """
14
+ super(MoreHopQAConfig, self).__init__(**kwargs)
15
+ self.data_path = data_path
16
+
17
  class MoreHopQA(datasets.GeneratorBasedBuilder):
18
+ """MoreHopQA: A dataset for multi-hop question answering."""
19
+ BUILDER_CONFIG_CLASS = MoreHopQAConfig
20
+
21
+ BUILDER_CONFIGS = [
22
+ MoreHopQAConfig(
23
+ name="verified",
24
+ version=datasets.Version("1.0.0", ""),
25
+ description="MoreHopQA: A dataset for multi-hop question answering.",
26
+ data_path="data/with_human_verification.json",
27
+ ),
28
+ MoreHopQAConfig(
29
+ name="unverified",
30
+ version=datasets.Version("1.0.0", ""),
31
+ description="MoreHopQA: A dataset for multi-hop question answering.",
32
+ data_path="data/without_human_verification.json",
33
+ ),
34
+ ]
35
+
36
+ DEFAULT_CONFIG_NAME = "verified"
37
+
38
  def _info(self):
39
  return datasets.DatasetInfo(
40
  features=datasets.Features({
 
65
  return [
66
  datasets.SplitGenerator(
67
  name=datasets.Split.TEST,
68
+ gen_kwargs={"filepath": os.path.join(self.config.data_path)}
69
  )
70
  ]
71