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 #25 | Create dataset loader for Typhoon Yolanda Tweets #56

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

IvanHalimP
Copy link
Contributor

@IvanHalimP IvanHalimP commented Nov 14, 2023

Closes #25

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.

@holylovenia holylovenia requested review from gentaiscool and jamesjaya and removed request for SamuelCahyawijaya, afaji, fajri91 and holylovenia November 16, 2023 03:43
Copy link
Collaborator

@jamesjaya jamesjaya left a comment

Choose a reason for hiding this comment

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

just some nits

Comment on lines 47 to 48
# TODO: Name the dataset class to match the script name using CamelCase instead of snake_case
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder):
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove TODO since it has been done

Suggested change
# TODO: Name the dataset class to match the script name using CamelCase instead of snake_case
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder):
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in the new commit. thanks

Comment on lines 98 to 103
emos = [-1, 0, 1]
# TODO: KEEP if your dataset is LOCAL; remove if NOT
if self.config.name == "typhoon_yolanda_tweets_source" or self.config.name == "typhoon_yolanda_tweets_seacrowd_text":
train_path = dl_manager.download_and_extract({emo: _URLS["train"][emo] for emo in emos})

test_path = dl_manager.download_and_extract({emo: _URLS["test"][emo] for emo in emos})
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove TODO, remove extra new line

Suggested change
emos = [-1, 0, 1]
# TODO: KEEP if your dataset is LOCAL; remove if NOT
if self.config.name == "typhoon_yolanda_tweets_source" or self.config.name == "typhoon_yolanda_tweets_seacrowd_text":
train_path = dl_manager.download_and_extract({emo: _URLS["train"][emo] for emo in emos})
test_path = dl_manager.download_and_extract({emo: _URLS["test"][emo] for emo in emos})
emos = [-1, 0, 1]
if self.config.name == "typhoon_yolanda_tweets_source" or self.config.name == "typhoon_yolanda_tweets_seacrowd_text":
train_path = dl_manager.download_and_extract({emo: _URLS["train"][emo] for emo in emos})
test_path = dl_manager.download_and_extract({emo: _URLS["test"][emo] for emo in emos})

Comment on lines 136 to 137
for row in df.itertuples():
print(row)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove print

Suggested change
for row in df.itertuples():
print(row)
for row in df.itertuples():

from seacrowd.utils.configs import SEACrowdConfig
from seacrowd.utils.constants import Licenses, Tasks

_SUPPORTED_TASKS = [Tasks.NAMED_ENTITY_RECOGNITION, Tasks.DEPENDENCY_PARSING]
Copy link
Collaborator

Choose a reason for hiding this comment

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

_SUPPORTED_TASKS is declared twice, please consolidate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted this one in the new commit

for emo, file in filepath.items():
with open(file) as f:
t = f.readlines()
l = [str(emo) for i in range(len(t))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
l = [str(emo) for i in range(len(t))]
l = [str(emo)] * len(t)

IvanHalimP and others added 3 commits November 19, 2023 16:33
…weets.py

Co-authored-by: James Jaya <2089265+jamesjaya@users.noreply.github.com>
Updated according to comments.
Please tell me if there are something else that I miss.
removed "TODO" and extra newlines
Copy link
Collaborator

@jamesjaya jamesjaya left a comment

Choose a reason for hiding this comment

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

tested, lgtm

Copy link
Collaborator

@gentaiscool gentaiscool left a comment

Choose a reason for hiding this comment

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

lgtm

@sabilmakbar
Copy link
Collaborator

Shall we merge this @jamesjaya @gentaiscool since both of you have approved?

@sabilmakbar sabilmakbar merged commit 4922146 into SEACrowd:master Nov 23, 2023
1 check passed
jensan-1 pushed a commit to jensan-1/seacrowd-datahub that referenced this pull request Nov 24, 2023
…SEACrowd#56)

* Typhoon Yolanda Tweets dataloader

* Create __init__.py

* Update seacrowd/sea_datasets/typhoon_yolanda_tweets/typhoon_yolanda_tweets.py

Co-authored-by: James Jaya <2089265+jamesjaya@users.noreply.github.com>

* Update typhoon_yolanda_tweets.py

Updated according to comments.
Please tell me if there are something else that I miss.

* Update typhoon_yolanda_tweets.py

removed "TODO" and extra newlines

---------

Co-authored-by: James Jaya <2089265+jamesjaya@users.noreply.github.com>
akhdanfadh pushed a commit to akhdanfadh/seacrowd-datahub that referenced this pull request Nov 25, 2023
…SEACrowd#56)

* Typhoon Yolanda Tweets dataloader

* Create __init__.py

* Update seacrowd/sea_datasets/typhoon_yolanda_tweets/typhoon_yolanda_tweets.py

Co-authored-by: James Jaya <2089265+jamesjaya@users.noreply.github.com>

* Update typhoon_yolanda_tweets.py

Updated according to comments.
Please tell me if there are something else that I miss.

* Update typhoon_yolanda_tweets.py

removed "TODO" and extra newlines

---------

Co-authored-by: James Jaya <2089265+jamesjaya@users.noreply.github.com>
@jamesjaya jamesjaya self-assigned this Jan 12, 2024
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 Typhoon Yolanda Tweets
4 participants