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

Update to fix bug for csv files with real commas in text #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ianrowan
Copy link

@ianrowan ianrowan commented Jun 1, 2020

Currently the load_dataset method will load the following csv row example: "I ate pie, ice cream, and cookies\n" in line 37 into reader list as reader=[["I ate pie", "ice cream", "and cookies"]]` due to the commas read as columns delimiters.

When reader[0] is iterated as row in line 39 only row[0](I ate pie) is taken which would yield "<|startoftext|>I ate pie"<|endoftext|>"
This is because the commas created multiple list items in row.

Proposed change is to join each entire row list to use full text from each csv row. in this case ''.join(row) yields "<|startoftext|>I ate pie ice cream and cookies"<|endoftext|>" as it compresses the list into a single string. I have tested both of these scenarios in the code base as well.

Currently the load_dataset method will load the following csv row example: "I ate pie, ice cream, and cookies\n" in line 37 into reader list as reader=[["I ate pie", "ice cream", "and cookies"]] due to the commas read as columns delimiters. 

When reader[0] is iterated as row in line 39 only row[0](I ate pie) is taken which would yield "<|startoftext|>I ate pie"<|endoftext|>"
This is because the commas created multiple list items in row. 

Proposed change is to join each entire row list to use full text from each csv row. in this case ''.join(row) yields "<|startoftext|>I ate pie ice cream and cookies"<|endoftext|>" as it compresses the list into a single string. I have tested both of these scenarios in the code base as well.
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.

1 participant