Given raw data, write a custom PyTorch dataset class to preprocess, tokenize, and batch text data for training.