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

Closes #526 | Add dataloader for WIkiHow-GOSC #674

Merged
merged 2 commits into from
May 23, 2024

Conversation

elyanah-aco
Copy link
Collaborator

Closes #526.

Notes:

Checkbox

  • Confirm that this PR is linked to the dataset issue.
  • Create the dataloader script seacrowd/sea_datasets/{my_dataset}/{my_dataset}.py (please use only lowercase and underscore for dataset folder naming, as mentioned in dataset issue) and its __init__.py within {my_dataset} folder.
  • Provide values for the _CITATION, _DATASETNAME, _DESCRIPTION, _HOMEPAGE, _LICENSE, _LOCAL, _URLs, _SUPPORTED_TASKS, _SOURCE_VERSION, and _SEACROWD_VERSION variables.
  • Implement _info(), _split_generators() and _generate_examples() in dataloader script.
  • Make sure that the BUILDER_CONFIGS class attribute is a list with at least one SEACrowdConfig for the source schema and one for a seacrowd schema.
  • Confirm dataloader script works with datasets.load_dataset function.
  • Confirm that your dataloader script passes the test suite run with python -m tests.test_seacrowd seacrowd/sea_datasets/<my_dataset>/<my_dataset>.py or python -m tests.test_seacrowd seacrowd/sea_datasets/<my_dataset>/<my_dataset>.py --subset_id {subset_name_without_source_or_seacrowd_suffix}.
  • If my dataset is local, I have provided an output of the unit-tests in the PR (please copy paste). This is OPTIONAL for public datasets, as we can test these without access to the data files.

Comment on lines +82 to +85
"title": datasets.Value("string"),
"category": datasets.Value("string"),
"sections": datasets.Sequence({"section": datasets.Value("string"), "steps": datasets.Sequence(datasets.Value("string")), "ordered": datasets.Value("int32")}),
"ordered": datasets.Value("int32"),
Copy link
Collaborator

@sabilmakbar sabilmakbar May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @elyanah-aco, I checked this data, and some of the examples don't have any sections key (probably single-sectioned data).

This is an example of the key list of the data and (note: one-based index since I enumerate it from 1).
image
image

Do you mind making some readjustments on the _generate_examples to cater to such cases? I'm thinking of transforming such data into a section field with a single-valued list (let me know if you have a better workaround). Thx!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sabilmakbar I'm thinking like this:

"sections": ["section": "", "steps": ['" Mulailah membuat situs web.", "Gunakan Twitter."], "ordered": 1],
"ordered": 1

where ordered inside and outside sections are the same. ordered inside sections indicates if steps inside that section are ordered, and ordered outside indicates if sections themselves are ordered. They should be the same if there's just one section

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the outer ordered, it should be valued as 1, even if the inner section ordered value is 0 (the one coming from actual data) because it's a single-valued list anyway (indicates the list contents is ordered for sections data). The ordered in inner section (for section data, singleton list) will follow the initial ordered value from actual example. Wdyt?

If we're taking the example from prev ss (but the ordered value is 0 instead of 1), we can construct it like this:

# the `ordered` value in sections list indicatest the actual `ordered` state on the `steps`
"sections": ["section": "", "steps": ['" Mulailah membuat situs web.", "Gunakan Twitter."], "ordered": 0],
"ordered": 1 # the value indicates the ordering in `sections` is ordered (which is 1 for singleton list)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup you're correct. Will work on this tomorrow

Copy link
Collaborator

@sabilmakbar sabilmakbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Collaborator

@ljvmiranda921 ljvmiranda921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! will merge in a few :)

@ljvmiranda921 ljvmiranda921 merged commit feee920 into SEACrowd:master May 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create dataset loader for WikiHow-GOSC
3 participants