Update config
Browse files
README.md
CHANGED
|
@@ -39,7 +39,7 @@ This dataset repo contains only the queries and relevance judgements. The corpus
|
|
| 39 |
```
|
| 40 |
ciral_dataset = load_dataset("ciral/ciral", "hausa") #or swahili, somali, yoruba
|
| 41 |
|
| 42 |
-
for data in
|
| 43 |
query_id = data['query_id']
|
| 44 |
query = data['query']
|
| 45 |
pos_qrels = data['positive_passages']
|
|
|
|
| 39 |
```
|
| 40 |
ciral_dataset = load_dataset("ciral/ciral", "hausa") #or swahili, somali, yoruba
|
| 41 |
|
| 42 |
+
for data in ciral_dataset['dev']: # or 'testA' or 'testB'
|
| 43 |
query_id = data['query_id']
|
| 44 |
query = data['query']
|
| 45 |
pos_qrels = data['positive_passages']
|
ciral.py
CHANGED
|
@@ -108,6 +108,15 @@ class CIRAL(datasets.GeneratorBasedBuilder):
|
|
| 108 |
'text': datasets.Value("string"),
|
| 109 |
}],
|
| 110 |
"negative_passages": [{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
"docid": datasets.Value("string"),
|
| 112 |
"text": datasets.Value("string")}]
|
| 113 |
}
|
|
@@ -144,7 +153,7 @@ class CIRAL(datasets.GeneratorBasedBuilder):
|
|
| 144 |
datasets.SplitGenerator(
|
| 145 |
name='testB',
|
| 146 |
gen_kwargs={
|
| 147 |
-
'filepaths': downloaded_files['
|
| 148 |
},
|
| 149 |
),
|
| 150 |
]
|
|
@@ -152,7 +161,7 @@ class CIRAL(datasets.GeneratorBasedBuilder):
|
|
| 152 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 153 |
def _generate_examples(self, filepaths):
|
| 154 |
lang = self.config.name
|
| 155 |
-
corpus = datasets.load_dataset('ciral/ciral-corpus', lang)
|
| 156 |
docid2doc = {doc['docid']: doc['text'] for doc in corpus}
|
| 157 |
|
| 158 |
query_file, qrel_file, pools_file = (filepaths) if len(filepaths) == 3 else (filepaths[0], filepaths[1], None)
|
|
|
|
| 108 |
'text': datasets.Value("string"),
|
| 109 |
}],
|
| 110 |
"negative_passages": [{
|
| 111 |
+
"docid": datasets.Value("string"),
|
| 112 |
+
"text": datasets.Value("string")
|
| 113 |
+
}],
|
| 114 |
+
|
| 115 |
+
"pools_positive_passages": [{
|
| 116 |
+
'docid': datasets.Value("string"),
|
| 117 |
+
'text': datasets.Value("string"),
|
| 118 |
+
}],
|
| 119 |
+
"pools_negative_passages": [{
|
| 120 |
"docid": datasets.Value("string"),
|
| 121 |
"text": datasets.Value("string")}]
|
| 122 |
}
|
|
|
|
| 153 |
datasets.SplitGenerator(
|
| 154 |
name='testB',
|
| 155 |
gen_kwargs={
|
| 156 |
+
'filepaths': downloaded_files['testB'],
|
| 157 |
},
|
| 158 |
),
|
| 159 |
]
|
|
|
|
| 161 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
| 162 |
def _generate_examples(self, filepaths):
|
| 163 |
lang = self.config.name
|
| 164 |
+
corpus = datasets.load_dataset('ciral/ciral-corpus', lang)['train']
|
| 165 |
docid2doc = {doc['docid']: doc['text'] for doc in corpus}
|
| 166 |
|
| 167 |
query_file, qrel_file, pools_file = (filepaths) if len(filepaths) == 3 else (filepaths[0], filepaths[1], None)
|