Thanks for the reply @vfdev-5. I put together some code to show what a batch looks like in torchtext.
import torch
from torch import nn, optim
import torch.nn.functional as F
from torchtext.data import Field, BucketIterator
from torchtext.datasets import IMDB

# load IMDB reviews and ratings data 
# (built into torchtext similar to MNIST with torchvision)

## define fields in data
TEXT = Field(lower=True)
LABEL = Field(sequential=False)

## import datasets
train, test = IMDB.splits(TEXT, LABEL, root="../data")
TEXT.build_vocab(train, min_freq=20)
LABEL.build_vocab(train)
train_iter, test_iter = BucketIterator.splits((train, test),
                                              batch_size=100,
                                              repeat=False)

# show what a batch looks like
for batch in train_iter:
    break

data, target = batch.text.t(), batch.label - 1

At the very bottom of the code, I grab a batch from the iterator. As opposed to the batch in MNIST, this is not a tuple, and instead there are fields within the batch that need to be extracted.
I noticed in the “Concepts” documentation in the second code block there is the following line
x, y = prepare_batch(batch)

Is it possible to define prepare_batch? If so, that would really simplify this task.