The most important task in aspect-based sentiment analysis (ABSA) is the aspect and sentiment word extraction
This work used belief maximization for the SVM model using spacy pipeline for aspect recognition and overall sentiment prediction. Pipelines are used to launch the spacy implementation and grant access to various properties. This makes model building process faster and easier since all the stages are bundled together into one unit process. The models are loaded into the pipeline. The package that contains language-related data offers a variety of models, including vocabularies, trained vectors, syntaxes, and entities. A wide range of document attributes, including tokens, token’s reference indexes, part-of-speech tags, entities, vectors, sentiment, vocabulary, etc., are output by these pipelines. The researchers evaluated these models on different tweets or reviews of different products and the results revealed that the SVM model outperformed the on hand algorithm in terms of aspect identification and overall sentiment prediction.
Spacy an open source Natural language processing library for python offers a clear API to access its machine learning-trained methods and properties
The process of opinion extraction and sentiment prediction from the online reviews plays an important role in business analytics. Texts from social networking sites like twitter gain much more importance due to the fact they reflect the current events. The architecture for sentiment analysis using Spacy pipeline is depicted in
The remaining section describes the proposed architecture in detail. The process of sentiment analysis starts with preparing the review database then processing pipeline is used for processing text. The output of processing pipeline is Doc object which is a sequence of tokens. The doc object is used to create documents with linguistic annotations and various natural language properties. The next step is extraction of opinion words and identification of word polarity. Finally the polarity of sentence is identified that makes the complete sense of sentiment.
This work is carried out using online tweeter data set. Firstly the reviews and ratings of different products and services are extracted from the most popular networking sites, twitter via Twitter API and then storing them into review database.
Spacy is an open-source NLP processing library for python particularly designed for production use and helps us to build applications that process large volumes of text efficiently. Spacy is implemented by creating pipelines and grant access to various properties which makes model building process faster and easier since all the stages are bundled together into one unit process.
When an nlp is called on a text, spacy first tokenizes the text to produce a Doc object. The Doc is then processed in pipeline components. Each component returns the Processed Doc, which is then passed on to the next pipeline component. This is referred to as Processing Pipeline. The diagrammatic representation preprocessing pipeline is shown in
Preprocessing in NLP consists of tokenization, Parsing, POS tagging, NER, chunking, Dependency Relations. These are explained below:
Tokenization is the process of dividing the text into its individual items known as tokens and ignoring space and punctuation marks. Spacy’s tokenizer takes input in the form of Unicode characters and produces results in the form of token objects. After creating the doc object (contains sequence of token objects) which uses preprocessing pipeline components and from this pipeline using sentencizer component sentence tokens have been accessed.
Using Spacy Preprocessing is done in order remove the unwanted text like URL’s, stop words, special characters, punctuation, numbers etc. This unwanted text add no value to text-understanding and cause algorithmic noise. As a result, this noise is removed in order to reduce feature space complexity.
|
|
|
|
|
Coordinating conjunctions |
|
Possessive pronoun |
|
Cardinal number |
|
Adverb |
|
Determiner |
|
Adverb, comparative |
|
Existential there |
|
Adverb, superlative |
|
Foreign word |
|
Particle |
|
Preposition or subordinating conjunction |
|
Symbol |
|
Adjective |
|
To |
|
Adjective, comparative |
|
Interjection |
|
Adjective, superlative |
|
Verb, base form |
|
List item marker |
|
Verb, past tense |
|
Modal |
|
Verb, gerund or present participle |
|
Noun, singular or mass |
|
Verb, past participle |
|
Noun, plural |
|
Verb, noun 3rd person singular present |
|
Proper noun, singular |
|
Verb, 3rd person singular present |
|
Proper noun, plural |
|
Whdeterminer |
|
Predeterminer |
|
Whpronoun |
|
Possessive ending |
|
Possessive whpronoun |
|
Personal pronoun |
|
Whadverb |
The
Consider the following example
In tagged sentence, canon (product feature) is tagged with NN, while as Good (adjective) is tagged with JJ.
Product features are generally NN so each NN is extracted from sentence.
ions the featuresexplicitlyimplicitlyExare mentioned directly by the reviewerImplicit features are those whmentioned directly by the reviewer. E.g.,Picture quality
Now consider another example,
In this review, the reviewer is talking about battery life but it is not directly mentioned in the sentence. So battery is implicit feature.
Opinions are generally JJ so every JJ is extracted from sentence. Opinions are divided into two types namely regular and comparative. An opinion which expresses a sentiment about a particular entity (aspect of the entity) is called a regular opinion. e.g., “HP laptop looks good” expresses a positive opinion on the look of HP.
While as an opinion which compares more than one entities based on some of their shared aspects, is called comparative opinion. E.g., “HP looks better than Acer” compares HP and Acer based on their look (aspect) and expresses a preference for HP. Opinions can also be categorized as direct or indirect. In the above sentences, picture quality is direct opinion while as battery life is indirect opinion.
Noun Phrase Identification: extracting all the Noun Phrases from the text using dependency, Parsing and POS tagging.
Phrase Classification: extracting all the Noun Phrases and classifies them into respective categories which are location, Names etc.
Entity Disambiguation: sometimes it is possible that the entities are misclassified. Hence creating a validation layer on the top of the result is very useful and the use of knowledge graphs can be plotted for this purpose. Popular knowledge graphs are the Google knowledge graph, IBM Watson, and Wikipedia.
This can be explained with the help of following examples:
Chunking basically means picking up individual pieces of information together and Grouping them into bigger pieces. The bigger pieces are known as chunk. Chunking is the basic technique used for entity detection, means grouping up of tokens.
The two most commonly used techniques used in chunking are NP-chunking, VP chunking.
Noun phrase chunking also known as NP- chunking is the process of searching for chunks corresponding to individual noun Phrases. NP-Phrase chunking of examples (1) can be represented graphically by the Phrase structured tree and grammar as shown in
Verb Phrase chunking also known as VP chunking is the process of searching for chunks corresponding to individual verb phrases. NP-Phrase chunking of example (1) can be represented graphically by the Phrase structured tree and grammar as shown in
The dependency parsing problem is to take the sentence as an input and produce the dependency structures as the output. A Dependency relation is a grammatical relation or a binary relation between a governor (reagent or head) and a dependent. Each dependency is a pair (h, m) where h is the index of a head word, m is the index of a modifier word. In the figures, a dependency (h, m) is presented by a directed edge from h to m. Root is a special root symbol. 0 is taken to be the root symbol. The relation dependencies can be graphically represented in different ways, i.e. with labels and without labels. Consider the following example.
The above representation can also be represented with the help of Dependency table. Dependency
|
|
|
|
|
|
|
|
I |
PRON |
PRP |
pronoun, personal |
nsubj |
x |
1 |
1 |
Like |
VERB |
VBP |
verb, non-3rd person singular present |
ROOT |
xxxx |
1 |
0 |
apple |
NOUN |
NN |
noun, singular or mass |
compo und |
xxxx |
1 |
0 |
iPhone |
NOUN |
NN |
noun, singular or mass |
poss |
xxxx |
1 |
0 |
‘s |
|
POS |
possessive ending |
case |
'x |
|
1 |
User |
NOUN |
NN |
noun, singular or mass |
compo und |
xxxx |
1 |
0 |
interface |
NOUN |
NN |
noun, singular or mass |
dobj |
xxxx |
1 |
0 |
The dependency relations of the above example is given below:
root(root-0, like 2), nsubj(like-2, i-1), dobj(like-2, interface-7)
compound(interface-7, user-6), poss(interface-7, iphone-4)
compound(iphone-4, apple-3), case(iphone-4, ‘s-5)
Where,
nsubj: nominal subject, dobj: direct object and poss: possession modifier
In this step firstly opinion words are identified and after that semantic orientation (Positive, negative and Neutral) of each opinion word is identified. An opinion sentences consists of one or more than one product features (NN) and opinion words (JJ).
In this step, the orientation of an opinion sentence is predicted. Consider the following sentence
“This picture quality of this phone is not bad”
The above sentence contains the opinion word “bad” which expresses negative opinion. But the sentence expresses negative opinion because of negation (not).
So, after finding the polarity of opinion word, it is necessary to find Opinion sentence Polarity. Also a list of negation words (no, not, but) can be prepared and negation rules can be formed.
The Data set for this experiment was gathered from the most popular social networking site twitter using twitter API. A total of 33,036 tweets were retrieved for this study from16 July 2022 to 16 Sept. 2022, but were only able to include 7570 tweets after data clean. In this stage, Spacy package of python is used to remove stop words, lemmatize and normalize the text from the obtained dataset. The labelled online Twitter data was subjected to sentiment analysis utilizing natural language processing. The data set contains tweets related to different products or services which are labelled as 1 for favorable and 0 for negative. The
About 7570 online tweets from the Twitter API are included in the data set; 4100 of these tweets were classified as favorable ratings and 3470 as negative tweets. Each individual tweet has been tokenized, filtered for stop words, vectorized, and preprocessed using the Python spacy package in order to make the data suitable for the machine learning model.
For implementing SVMS Machine learning model, Python Jupyter Notebook, NLP with spacy language model are used. Experiments are conducted using the Scikit, spacy and NLTK libraries. The
The data set is divided into training and testing datasets, which were used to train and test the machine learning model (support vector machine) and evaluate. Train test split is 80:20 where 80% of the data are used for training and 20% is used for testing.
|
|
|
|
Positive |
2595 |
1505 |
4100 |
Negative |
2000 |
1470 |
3470 |
Total |
4595 |
2975 |
7570 |
To evaluate the efficiency of this research, various measures were used, namely: accuracy, precision, recall and F1-Score. In this experiment, a twitter data set is taken that consists of reviews related to various products. So, these measures have been used in order to evaluate the relevance and irrelevance of the extracted features. Accuracy is a measure of how close the measured value is to the true value and is defined as the ratio of total number of correctly identified aspect polarities to the overall number of aspect polarities. Precision P is out of all positive predictions how many you got it right and is the ratio of correctly identified terms by the total terms while Recall R is out of all relevant predictions how many you got it right and is the ratio of correctly identified terms by the total identified terms. F1-Score, the most popular evaluation criterion and is the harmonic mean of precision and recall. There is a direct relationship between the F1-score and the value of Precision and recall and hence the value of F1-score will be high if the value of precision and recall are high and vice versa.
The formula for the above methods is as follows:
Accuracy = (TP+TN)/Total, Precision (P) = TP/ (TP+FP)
Recall(R) = TP/ (TP+FN), F1-Score = 2*P*R/ (P+R)
These measures were calculated using the confusion matrix which is shown in
|
|
|
|
True Positive (TP) |
False Positive (FP) |
False Negative (FN) |
True Negative (TN) |
The TP is the True positive, which means the relevant documents that are identified by the system. FP is the false positive, which means negative documents that are not relevant. FN is the false negative is the number of relevant reviews that the system failed to identify.TN is the true negative, relevant documents that are identified by the system.
This work compares the proposed SVMS model against the base classifiers. The results revealed that this model outperformed the other models in most of the cases. The performance evaluation with the help of accuracy, precision, recall and F1 Score is shown in
|
|
|
|
|
Proposed SVMS |
96% |
0.96 |
0.98 |
0.97 |
Logistic Regression |
95% |
0.96 |
0.94 |
0.95 |
Naïve Bayes |
94% |
0.97 |
0.92 |
0.94 |
Random Forest |
91% |
0.96 |
0.92 |
0.94 |
SVM |
92% |
0.95 |
0.91 |
0.93 |
The results showed that the proposed model SVMS shows better results than all other algorithms by having 96% accuracy which is 1% faster than LR, 2% faster than NB, 5% faster than RF, and 4% faster than SVM, 96% precision which is same as LR and RF, enhanced by 1% compared to SVM and shortened by 1% compared to NB, 98% recall which is enhanced by 4% compared to LR, 6% when compared to NB and RF, and 7% compared to SVM and 97% f1 score which is fastest among all the algorithms.
This work compares the proposed SVMS model against the existing models.
|
|
|
|
|
|
|
Logistic Regression |
78% |
0.78 |
- |
- |
|
RVVC- BoW RVVC-TF-IDF Hybrid NB-SVM |
93% 94% 87% |
0.91 - - |
0.85 - - |
0.88 - - |
|
SSentiA (SVM) |
77% |
0.77 |
0.77 |
0.77 |
|
Hybrid-SVM Hybrid LR |
92% 92% |
- - |
- - |
0.91 0.90 |
|
Fuzzy Logic |
85% |
0.95 |
0.91 |
0.93 |
Proposed SVMS |
96% |
0.96 |
0.98 |
0.97 |
The results showed that the proposed SVMS model outperforms well against the existing methods and provides better accuracy of 96%, 96% Precision, 98% Recall and 97% F1 score for aspects of different products.
In this study, an aspect based opinion analysis model is proposed which mines customer reviews and opinions and produce an aspect based opinion summary using linguistic annotations and dependency relations. A set of syntactic rules and relations is explored which were observed from twitter data set and effectiveness in the mapping of relationships between the aspect review and the corresponding opinions is demonstrated. Such type of analysis is useful in monitoring customer satisfaction levels regarding a particular topic, product or service, business analysis such as monitoring public opinions of companies, understanding how employees feel about their job and company and for decision makers or policy-makers for a country etc.
Various machine learning algorithms are used for classifying the reviews. After performing classification it was revealed that Proposed SVMS (support vector Machine with spacy) against the basic classifiers and existing models, it gives excellent results by having 96% Accuracy, precision 96%, recall 98% and F1-score 97%.
As the scope of future work, the efficiency of machine learning models can be improved by increasing the amount of data. For better results more feature engineering and deep learning approach is needed. In order to improve accuracy, various alternative optimization approaches, as well as different methods of data preprocessing, data normalization, is required for extracting more features from the dataset. And finally, this work shall be extended in order to implement it over neutral tweets and multi lingual.