-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example(dataset): add MKQA Dataset (#2090)
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: The `Multilingual Knowledge Questions & Answers` Dataset | ||
--- | ||
|
||
## The Multilingual Knowledge Questions & Answers Dataset Description | ||
|
||
- [Homepage](https://github.com/apple/ml-mkqa) | ||
|
||
## The `mkqa` dataset Structure | ||
|
||
### Data Fields | ||
|
||
please refer to https://huggingface.co/datasets/mkqa | ||
|
||
## Build `mkqa` sample Dataset locally | ||
|
||
```shell | ||
python3 dataset.py | ||
``` | ||
|
||
## Example | ||
|
||
Output the `10`th record of the `mkqa` dataset. | ||
|
||
```shell | ||
python3 example.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from datasets import load_dataset | ||
|
||
from starwhale import dataset | ||
|
||
hg_ds = load_dataset("mkqa", split="train") | ||
sw_ds = dataset("mkqa") | ||
for item in enumerate(hg_ds): | ||
sw_ds.append(item[1]) | ||
sw_ds.commit() | ||
sw_ds.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from starwhale import dataset | ||
|
||
ds = dataset("mkqa") | ||
row = ds[10] | ||
print(row.features) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
datasets |