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 #569 | Add/Update Dataloader MSL4Emergency #677

Merged
merged 6 commits into from
May 30, 2024

Conversation

sabilmakbar
Copy link
Collaborator

@sabilmakbar sabilmakbar commented May 16, 2024

Please name your PR title and the first line of PR message after the issue it will close. You can use the following examples:

Closes #569

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.

Copy link
Collaborator

@muhammadravi251001 muhammadravi251001 left a comment

Choose a reason for hiding this comment

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

Somehow, I still get error when running .load_dataset or testing via tests.test_seacrowd, the error is:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 11: character maps to <undefined>.

Do you know why this happens? Or is everything fine (OK/passed) on ​​your side? @sabilmakbar

@sabilmakbar
Copy link
Collaborator Author

sabilmakbar commented May 22, 2024

Somehow, I still get error when running .load_dataset or testing via tests.test_seacrowd, the error is:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 11: character maps to <undefined>.

Do you know why this happens? Or is everything fine (OK/passed) on ​​your side? @sabilmakbar

Hmm, on my end it works fine. You can check this log file, which is a sh output from this cmd:
python -m tests.test_seacrowd seacrowd/sea_datasets/msl4emergency/msl4emergency.py

test_msl4emergency.log

I'm thinking that your error might come from these lines (in L114-115):

with open(text_path, "r") as f:
    text_data = [data.split("\t") for data in f.readlines()]

You can try to print the text_path var and load it separately on your end to see if that's indeed the case.

Update: Oh perhaps it's related to _CITATION strings (if the line indicator is referring to the string decoding error in Citation lines).

let me know any of these solved the bug on this code @muhammadravi251001

@muhammadravi251001
Copy link
Collaborator

muhammadravi251001 commented May 26, 2024

It's not about the _CITATION. After changing the encoding parameter on open to:

with open(text_path, "r", encoding="utf-8") as f:

I get an OK response and get the dataset perfectly with load_dataset() method.

The problem is: that I run this dataloader implementation on my Windows notebook, and Windows does not always run encoding on utf-8 in my case; while Linux and MacOS default is utf-8.

To avoid this future-encoding-error, I recommend adding an encoding value to the open method, @sabilmakbar .

@sabilmakbar
Copy link
Collaborator Author

thanks! done making changes, pls have a look @muhammadravi251001

Copy link
Collaborator

@muhammadravi251001 muhammadravi251001 left a comment

Choose a reason for hiding this comment

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

Test passed on both via tests.seacrowd and .load_dataset(). LGTM. Approved. Great work!

Thanks for the change & your contribution @sabilmakbar!

@holylovenia
Copy link
Contributor

Hi @ljvmiranda921, sorry for the sudden notice. I assigned you here in place of @luckysusanto due to the lack of response.

I would like to let you know that we plan to finalize the calculation of the open contributions (e.g., dataloader implementations) in 31 hours, so it'd be great if we could wrap up the reviewing and merge this PR before then.

@ljvmiranda921
Copy link
Collaborator

Sure! I'll just update the small nits myself as well just to speed things up! 👍

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! Merging this in a few

@ljvmiranda921 ljvmiranda921 merged commit 9c39d56 into SEACrowd:master May 30, 2024
1 check passed
@sabilmakbar sabilmakbar deleted the sabil/add/msl4emergency branch May 31, 2024 17:12
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 Myanmar Sign Language Corpus for the Emergency Domain (MSL4Emergency)
5 participants