-
Notifications
You must be signed in to change notification settings - Fork 57
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
Closes #25 | Create dataset loader for Typhoon Yolanda Tweets #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nits
seacrowd/sea_datasets/typhoon_yolanda_tweets/typhoon_yolanda_tweets.py
Outdated
Show resolved
Hide resolved
# TODO: Name the dataset class to match the script name using CamelCase instead of snake_case | ||
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder): |
There was a problem hiding this comment.
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
# TODO: Name the dataset class to match the script name using CamelCase instead of snake_case | |
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder): | |
class TyphoonYolandaTweets(datasets.GeneratorBasedBuilder): |
There was a problem hiding this comment.
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
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}) |
There was a problem hiding this comment.
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
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}) |
for row in df.itertuples(): | ||
print(row) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print
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] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l = [str(emo) for i in range(len(t))] | |
l = [str(emo)] * len(t) |
…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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Shall we merge this @jamesjaya @gentaiscool since both of you have approved? |
…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>
…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>
Closes #25
Checkbox
seacrowd/sea_datasets/my_dataset/my_dataset.py
(please use only lowercase and underscore for dataset naming)._CITATION
,_DATASETNAME
,_DESCRIPTION
,_HOMEPAGE
,_LICENSE
,_URLs
,_SUPPORTED_TASKS
,_SOURCE_VERSION
, and_SEACROWD_VERSION
variables._info()
,_split_generators()
and_generate_examples()
in dataloader script.BUILDER_CONFIGS
class attribute is a list with at least oneSEACrowdConfig
for the source schema and one for a seacrowd schema.datasets.load_dataset
function.python -m tests.test_seacrowd seacrowd/sea_datasets/<my_dataset>/<my_dataset>.py
.