Update testing.py
Browse files- testing.py +26 -4
testing.py
CHANGED
@@ -55,6 +55,9 @@ _URLS = {
|
|
55 |
"validation": "https://raw.githubusercontent.com/csitfun/LogiQA2.0/main/logiqa2nli/DATA/QA2NLI/dev.txt",
|
56 |
"test": "https://raw.githubusercontent.com/csitfun/LogiQA2.0/main/logiqa2nli/DATA/QA2NLI/test.txt",
|
57 |
},
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
|
@@ -90,6 +93,11 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
|
|
90 |
version=VERSION,
|
91 |
description="The NLI part of LogiQA2.0 dataset",
|
92 |
),
|
|
|
|
|
|
|
|
|
|
|
93 |
]
|
94 |
DEFAULT_CONFIG_NAME = "logiqa2"
|
95 |
|
@@ -109,12 +117,22 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
|
|
109 |
elif self.config.name == "logiqa2_nli":
|
110 |
features = datasets.Features(
|
111 |
{
|
112 |
-
"label": datasets.ClassLabel(
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
"conclusion": datasets.Value("string"),
|
116 |
}
|
117 |
)
|
|
|
|
|
|
|
118 |
else:
|
119 |
features = datasets.Features(
|
120 |
{
|
@@ -189,7 +207,11 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
|
|
189 |
"minor_premise": data["minor_premise"],
|
190 |
"conclusion": data["conclusion"],
|
191 |
}
|
192 |
-
|
|
|
|
|
|
|
|
|
193 |
else:
|
194 |
yield key, {
|
195 |
"id": data["id"],
|
|
|
55 |
"validation": "https://raw.githubusercontent.com/csitfun/LogiQA2.0/main/logiqa2nli/DATA/QA2NLI/dev.txt",
|
56 |
"test": "https://raw.githubusercontent.com/csitfun/LogiQA2.0/main/logiqa2nli/DATA/QA2NLI/test.txt",
|
57 |
},
|
58 |
+
"logieval": {
|
59 |
+
"test": "https://raw.githubusercontent.com/csitfun/LogiEval/main/Data/logiqa.jsonl"
|
60 |
+
}
|
61 |
}
|
62 |
|
63 |
|
|
|
93 |
version=VERSION,
|
94 |
description="The NLI part of LogiQA2.0 dataset",
|
95 |
),
|
96 |
+
datasets.BuilderConfig(
|
97 |
+
name="logieval",
|
98 |
+
version=VERSION,
|
99 |
+
description="Instruction based MRC task",
|
100 |
+
)
|
101 |
]
|
102 |
DEFAULT_CONFIG_NAME = "logiqa2"
|
103 |
|
|
|
117 |
elif self.config.name == "logiqa2_nli":
|
118 |
features = datasets.Features(
|
119 |
{
|
120 |
+
"label": datasets.ClassLabel(
|
121 |
+
num_classes=2,
|
122 |
+
names=["not entailed", "entailed"],
|
123 |
+
names_file=None,
|
124 |
+
id=None,
|
125 |
+
),
|
126 |
+
"major_premise": datasets.features.Sequence(
|
127 |
+
datasets.Value("string")
|
128 |
+
),
|
129 |
+
"minor_premise": datasets.Value("string"),
|
130 |
"conclusion": datasets.Value("string"),
|
131 |
}
|
132 |
)
|
133 |
+
elif self.config.name == "logiqa2_nli":
|
134 |
+
features = datasets.Features({"content": datasets.Value("string"),
|
135 |
+
"ideal": datasets.Value("string")})
|
136 |
else:
|
137 |
features = datasets.Features(
|
138 |
{
|
|
|
207 |
"minor_premise": data["minor_premise"],
|
208 |
"conclusion": data["conclusion"],
|
209 |
}
|
210 |
+
elif self.config.name == "logieval":
|
211 |
+
yield key, {
|
212 |
+
'content': data['content'],
|
213 |
+
'ideal': data['ideal']
|
214 |
+
}
|
215 |
else:
|
216 |
yield key, {
|
217 |
"id": data["id"],
|