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 #225 | Add Dataloader ALICE-THI #597

Merged
merged 3 commits into from
May 5, 2024
Merged

Conversation

akhdanfadh
Copy link
Collaborator

Closes #225

I implemented one config per language/subset. Thus, configs will look like this: alice_thi_THI-C68_source, alice_thi_THI-D10_seacrowd_imtext, etc. When testing, pass alice_thi_<subset> to the --subset_id parameter.

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 naming).
  • Provide values for the _CITATION, _DATASETNAME, _DESCRIPTION, _HOMEPAGE, _LICENSE, _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.
  • 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.

@yongzx
Copy link
Collaborator

yongzx commented Apr 19, 2024

I ran into this issue when I run python -m tests.test_seacrowd seacrowd/sea_datasets/alice_thi/alice_thi.py --subset alice_thi_THI-D10. also the same when I ran with --schema IMTEXT

Traceback (most recent call last):
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/builder.py", line 1687, in _prepare_split_single
    example = self.info.features.encode_example(record) if self.info.features is not None else record
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/features/features.py", line 1866, in encode_example
    return encode_nested_example(self, example)
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/features/features.py", line 1243, in encode_nested_example
    {
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/features/features.py", line 1244, in <dictcomp>
    k: encode_nested_example(sub_schema, sub_obj, level=level + 1)
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/features/features.py", line 1243, in encode_nested_example
    {
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/features/features.py", line 1243, in <dictcomp>
    {
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 323, in zip_dict
    yield key, tuple(d[key] for d in dicts)
  File "/Users/yong/Dev/env_seacrowd/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 323, in <genexpr>
    yield key, tuple(d[key] for d in dicts)
KeyError: 'context'

@ljvmiranda921
Copy link
Collaborator

ljvmiranda921 commented Apr 22, 2024

Will review this after you address @yongzx 's comments! Got a bit busy this week 😅

@akhdanfadh
Copy link
Collaborator Author

I don't know why the comment resulted in an error on your end, but not on mine. I've uncommented the line there. Also, ran the makefile.

@yongzx @ljvmiranda921

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.

Ran the source subset_ids and it passed! lgtm

@yongzx
Copy link
Collaborator

yongzx commented May 5, 2024

It runs for me now! LGTM

@yongzx yongzx merged commit bc45629 into SEACrowd:master May 5, 2024
1 check passed
@akhdanfadh akhdanfadh deleted the alice_thi branch May 6, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create dataset loader for ALICE-THI
3 participants