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

🐛 map not working #120

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

🐛 map not working #120

astariul opened this issue May 15, 2020 · 1 comment

Comments

@astariul
Copy link

astariul commented May 15, 2020

I'm trying to run a basic example (mapping function to add a prefix).
Here is the colab notebook I'm using.

import nlp

dataset = nlp.load_dataset('squad', split='validation[:10%]')

def test(sample):
    sample['title'] = "test prefix @@@ " + sample["title"]
    return sample

print(dataset[0]['title'])
dataset.map(test)
print(dataset[0]['title'])

Output :

Super_Bowl_50
Super_Bowl_50

Expected output :

Super_Bowl_50
test prefix @@@ Super_Bowl_50

@astariul astariul changed the title map not working 🐛 map not working May 15, 2020
@astariul
Copy link
Author

I didn't assign the output 🤦‍♂️

dataset.map(test)

should be :

dataset = dataset.map(test)

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

1 participant