Using keras Sequence with ragged inputs, ragged outputs, and Sparse Categorical Cross Entropy

I’m trying to create a text generation system. My model has sparse inputs in the form
[0]+document, where document is a list of integer indices corresponding to the words in a document, and I am training it with Sparse Categorical Cross Entropy, so the y values should be in the form document+[0]. I want to use an object derived from keras.utils.Sequence to train the model, but I’m finding that the model doesn’t understand the shape of the y values.

How should my Sequence structure its y values?

Some further information - added here as I’m too new to edit posts.
When I structure my y values as

                            for row in batch])

The error I get is

ValueError: Inconsistent shapes: saw (None,) but expected ()