I'm developing an LSTM neural network algorithm that, for lack of a better summary, takes a question as input and generates an answer as output. Now, the way I'm going about it is to parse the question word-by-word and have the algorithm note some of the previous words to implicitly learn how these words combine and affect the answer. For example, the question "How's the weather in Philadelphia?" gets broken up into "How's","the", "weather", "in","Philadelphia".
The problem is, not all my questions or answers are of the same length. I could have questions like, "How's the weather?" or "What color of pants am I wearing?" Plus, the vocabulary consists of about 300 words, making a one-hot encoding scheme based simply on these words impractical.