Generate batches for user data


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


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


Does it work for NDarrays?


Yes it works with NDArray, check the ArrayDataset class