
This article presents our research on understanding the cab services throughout India for Uber & Ola using Deep Learning.
Important Points
- Our work addresses the mode of transport for different people on a day to day basis and what they expect from the service providers.
- The two currently popular cab services in India are Uber & Ola with a vast number of users with a different lifestyle.
- Today Twitter is at a peak of data with millions of people tweeting every day, the current Uber & Ola followers on Twitter are 315.2K & 244.9K respectively.
- The Deep Learning algorithm used for understanding the sentiments of people is Convolutional Neural Network.
- We evaluate the model for sentiment classes such as Positive & Negative to find out what accuracy it is generating with respect to the use case.
Introduction
Twitter Sentiment Analysis is used to find the sentiments or emotions of people behind the tweet. A review of a person/customer is analyzed via the tweets which helps the companies to further understand what review does a customer has about the product or service provided by the company. From the time Twitter sentiment analysis has started, it has been beneficial a lot for companies to extract, quantify & understand what value their product holds from a customer’s perspective. Although Twitter sentiment analysis can be done for any domains, the domain chosen is Uber & Ola cab riding service companies. The reason for choosing Uber & Ola is because of the vast data which can be collected from the cab users. That can be later used, to extract the tweets to understand if the customers are happy or aren’t with the services & what issues they are facing.
Research has done on the sentiment analysis for 3000 tweets, after extracting them the tweets had to be cleaned for stop words, hyper-links, white spaces. The approach that we thought of using was deep learning to understand more keenly how can it create an impact on Twitter sentiment analysis of Uber & Ola. The algorithms used are Deep Feed Forward Neural Network (DFF) & Convolution Neural Network (CNN) for our data sets. These two algorithms are categories of Deep Neural Network (DNN). After cleaning the tweets, the first technique that is Google Word2Vec is used. Google Word2Vec is an advanced way to train the vocabulary in the text. It trains the vocabulary to the nearest possible meaning of the word. The various parameters are weight multiplication of perceptron, various activation functions, optimizers for optimizing outputs & loss functions. The accuracies are calculated based on the loss function. This function is used to calculate the loss between the training & testing data, thereby making us understand how deep learning algorithms impact the Twitter sentiment analysis for Uber & Ola.
Dataset
The datasets acquired for sentiment classification are obtained from Twitter using the API.

The important thing to keep in mind is that the relevant information for the sentiment classification can be obtained from the Text (Tweets of Users).
Steps Involved in Sentiment Classification
There are various steps for obtaining the required use case, they are

The sentiment analysis consists of 7 steps that are:
- Text Input
Data is collected from Uber & Ola with the relevant parameters keeping in mind for the use case.
- Tokenization
Tokenization is the process for turning a meaningful piece of data from the whole.
- Stop Word Filtering
A stop word is a commonly used word that should be filtered.
- Negation Handling
Negation handling determines the negation scope of different types of negations.
- Stemming
Stemming is a method for collapsing distinct word forms.
- Classification
The classification algorithms used for sentiment analysis, where the model will be created.
- Sentiment Class
The Sentiment classes are Positive & Negative or can be different for different use case.
Word Cloud Generation
Word Cloud is nothing but the visual representation of the words that appears more times in a particular text. The bigger the word, the more it appeared, and vice versa.
Word Cloud gives us a proper understanding of how a particular word is related to the use case.
Word Cloud Generation for Uber

Word Cloud Generation for Ola

Algorithms
The algorithms used for understanding the sentiments using Deep Learning are
Non-Deep Feed Forward Neural Network

Deep Feed Forward Neural Network

Convolutional Neural Network (CNN)

Google Word2Vec
Google Word2vec is a better way to train the text to understand the vocabulary between different words. The NLP is advanced using different vocabularies, as the word2vec is two-layer which contains different words and the similarity between the words that help the particular text to understand the meaning in a much better way. The representation of google word2vec concerning the grids is shown below.

Deep Learning is used to understand Word2Vec in the best way possible.
Experiments
The experimental section of this research consists of various tests and results obtained by performing iterations. The steps involved in the sentimental analysis are: ➢ Data Gathering from Twitter using TwitterAPI ➢ The CSV file contains 3000 tweets for both datasets ➢ Getting sentimental score for every tweet ➢ Segregating the tweets in Positive & Negative ➢ For Positive == 1 & Negative == 0 ➢ Generating vocabularies for the words ➢ Partitioning the data into Train & Test of 2400 & 600 ➢ Performing various deep learning methods
Google Word2Vec Map


Formulas used for optimizing the network
The Weight Multiplication of Perceptron The perceptron has an input that has some input values and that is passed to the node with some assigned weight, which is added with the bias and passed to the activation function. The formula for every perceptron is shown below.

