-
Notifications
You must be signed in to change notification settings - Fork 147
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
added support for hugging face datasets #354
Conversation
src/autolabel/dataset_loader.py
Outdated
dataset[ | ||
start_index : max_items if max_items and max_items > 0 else len(dataset) |
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.
do we need to do any sanity checks on the dataset object before attempting to convert to dataframe?
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.
This seems to be a more robust solution so I'll implement it here as well
|
||
self.db.initialize() | ||
self.dataset = self.db.initialize_dataset( | ||
dataset, self.config, start_index, max_items | ||
dataset_loader.dat, self.config, start_index, max_items |
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.
can we access the dataframe with a helper method in dataset loader (vs directly accessing it here) ? for readability
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.
Can you give an example of what you want it to look like instead?
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.
i was thinking just having a def as_datafame()
method in the data loader that returns the internal pandas dataframe object, instead of the labeling agent accessing it directly
src/autolabel/labeler.py
Outdated
else f"{dataset.replace('.csv','')}_labeled.csv" | ||
) | ||
else: | ||
csv_file_name = "labeled.csv" |
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.
let's change this to contains a task name prefix_labeled.csv so that the output files from different tasks don't overwrite each other
We can now load datasets from Huggingface as show below