Let's learn python NLP sentiment analysis with TensorFlow Library by creating a LSTM Neural Network. LSTM neural network is one of the most used neural network and one of the basic network in Generative AI. Whoever working on Generative AI must start with the basic RRN or LSTM. LSTM networks can keep memory. Although the sentiment analysis problem in python is very simple problem nowdays yet the sentiment analysis python is one of the most widely used problem and still many problems are to be solved in the industry are simple sentiment analysis problems. Python is one of the most used language for the machine learning now days in past days MATLAB was mostly used. But due to the expensive nature of the MATLAB and the free and open source contribution to the python deep learning libraries like TensorFlow and Keras as well as ONNX and PyTorch, now days most of the deep learning research is implemented in Python.
Deep learning is not as scarry as it looks like. In this tutorial we created a very simple sentiment analysis based LSTM network and train it with 100 epoch and validate for 10 input strings the output is sigmoid which is probability if greater then 0.5 the sentiment is positive otherwise negative. So our model is fast to train and test we aslo put Training validation loss curves and accuracy curves as well as roc curves for the result visualization. We show how to check the string sentiment as positive or negative with tensorflow based lstm model.