Update test_ldkp.py
Browse files- test_ldkp.py +8 -4
test_ldkp.py
CHANGED
|
@@ -62,8 +62,10 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
|
|
| 62 |
if self.config.name == "ldkp": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
| 63 |
features = datasets.Features(
|
| 64 |
{
|
| 65 |
-
"text": datasets.features.Sequence(
|
| 66 |
-
"BIO_tags": datasets.features.Sequence(
|
|
|
|
|
|
|
| 67 |
#"text": datasets.Value("string"),
|
| 68 |
#"BIO_tags": datasets.Value("string")
|
| 69 |
# "answer": datasets.Value("string")
|
|
@@ -141,8 +143,10 @@ class TestLDKP(datasets.GeneratorBasedBuilder):
|
|
| 141 |
if self.config.name == "ldkp":
|
| 142 |
# Yields examples as (key, example) tuples
|
| 143 |
yield key, {
|
| 144 |
-
"text": {"txt":data["abstract"]+data["other_sec"]},
|
| 145 |
-
"BIO_tags": {'tag':data["abstract_tags"] + data["other_sec_tags"]}
|
|
|
|
|
|
|
| 146 |
# "answer": "" if split == "test" else data["answer"],
|
| 147 |
}
|
| 148 |
else:
|
|
|
|
| 62 |
if self.config.name == "ldkp": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
| 63 |
features = datasets.Features(
|
| 64 |
{
|
| 65 |
+
"text": datasets.features.Sequence([datasets.Value("string")]),
|
| 66 |
+
"BIO_tags": datasets.features.Sequence([datasets.Value("string")])
|
| 67 |
+
#"text": datasets.features.Sequence({'txt':datasets.Value("string")}),
|
| 68 |
+
#"BIO_tags": datasets.features.Sequence({'tag':datasets.Value("string")})
|
| 69 |
#"text": datasets.Value("string"),
|
| 70 |
#"BIO_tags": datasets.Value("string")
|
| 71 |
# "answer": datasets.Value("string")
|
|
|
|
| 143 |
if self.config.name == "ldkp":
|
| 144 |
# Yields examples as (key, example) tuples
|
| 145 |
yield key, {
|
| 146 |
+
#"text": {"txt":data["abstract"]+data["other_sec"]},
|
| 147 |
+
#"BIO_tags": {'tag':data["abstract_tags"] + data["other_sec_tags"]}
|
| 148 |
+
"text": data["abstract"]+data["other_sec"],
|
| 149 |
+
"BIO_tags": data["abstract_tags"] + data["other_sec_tags"]
|
| 150 |
# "answer": "" if split == "test" else data["answer"],
|
| 151 |
}
|
| 152 |
else:
|