I wrote an article titled “Sentiment Analysis Using Keras” in the November 2018 issue of Visual Studio Magazine. See https://visualstudiomagazine.com/articles/2018/11/01/sentiment-analysis-using-keras.aspx.
In the article, I use the standard IMDB movie review dataset and create a prediction model that will accept the text a movie review, and emit a value between 0.0 and 1.0 where a value less than 0.5 means a negative review (“this film is terrible”), and a value greater than 0.5 means a positive review (“great experience”).
Sentiment analysis is a very challenging problem — much more difficult than you might guess. The Keras library has excellent support to create a sentiment analysis model, using an LSTM (“long, short-term memory”) deep network.
I’m quite proud of this particular article because explaining Keras and LSTMs is difficult, and especially difficult to explain succinctly.
One aspect of the problem that I didn’t go into is data preparation. The Keras library comes with the IMDB dataset built-in and ready to go. This is a huge time saver. I’m implemented a sentiment analysis system starting from the raw IMDB data — 50,000 individual files with one review in each. Getting the data ready was a big effort and took me a full week of pretty concentrated effort.
As I point out in my article, “As recently as about two years ago, trying to create a custom sentiment analysis model wouldn’t have been feasible unless you had a lot of developer resources, a lot of machine learning expertise and a lot of time. Instead, you’d likely have had to use a canned approach from a service such as Azure Cognitive Services text analytics. But now, even though sentiment analysis is a very challenging problem, the existence of neural network libraries like Keras with built-in LSTM functionality has made custom sentiment analysis feasible.”



.NET Test Automation Recipes
Software Testing
SciPy Programming Succinctly
Keras Succinctly
R Programming
2026 Visual Studio Live
2025 Summer MLADS Conference
2026 DevIntersection Conference
2025 Machine Learning Week
2025 Ai4 Conference
2026 G2E Conference
2026 iSC West Conference
I kinda wonder the inner working here, a LSTM is normally used to detect series patterns. (like LSTM text generators / trading trends etc),.
In this case i wonder though the LSTM is used to learn 2000 words, and then order those ?,
The next layer weigths them (normal dense), but with an LSTM the series input shift to the right (as in the schematic LSTM view) so that would brake the dense connenction(s) of the weights of those words. I’m wondering also if an LSTM used in this way would just create a set of very possitve words only (or negative only) (“-only-“, as in shifting series operation to the right), the LSTM wont be able to shift possitve words to the right and bad ones to the left (LSTM is only forward series predicton)… Though it might be interesting to think about 2 way directions LSTM filters
I’m interested your view on that.
While i also wonder would a more simple random forrest outperform it
(LSTM take a lot of time to train).
PS there are free Jupiter notebook environments on azure