N
N
naruto_hokagi2018-01-29 16:07:08
Python
naruto_hokagi, 2018-01-29 16:07:08

Recurrent Neural Networks in Python?

Hello.
There was such a question, it is necessary to classify texts using a neural network, I present the test in vector form using word2vec, I write a neural network using keras, there is a special LSTM class for a recursive network, but a two-dimensional array is input to it, and I have a text vector. How to solve this problem? How to create a neural network in python for text classification using Keras + word2Vec?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivodopyanov, 2018-01-30
@ivodopyanov

1. In machine learning, they usually train on minibatch - blocks of N examples, where N is usually no more than 100 - and not one at a time.
2. Therefore, the input is not a two-dimensional, but a three-dimensional array - <number of examples in a minibatch>*<maximum sequence length>*<number of features \ word vector dimension>
3. You can run text through word2vec as part of a neural network on Keras - there is an Embedding layer in which you can preset weight values. Then the input values ​​are sequences of word id's.
4. There are also examples: https://github.com/keras-team/keras/blob/master/ex...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question