we obtained an overall model accuracy and -score of with the glove featureswhich is still good but not better than what we obtained using our word vec features you can refer to the sentiment analysis supervised ipynb jupyter notebook to see the step-by-step outputs obtained for the previous code this concludes our discussion on building text sentiment classification systems leveraging newer deep learning models and methodologies onwards to learning about advanced deep learning modelsadvanced supervised deep learning models we have used fully connected deep neural network and word embeddings in the previous section another new and interesting approach toward supervised deep learning is the use of recurrent neural networks (rnnsand long short term memory networks (lstmswhich also considers the sequence of data (wordseventsand so onthese are more advanced models than your regular fully connected deep networks and usually take more time to train we will leverage keras on top of tensorflow and try to build lstmbased classification model here and use word embeddings as our features you can refer to the python file titled sentiment_analysis_adv_deep_learning py for all the code used in this section or use the jupyter notebook titled sentiment analysis advanced deep learning ipynb for more interactive experience we will be working on our normalized and pre-processed train and test review datasetsnorm_ train_reviews and norm_test_reviewswhich we created in our previous analyses assuming you have them loaded upwe will first tokenize these datasets such that each text review is decomposed into its corresponding tokens (workflow step in [ ]tokenized_train [tn tokenizer tokenize(textfor text in norm_train_reviewstokenized_test [tn tokenizer tokenize(textfor text in norm_test_reviewsfor feature engineering (step )we will be creating word embeddings howeverwe will create them ourselves using keras instead of using pre-built ones like word vec or glovewhich we used earlier word embeddings tend to vectorize text documents into fixed sized vectors such that these vectors try to capture contextual and semantic information for generating embeddingswe will use the embedding layer from keraswhich requires documents to be represented as tokenized and numeric vectors we already have tokenized text vectors in our tokenized_train and tokenized_text variables however we would need to convert them into numeric representations besides thiswe would also need the vectors to be of uniform size even though the tokenized text reviews will be of variable length due to the difference in number of tokens in each review for thisone strategy could be to take the length of the longest review (with maximum number of tokens\wordsand set it as the vector sizelet' call this max_len reviews of shorter length can be padded with pad term in the beginning to increase their length to max_len we would need to create word to index vocabulary mapping for representing each tokenized text review in numeric form do note you would also need to create numeric mapping for the padding term which we shall call pad_index and assign it the numeric index of for unknown termsin case they are encountered later on in the test dataset or newerpreviously unseen reviewswe would need to assign it to some index too this would be because we will vectorizeengineer featuresand build models only on the training data henceif some new term should come up in the future (which was originally not part of the model training)we will consider it as an out of vocabulary (oovterm and assign it to constant index (we will name this term not_found_index and assign it the index of vocab_size+ the following snippet helps us create this vocabulary from our tokenized_train corpus of training text reviews