Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example(dataset): add MKQA Dataset #2090

Merged
merged 2 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions example/datasets/LLM/MKQA/README.md
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
```
10 changes: 10 additions & 0 deletions example/datasets/LLM/MKQA/dataset.py
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()
5 changes: 5 additions & 0 deletions example/datasets/LLM/MKQA/example.py
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)
1 change: 1 addition & 0 deletions example/datasets/LLM/MKQA/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
datasets