Now let again compute the metrics and compare the performance.
logits = sess.run(model.logits, feed_dict={model.X:str_idx(test_X,dictionary,maxlen)})
print(metrics.classification_report(test_Y, np.argmax(logits,1), target_names = trainset.target_names))
The computed outputs are shown below:
So, we can clearly see the boost in the performance of the model! Now, with the LSTM the F1 score is bumped to 72% whereas in our previous basic RNN model it was 66% which is quite a good improvement of 7%.