julianrisch
commited on
Commit
•
157a5d5
1
Parent(s):
96d8561
Update germandpr.py
Browse files- germandpr.py +5 -10
germandpr.py
CHANGED
@@ -11,7 +11,7 @@ import datasets
|
|
11 |
logger = datasets.logging.get_logger(__name__)
|
12 |
|
13 |
|
14 |
-
_CITATION = """
|
15 |
@misc{möller2021germanquad,
|
16 |
title={GermanQuAD and GermanDPR: Improving Non-English Question Answering and Passage Retrieval},
|
17 |
author={Timo Möller and Julian Risch and Malte Pietsch},
|
@@ -22,15 +22,11 @@ _CITATION = """\\
|
|
22 |
}
|
23 |
"""
|
24 |
|
25 |
-
_DESCRIPTION = """
|
26 |
We take GermanQuAD as a starting point and add hard negatives from a dump of the full German Wikipedia following the approach of the DPR authors (Karpukhin et al., 2020). The format of the dataset also resembles the one of DPR. GermanDPR comprises 9275 question/answer pairs in the training set and 1025 pairs in the test set. For each pair, there are one positive context and three hard negative contexts.
|
27 |
"""
|
28 |
|
29 |
_URL = "https://germanquad.s3.amazonaws.com/GermanDPR.zip"
|
30 |
-
_FILES = {
|
31 |
-
"train": "GermanDPR_train.json",
|
32 |
-
"test": "GermanDPR_test.json",
|
33 |
-
}
|
34 |
|
35 |
|
36 |
class GermanDPRConfig(datasets.BuilderConfig):
|
@@ -94,18 +90,17 @@ class GermanDPR(datasets.GeneratorBasedBuilder):
|
|
94 |
)
|
95 |
|
96 |
def _split_generators(self, dl_manager):
|
97 |
-
|
98 |
-
dl_dir = dl_manager.download_and_extract(download_urls)
|
99 |
return [
|
100 |
datasets.SplitGenerator(
|
101 |
name=datasets.Split.TRAIN,
|
102 |
# These kwargs will be passed to _generate_examples
|
103 |
-
gen_kwargs={"filepath": "GermanDPR_train.json"},
|
104 |
),
|
105 |
datasets.SplitGenerator(
|
106 |
name=datasets.Split.TEST,
|
107 |
# These kwargs will be passed to _generate_examples
|
108 |
-
gen_kwargs={"filepath": "GermanDPR_test.json"},
|
109 |
),
|
110 |
]
|
111 |
|
|
|
11 |
logger = datasets.logging.get_logger(__name__)
|
12 |
|
13 |
|
14 |
+
_CITATION = """\\\\
|
15 |
@misc{möller2021germanquad,
|
16 |
title={GermanQuAD and GermanDPR: Improving Non-English Question Answering and Passage Retrieval},
|
17 |
author={Timo Möller and Julian Risch and Malte Pietsch},
|
|
|
22 |
}
|
23 |
"""
|
24 |
|
25 |
+
_DESCRIPTION = """\\\\
|
26 |
We take GermanQuAD as a starting point and add hard negatives from a dump of the full German Wikipedia following the approach of the DPR authors (Karpukhin et al., 2020). The format of the dataset also resembles the one of DPR. GermanDPR comprises 9275 question/answer pairs in the training set and 1025 pairs in the test set. For each pair, there are one positive context and three hard negative contexts.
|
27 |
"""
|
28 |
|
29 |
_URL = "https://germanquad.s3.amazonaws.com/GermanDPR.zip"
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
class GermanDPRConfig(datasets.BuilderConfig):
|
|
|
90 |
)
|
91 |
|
92 |
def _split_generators(self, dl_manager):
|
93 |
+
dl_dir = dl_manager.download_and_extract(_URL)
|
|
|
94 |
return [
|
95 |
datasets.SplitGenerator(
|
96 |
name=datasets.Split.TRAIN,
|
97 |
# These kwargs will be passed to _generate_examples
|
98 |
+
gen_kwargs={"filepath": dl_dir+"/GermanDPR/GermanDPR_train.json"},
|
99 |
),
|
100 |
datasets.SplitGenerator(
|
101 |
name=datasets.Split.TEST,
|
102 |
# These kwargs will be passed to _generate_examples
|
103 |
+
gen_kwargs={"filepath": dl_dir+"/GermanDPR/GermanDPR_test.json"},
|
104 |
),
|
105 |
]
|
106 |
|