I have 3 sets of sentences (varying in word counts), but I don't know how to extract features from the text such that the input dimension will remain the same.
For example, I've tried bag-of-words but, since the word-count variation causes input-dimension variation, I eventually get errors.
I would much appreciate it if you could show me an approach to preparing the string data for the neural network.
Thank you!
(Python 2.7 in Windows 7)
How to format the input
This is an extraction from wikipedia.org
Here are two simple text documents:
Based on these two text documents, a dictionary is constructed as:
which has 10 distinct words. And using the indexes of the dictionary, each document is represented by a 10-entry vector:
Your input will remain the same size, regardless of the length of your document. I hope this will help you.