3 ms·
How would you feed a sentence to a neural net? As I understand, the inputs are usually just floating point numbers in a small range, so how is the mapping perfo
by amelius 11y ago
How would you feed a sentence to a neural net? As I understand, the inputs are usually just floating point numbers in a small range, so how is the mapping performed? And what if the sentence is longer than the number of input neurons? Can that even happen, and pose a problem?
- wodenokoto 11y agoOne hot vectors. You build a dictionary of all words + one catch all for unknown words. Each word then has a position in a sparse vector. So for example : Yes = (0,0,1,0,0,...) No = (0,0,0,1,0,....) Convolutional and recurrent nets can handle inputs of arbitrary lengths.
- vhold 11y agoWhat wodenokoto said, and also look up "Word Embeddings", word2vec is a popular method. https://www.tensorflow.org/versions/r0.7/tutorials/word2vec/index.html https://www.tensorflow.org/versions/r0.7/tutorials/word2vec/... There's a bunch of blogs, tutorials, etc, around word2vec and other methods of generating vectors from a training set of words. Also, in the tensorflow models codebase where this syntaxnet code lives, there is an another tensorflow-using-method of generating word embeddings with demonstration code called Swivel https://github.com/tensorflow/models/tree/master/swivel https://github.com/tensorflow/models/tree/master/swivel
- zodiac 11y agoI think Syntaxnet is just using the NN to guide search instead of doing end-to-end parsing. That said, you can feed "sequences of stuff" into recurrent neural nets! See https://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf https://papers.nips.cc/paper/5346-sequence-to-sequence-learn...