How to Train it using RNN?

First of all cleaning, the data is a big task itself.
Then I am trying to vectorize the sentences using TfidfVectorizer(), but it is crashing the whole system due to the unavailability of ram in spite of having 12gb ram.
However, if I am able to convert each sentence to a vector, What should be the first layer to feed this data in.
and Vectorization will not consider the ordering of words. it will simply become a bag of words. while analysis of review should be done considering the relative order or words.

How can I do it using word embeddings because the length of the sentences is big and how to crop each sentence to bring them on the same level, I mean which part should be cropped from front or back?

Can u provide some suggestions to implement this model and overcome this difficulties?

Hey @nuts2021, first of all when you are trying to implement rnn than you need not to vectorize. Answer why this should not be done, is within your doubt, that context will be lost. Now comes how to proceed.

First of all you need to decide which embedding to use, after doing so convert each word to its embeddings.

Second, you need to find maximum length of sentence and make all sentences to that length by adding 0, also called paddings.

Third now your training data will have shape like (number of examples, max_sentence_length, embeddings size)

Now just make simple rnn network and train your model and make predictions.

You can also take reference from 7th lecture in Recurrent Neural Network section.

Hope this cleared your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.