Activation Functions The values obtained from the multiplication of weights & addition of bias is giving to the activation function and there are different activation functions, the two used in this paper are ReLu & Sigmoid Activation Function.


Optimizers for Optimizing Outputs Optimizers are used to optimize the value with various iterations, there are different numbers of optimizers that can be used. The optimizer used for DNN is Adadelta. Adagrad optimizer was lacking due to an increase in the value of denominator that caused an increase in the learning rate, to overcome this effect Adadelta was used.

Loss Function The loss function used to handle the loss of the output is Binary-Cross Entropy Loss Function. Binary is used because the outputs are 0 & 1 respectively.

Models Created for Classification
Non-Deep Neural Network

The Non-Deep Neural Network was trained on a different interval to understand how that affected the accuracy of the majority of datasets. The model was trained for both the datasets of Uber & Ola respectively.
The accuracy obtained from Single Layer Neural Network along with loss

The accuracy for the interval of 500 datasets for NDNN

The table has the accuracies in percentage and it can be observed that for 500 datasets the accuracy generated was 87.00 % for Uber and 70.00 % for Ola. Ola had relatively less accuracy from the base datasets so it generated the highest of 81.88 % for 3000 datasets. The impact was having a mean accuracy of 92.99 % for the Uber datasets and that of Ola was 75.18 % which is 17.81 % less as compared to Uber.
Deep Neural Network

The Deep Feed Forward Neural Network was also used with the help of hyperparameter optimization to understand what numbers of hidden layers are required for the respective models. The number of hidden layers used for the deep learning model is 2-Hidden Layers with all the other parameters remaining the same. The epochs used in this model are also 20 as compared to the non-deep neural network with the batch size of 50.
The accuracy obtained from Multi-Layer Neural Network along with loss

The accuracy for the interval of 500 datasets for DNN

It can be observed that the base accuracy for the Uber datasets was 88.00 % and that of Ola datasets was 71.00 % and the highest accuracy generated for the Uber datasets was 96.33 % and of Ola was 82.05% that is not a significant increase in the accuracy as compared to that of a 1-Layer of a model. The increase in the Uber dataset as compared to the Non-Deep Learning Neural Network is 0.16 % and that of the Ola dataset is 0.17 %.
Convolutional Neural Network

There is a 1-embedding layer with a dimension of 300 and a number of words 2200, it is connected to 128 filters with the kernel size of 3,4,5 and the activation function used is ReLu. Max Pooling is also used to get the maximum values from the grid that is passed to the output layer with the activation function as Sigmoid.
The accuracy obtained from Convolutional Neural Network along with loss

The accuracy for the interval of 500 datasets for CNN

It can be observed that the minimum accuracy generated for the Uber datasets was 91.00 % and the Ola datasets were 65.00 % that is better than the accuracy of Non-Deep Neural Network and Deep Neural Network. The maximum accuracy generated for the Uber & Ola datasets is 96.00 % and 80.37 % which is close to the one from the other two models. The mean accuracy for the Uber datasets is 93.59 % and for the Ola, datasets are 74.42 %.
Conclusions
The data was trained with the help of deep learning algorithms to understand the sentiments in a much deeper way. Google word2vec was used to generate the vocabularies and make the words in datasets to get a proper understanding with the similar kind of words. Accuracy was calculated with all three models. The model that generated the best accuracy for the Uber datasets was the Deep Neural Network with the 2-hidden layers. The hyperparameter optimization gave the choice of using the 2-hidden layers which in turn was best suited for the Uber tweets. Similarly, the model that generated the best accuracy for the Ola datasets was the same Deep Neural Network with 2-hidden layers. It was observed that the accuracy for the Ola tweets was not that good as compared to the Uber because the tweets that were extracted had lots of text that was not in the proper format, though cleaning was done still it couldn’t generate the accuracy as expected. It was also observed that the CNN model was moderate concerning the DNA, which was questioning. Convolution Neural Network is better known for image processing still it was used to understand how it performed in the text analysis.
References
[1] Go, Alec, Lei Huang, and Richa Bhayani. "Twitter sentiment analysis." Entropy 17 (2009): 252.
[2] Sharma, Anuj, and Shubhamoy Dey. "A comparative study of feature selection and machine learning techniques for sentiment analysis." Proceedings of the 2012 ACM research in applied computation symposium. 2012.
[3] Kim, Yoon. "Convolutional neural networks for sentence classification." arXiv preprint arXiv:1408.5882 (2014).
[4] Severyn, Aliaksei, and Alessandro Moschitti. "Twitter sentiment analysis with deep convolutional neural networks." Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval. 2015.
[5] Wang, Bo, and Min Liu. "Deep learning for aspect-based sentiment analysis." Stanford University report (2015).
Before You Go
Research Paper: https://ieeexplore.ieee.org/document/9215429