You need to create word vectors with something like word2vec or fasttext or create character vectors in a similar fashion.  Then each of your vectors will be num_words x word_vector_size or more generically length x feature_dim.  You can see examples in the pytorch tutorials for this:
https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html
https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
But the general idea is that you want to avoid using one hot-encodings and instead use dense vector representations.