In the init() method, you should make your data ready. I usually make it becomes self.x, and self.t for input vectors and target labels respectively. Yes, you have to create a vocabulary in the process of converting each text to vector. You can define a separate function for the converting to reduce the complexity of init() method.
len() and getitem() methods tell the dataloader how you want it to return data in each minibatch. So it will return a bunch of samples, each with separate indexes idx. It will automatically allocate the idx between 0 and the len() of your dataset.