Sentiment Analysis Using Neural Networks A New Approach
Sentiment Analysis Using Neural Networks A New Approach
So, for all these tweets an automated system can be created including (POS) of Speech tagger, the co-reference
which will analysis the review and extract the user percepts. resolution structure, the Named Entity Recognizer (NER)
Duncan and Y. Zhang proposed the neural network approach and many more. In the suggested structure, Stanford Core
for sentiment analysis on twitter [7] to develop neural NLP is used for classification of the input in the forms of
networks which can focus on providing polar views by aspects and expressions.
dividing the opinions in social media and websites having
customer reviews. It collects the reviews from websites and
divides them into positive, negative and neutral reviews. The 2. Part of Speech (POS) Tagging:
system used feed forward neural network. The neural network POS tagging [1] is a significant facet of MSP model
used is on MATLAB, using neural network toolbox. It reduces as it separates the sentence into aspects and expressions.
the input by removing the punctuations, single characters, stop POS tagging is completed using Stanford Core NLP. It is
words like and, to, the etc. and also mentions of other users a blend of tools required for POS tagging. Here, every
using the “@” symbol. word in the sentence is given a label according to its
grammatical context.
III. PROPOSED SYSTEM
Using the process flow diagram, we can explain the
working of this system. In the proposed system, the input
which consists of Twitter tweets is given to the aspect
expression extractor. This extracts pairs of aspect and
expressions from the supplied reviews. The sentiment pattern
extractor builds the entire potential morphological sentence Fig. 3: POS tagging using Stanford core NLP [15]
pattern using the generated pairs. These candidate patterns are
passed as input to the convolutional neural network which has In Stanford Core NLP, PRP denotes Preposition,
been pre-trained on an existing corpus. The output is the VBZ denotes Verb, NN denotes Noun, DT denotes
sentiment polarity of the input review. Determiner and according to the word in the corpus,
several other tags are assigned.
3. Aspect-Expression Pair:
The nouns in the sentence are termed as aspects and
the corresponding adjective in the sentence is termed its
expression. These aspects and expressions are then
collected together and a pair is formed titled as aspect-
expression pair as presented in the figure 4.
C. Tensorflow
TensorFlow is an open-source software library for
machine learning through a chain of tasks. It is a structure
for building and training neural networks to discover and
decrypt designs and links. TensorFlow was established by
Google, and was later open-sourced. It is still actively
maintained and is a second-generation system,
implementing the insights gleaned from the development
of its predecessors. This is the neural network
implementation that is used in the suggested structure.
D. Convolutional Neural Network
Convolutional neural networks are feed-forward
neural networks that are well-suited for image processing
and also for natural language processing. Originally
inspired by neuron organization in the visual cortex, they
have been very successful at both image recognition and
text analysis tasks. A CNN consists of an input and output
layer, with a certain number of hidden layers in between.
These hidden layers can be one or more of convolutionalal
layers, fully connected layers, normalization layers, or
pooling layers. CNNs are noted for needing relatively little
pre-processing in comparison to other algorithms, inferring
instead the features that would be hand-filtered through to
the algorithm. Convolutional neural network is made up of
neurons [6]. These neurons can have learnable values and
weights. Every neuron receives an input and works in a
flow.
Fig. 5: System Architecture
In this system, convolutional neural network is
trained with curtailed input of twitter tweets. Here, use of
conventional computers can be predictable as it has a fixed G. Stepwise Procedure of proposed system
way to find a solution but using neural network allows it to Step 1: Extraction of tweets from dataset
learn and generate results according to the ever changing
input [17]. Convolutional neural network is a good fit for a) Tweets are mined from the twitter dataset which
this system as it learns from the training set and can even includes 10,00,00 tweets.
produce results which is complex for humans to deduce. b) Random tweets are mined every time extraction is
E. Dataset processed.
In the proposed system, dataset [18] is used. The Step 2: Filtration and POS tagging
original dataset consisted of ~1.57 million tweets; only the
first 1,00,000 were used in the interest of keeping training a) Filtration is done by removing # tags, URLs,
time reasonable. It comprises mainly of tweets from the unwanted stop words like the, in, or etc.
Sentiment140 dataset, plus tweets from other assorted b) This is done using POS tagging, which labels each
sources. Here, random amount of tweets are positive and word in the text.
negative. 80% of tweets i.e. 80000 tweets are used for
training and 20% i.e. 20000 tweets are used for testing.
a) Neural network is skilled with the given dataset by In the present research, a technique to trim textual input to
forming a layered array. a convolutional neural network based on the morphological
b) The Neural network is trained using 80% of the given sentence pattern (MSP) model is presented. The focus is more
dataset. The remaining 20% tweets are then used for on general sentiment prediction rather than aspect-based
testing. prediction, and adapts the model accordingly. By trimming the
c) The GloVe embedding’s (25-dimensional) for input to the ‘most important’ words, sentiment-wise, the
Twitter are used to transform the words into matrix effectively preprocessed data is passed to the CNN for
form. training. This approach therefore can be considered to
Step 5: Checking the Polarity combine knowledge of the morphological structure of
sentences, with the inferring power of CNNs. In future work,
a) After passing through various layers of neural exploring the effect of various other combinations of part-of-
network, the value of each neuron is varied. At the speech tags and other grammatical structures, on prediction
end of all layers, the network reshapes and provides accuracy can be done.
with a value.
b) Once the entire process is completed, the ACKNOWLEDGMENT
probabilistic value is calculated for the given We would like to express a profound sense of gratitude
sentence. towards Prof. Tatwadarshi P. N., Department of Computer
c) The probability is then checked, if value is 0.5 or Engineering for his constant encouragement and valuable
above, it is denoted as positive or if it is less than 0.5 suggestions. The work that we have been able to present is
it is denoted as negative. possible because of his timely guidance and support.
[6] Y. Gao, W. Rong, Y. Shen and Z. Xiong, "Convolutional Neural [12] R. Hegde and Seema S., "Aspect based feature extraction and sentiment
Network based sentiment analysis using Adaboost combination," 2016 classification of review data sets using Incremental machine learning
International Joint Conference on Neural Networks (IJCNN), algorithm," 2017 Third International Conference on Advances in
Vancouver, BC, 2016, pp. 1333-1338. Electrical, Electronics, Information, Communication and Bio-
[7] B. Duncan and Y. Zhang, "Neural networks for sentiment analysis on Informatics (AEEICB), Chennai, 2017, pp. 122-125.
Twitter," 2015 IEEE 14th International Conference on Cognitive [13] K. Han, K. Youngsub, Y. Kim, and Jin-Hee Song, "Building Sentiment
Informatics & Cognitive Computing (ICCI*CC), Beijing, 2015, pp. 275- Lexicon for Social Media Analysis using Morphological Sentence
278. Pattern Model." Advanced Science and Technology Letters 136 (2016),
[8] M. Trupthi, S. Pabboju and G. Narasimha, "Sentiment Analysis on pp. 103-106.
Twitter Using Streaming API," 2017 IEEE 7th International Advance [14] S. Jebbara and P. Cimiano, “Aspect-Based Sentiment Analysis Using a
Computing Conference (IACC), Hyderabad, 2017, pp. 915-919. Two-Step Neural Network Architecture,” Communications in Computer
[9] K. Liu, Y. Niu, J. Yang, J. Wang and D. Zhang, "Product Related and Information Science, vol 641, 2016.
Information Sentiment-Content Analysis Based on Convolutional [15] “http://nlpforhackers.io/training-pos-tagger” last accesed on 10/01/2018.
Neural Networks for the Chinese Micro-Blog," 2016 International [16] “https://pythonspot.com/python-sentiment-analysis” last accessed on
Conference on Network and Information Systems for Computers 21/02/2018.
(ICNISC), Wuhan, 2016, pp. 357-361
[17] “https://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol4/cs11/report.htm
[10] D. V. N. Devi, C. K. Kumar and S. Prasad, "A Feature Based Approach l#Introduction” last accessed on 26/02/2018.
for Sentiment Analysis by Using Support Vector Machine," 2016 IEEE
6th International Conference on Advanced Computing (IACC), [18] “http://thinknook.com/wp-content/uploads/2012/09/Sentiment-Analysis-
Bhimavaram, 2016, pp. 3-8. Dataset.zip” last accessed on 25/03/2018.
[11] E. Anwar, E. Akib & T Ekram, et al. (2015). Localized twitter opinion
mining using sentiment analysis. Decision Analytics.