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

❓ How to apply a map to all subsets ? #118

Closed
astariul opened this issue May 15, 2020 · 1 comment
Closed

❓ How to apply a map to all subsets ? #118

astariul opened this issue May 15, 2020 · 1 comment

Comments

@astariul
Copy link

astariul commented May 15, 2020

I'm working with CNN/DM dataset, where I have 3 subsets : train, test, validation.

Should I apply my map function on the subsets one by one ?

import nlp

cnn_dm = nlp.load_dataset('cnn_dailymail')
for corpus in ['train', 'test', 'validation']:
         cnn_dm[corpus] = cnn_dm[corpus].map(my_func)

Or is there a better way to do this ?

@thomwolf
Copy link
Member

That's the way!

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

No branches or pull requests

2 participants