To be honest, I don’t really understand what you’re trying to do. But usually, when you consider text documents as bag of words, one represents documents as a one-hot vector with the length being the size of the vocabulary. You preds seem to reflect this. In contrast, Your sentences and targets look like sequences. I assume you have to write your own solution for whatever you’re trying to do.