Make the dataset streamable
cc @albertvillanova let me know if it sounds good to you !
Thanks for addressing the issue of streaming support.
First of all, do you think the dataset license allows hosting the data?
- The dataset page states the dataset license is CC0
- However, they also say: https://skylion007.github.io/OpenWebTextCorpus/
We do not own any of the text from which these data has been extracted.
What about following a similar take down policy and mention it in the dataset card ?
As we discussed yesterday, then we should assume the maintenance cost: when a take down will be requested, we need someone to address the request as quickly and diligently as possible.
Also, it would be interesting to know if the authors have already been asked to remove some data and if they have already removed it or it is pending.
First, I don't think anyone besides the original creator could get in trouble for the data contained as long as you mention it is a modified version from that source. You can comply if the original has been modified. Don't get me wrong, but I believe fair use would protect you for this as long as you show signs of modifying the data if the original is modified.
As for making this streamable, has anyone been successful?
Also, it seems like that downloading from Zenodo can be slow sometimes (the openwebtext issue on Discord, https://codalab.lisn.upsaclay.fr/forums/5951/874/, GH issue, ....), so hosting the shards on the Hub would help in that regard.
@lhoestq Can you add the sharding script to the PR? We could re-use this script to update the shards each time a new version of the dataset gets released.
The shards come from the link of the original website https://skylion007.github.io/OpenWebTextCorpus/
As for making this streamable, has anyone been successful?
Yes the version in this PR is streamable
Does it sound good to you @albertvillanova @mariosasko ?
Yes, feel free to merge :)
@lhoestq
the function _iter_archive
is basically dl_manager.iter_archive
. Why do you replicate it instead of using dl_manager.iter_archive
twice?
Because it needs to be run inside _generate_examples - where we don't have a dl_manager
Why don't you run it inside _split_generators
?
Because they are nested TAR archives. I would have to download the whole top level TAR archive to instantiate the lower levels TAR iterators
I was thinking of a generator function, with dl_manager
as an argument, that makes two nested loops (each one with a dl_manager.iter_archive
).
But if you say that is not possible, feel free to merge this PR as it is.
oh that would work indeed - I don't have a strong opinion then
let me do the change, it will make the code simpler
I ended up passing iter_archive
to simplify everything :) Let me know if it sounds good for you
@albertvillanova
Now we no longer have duplicate code, in line with the DRY (Don't Repeat Yourself) principle.
Thanks.