Posts

Showing posts from August, 2017

Sentiment Analysis with Deep Learning and Traditional Approaches: An Ensemble Modeling Example

Image
image downloaded from: https://beyondphilosophy.com/a-sentiment-analysis-of-sentiment-analysis-some-gobbledygook-some-bright-spots-and-a-nice-looking-dashboard/ In this article, we w ill use a simple text classification dataset to demonstrate how sentiment analysis can be done with both traditional text mining approaches and deep learning approaches. We will also compare the performance of the two modeling strategies and develop an ensemble model that maximizes prediction accuracy. The data is cited from de Freitas, Nando, and Misha Denil. "From Group to Individual Labels using Deep Features." (2015).  We will cover: Develop a LSTM deep learning model Sentiment analysis with polarity scores  Comparison and ensemble modeling Before we start, let's take a look at the data. The data contains 3,000 reviews labeled with positive and negative sentiments extracted from Amazon, IMDb, and Yelp.  The head of the data looks like this: So there is no way for m...

Sentiment Analysis with Deep Learning and Traditional Approaches: An Ensemble Modeling Example

Image
image downloaded from: https://beyondphilosophy.com/a-sentiment-analysis-of-sentiment-analysis-some-gobbledygook-some-bright-spots-and-a-nice-looking-dashboard/ In this article, we w ill use a simple text classification dataset to demonstrate how sentiment analysis can be done with both traditional text mining approaches and deep learning approaches. We will also compare the performance of the two modeling strategies and develop an ensemble model that maximizes prediction accuracy. The data is cited from de Freitas, Nando, and Misha Denil. "From Group to Individual Labels using Deep Features." (2015).  We will cover: Develop a LSTM deep learning model Sentiment analysis with polarity scores  Comparison and ensemble modeling Before we start, let's take a look at the data. The data contains 3,000 reviews labeled with positive and negative sentiments extracted from Amazon, IMDb, and Yelp.  The head of the data looks like this: So there is no way for m...

Text Generator with LSTM Recurrent Neural Network with Python Keras.

Image
Image downloaded from https://blog.4tests.com/21-study-habits-reddit-community/ In this article, we will make a text generator with LSTM Recurrent Neural Network with Python Keras. We train the network with post titles from Raddit.com, LifeProTips board. At the end, it generates brilliant life tips in fluent English. My Python code can be found on my Github . What we are going to include: Loading and processing text data Training a naive LSTM neural network Training a modified LSTM neural network Summary: Comparing the two models Loading and Processing Text Data The Text data were crawled from Raddit.com, LifeProTips board. I made a web crawler with Python scrapy .  Check my previous post for details. We first load the data from database with some SQL. Here I use Microsoft Access. Since the data is large, to reduce training time and memory needed, we only use posts in Jan, 2017. Here is the code. Load data import pyodbc conn_str = ( ...