Skip to content

Commit

Permalink
Types fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mnjkhtri committed Nov 16, 2023
1 parent a0a1430 commit 0dd87bb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions seacrowd/sea_datasets/belebele/belebele.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datase
path = dl_manager.download_and_extract(_URLS[_DATASETNAME])
file = "{path}/Belebele/{lang}.jsonl".format(path=path, lang=lang)

return datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"file": file,
},
)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"file": file,
},
),
]

def _generate_examples(self, file: str) -> Tuple[int, Dict]:
"""Yields examples as (key, example) tuples."""
Expand All @@ -152,8 +154,8 @@ def _generate_examples(self, file: str) -> Tuple[int, Dict]:
answer = choices[int(line['correct_answer_num'])-1]
yield key, {
"id": key,
"question_id": line['question_number'],
"document_id": hashlib.md5(line['question_number'].encode('utf-8')).hexdigest(),
"question_id": str(line['question_number']),
"document_id": hashlib.md5(line['flores_passage'].encode('utf-8')).hexdigest(),
"question": line['question'],
"type": 'multiple_choice',
"choices": choices,
Expand Down

0 comments on commit 0dd87bb

Please sign in to comment.