Generate batches for user data


#1

I have a dataset of 25000 sentences and their corresponding labels separately.
How can I generate batches for the dataset??


#2

Did you look at Gluon’s DataLoader? Your dataset object needs to support __len__() as well as __getitem__() (i.e. index operator).


#3

Does it work for NDarrays?


#4

Yes it works with NDArray, check the ArrayDataset class