we get an overall -score and model accuracy of %depicted in figure - which is great but our previous model is still slightly better you can similarly use the support vector machine model estimator object svmwhich we created earlierand use the same snippet to train and predict using an svm model we obtained maximum accuracy and -score of with the svm model (refer to the jupyter notebook for step-by-step code snippetsthus you can see how effective and accurate these supervised machine learning classification algorithms are in building text sentiment classifier newer supervised deep learning models we have already mentioned multiple times in previous about how deep learning has revolutionized the machine learning landscape over the last decade in this sectionwe will be building some deep neural networks and train them on some advanced text features based on word embeddings to build text sentiment classification system similar to what we did in the previous section let' load the following necessary dependencies before we start our analysis in [ ]import gensim import keras from keras models import sequential from keras layers import dropoutactivationdense from sklearn preprocessing import labelencoder using tensorflow backend if you remember in we talked about encoding categorical class labels and also the onehot encoding scheme so farour models in scikit-learn directly accepted the sentiment class labels as positive and negative and internally performed these operations however for our deep learning modelswe need to do this explicitly the following snippet helps us tokenize our movie reviews and also converts the text-based sentiment class labels into one-hot encoded vectors (forms part of step in [ ]le labelencoder(num_classes= tokenize train reviews encode train labels tokenized_train [tn tokenizer tokenize(textfor text in norm_train_reviewsy_tr le fit_transform(train_sentimentsy_train keras utils to_categorical(y_trnum_classestokenize test reviews encode test labels tokenized_test [tn tokenizer tokenize(textfor text in norm_test_reviewsy_ts le fit_transform(test_sentimentsy_test keras utils to_categorical(y_tsnum_classesprint class label encoding map and encoded labels print('sentiment class label map:'dict(zip(le classes_le transform (le classes_)))print('sample test label transformation:\ '+'-'* '\nactual labels:'test_sentiments[: ]'\nencoded labels:'y_ts[: ]'\none hot encoded labels:\ 'y_test[: ]sentiment class label map{'positive' 'negative'