|Intelligent Automation & Soft Computing |
Enhanced Sentiment Analysis Algorithms for Multi-Weight Polarity Selection on Twitter Dataset
College of Computer and Information Sciences, Jouf University, Sakaka, 72314, Saudi Arabia
*Corresponding Author: Ayman Mohamed Mostafa. Email: firstname.lastname@example.org
Received: 31 January 2022; Accepted: 20 March 2022
Abstract: Sentiment analysis is based on the orientation of user attitudes and satisfaction towards services and subjects. Different methods and techniques have been introduced to analyze sentiments for obtaining high accuracy. The sentiment analysis accuracy depends mainly on supervised and unsupervised mechanisms. Supervised mechanisms are based on machine learning algorithms that achieve moderate or high accuracy but the manual annotation of data is considered a time-consuming process. In unsupervised mechanisms, a lexicon is constructed for storing polarity terms. The accuracy of analyzing data is considered moderate or low if the lexicon contains small terms. In addition, most research methodologies analyze datasets using only 3-weight polarity that can mainly affect the performance of the analysis process. Applying both methods for obtaining high accuracy and efficiency with low user intervention during the analysis process is considered a challenging process. This paper provides a comprehensive evaluation of polarity weights and mechanisms for recent sentiment analysis research. A semi-supervised framework is applied for processing data using both lexicon and machine learning algorithms. An interactive sentiment analysis algorithm is proposed for distributing multi-weight polarities on Arabic lexicons that contain high morphological and linguistic terms. An enhanced scaling algorithm is embedded in the multi-weight algorithm to assign recommended weight polarities automatically. The experimental results are conducted on two datasets to measure the overall accuracy of proposed algorithms that achieved high results when compared to machine learning algorithms.
Keywords: Sentiment analysis; semi-supervised framework; multi-weight polarity algorithm; Arabic lexicons and automated scaling algorithm
Sentiment analysis is the mechanism and methodology for analyzing user attitudes and opinions toward services, products, and events. The role of sentiment analysis is to explore the user opinions and directions and then classify the polarity for each sentiment whether it is negative, positive or neutral . Different types of sentiment analysis are used to efficiently resolve and classify the user polarities based on the aspect, sentence, or document levels [1,2]. Sentiment analysis can be applied in a wide range of domains such as business intelligence, recommender systems, healthcare sectors, and provided services in cloud computing . The extracted data of sentiment analysis can contain different formats such as TXT, CSV, XML, HTML, JSON, or other media files . These formats should be preprocessed in order to generate feature extraction for each sentiment. Different feature extraction techniques can be applied to the selected data to analyze the polarity of sentiments such as polarity weight score and classification of orientation . Regarding the polarity weight score, each detected polarity is given a predefined weight score to identify the sentiment orientation. Different feature selection methods can be applied during the analysis of sentiment terms. These methods can be a unigram where only one term is used at a time, a bigram where pair of terms can be analyzed, and N-gram where a sequence of more than two terms is analyzed for verifying the orientation of each sentence . After applying the data extraction and feature extraction, the analysis process of sentiments is based on two main approaches: supervised and unsupervised methods . The supervised sentiment analysis uses machine learning algorithms are applied on training and testing datasets while the unsupervised sentiment analysis is based on generating a lexicon for obtaining the polarity terms along with their weights. The contribution of this paper is as follows:
• Building enhanced sentiment analysis lexicons for storing polarity terms with different orientations.
• Applying the created lexicons to the Arabic language as it contains high morphological and linguistic terms that are highly difficult to detect and analyze.
• Applying machine-learning algorithms on two labeled datasets from Twitter with different polarities.
• Provide a hybrid framework for merging supervised and unsupervised mechanisms for increasing the performance of the analyzed data.
• Developing a multi-weight polarity algorithm for analyzing polarity sentiments with different weights.
• Providing a scaling mechanism for distributing the overall polarity of the sentiment according to the provided algorithm.
• Enhancing an automated recommender algorithm for tracing the scaling of each polarity and distributing the recommended polarity weight according to the detected word terms and polarity terms.
2 Literature Review
Sentiment analysis models and applications have increased in an accelerated way due to the spread of social networks and online shopping websites. In this section, a comprehensive review of recent sentiment analysis research is provided. Recent sentiment analysis researches that are conducted using supervised and unsupervised approaches are proposed with major models, frameworks and mechanisms.
2.1 Supervised Sentiment Analysis
Supervised sentiment analysis is based on creating a corpus for sentiments and terms along with their polarity. The collected dataset is split into training and testing datasets where the training dataset must be labeled to train the classifier. As presented in , a sentiment analysis approach is applied on Arabic social media datasets where a corpus is manually built. A set of machine learning algorithms are applied to the training and testing datasets to identify the accuracy of the proposed approach. As presented in , a sentiment analysis mechanism is proposed for processing sentiments from learning and teaching datasets. A feature selection is applied to the processed data by creating four models and a sentiment classification using a support vector machine (SVM) algorithm is implemented to provide the accuracy of the models. As shown in , a Naïve Bayes (NB) classifier is applied to Arabic tweets by performing term frequency techniques. The polarity of the tweets is classified by dividing the testing datasets into five partitions. Another sentiment analysis mechanism is applied using SVM for classifying text datasets . The results are tested on five rounds and the average performance is measured. As presented in , a sentiment classification is applied using different machine learning algorithms and the performance of the machine learning algorithms is measured.
An automatic classifier is presented in  that merges both lexicon-based and machine learning algorithms. In this research, the dataset is collected and preprocessed and a lexicon is created using Senti-Word-Net. The authors of  applied term frequency to classify the sentiment polarity of the dataset. The dataset is divided into training and testing labels to measure the performance of machine learning techniques. Feature extraction methods are defined with sentiment analysis methods as proposed in . An evaluation of the methods of feature extraction is provided with different dataset domains. As presented in , SVM and NB techniques are applied to the E-commerce dataset for classifying customer preferences. The accuracy of the machine learning techniques is measured where NB achieved higher accuracy than SVM.
One of the recent research methods for analyzing sentiments is presented in  where a large-scale dataset of text and images is provided for classifying the orientation of sentiments. The polarity prediction for text, image and multimodal is applied on different dataset domains and the average accuracy for each aspect is determined. A recent sentiment analysis research is proposed in  where the LSTM is applied as a deep learning algorithm on a large dataset from Twitter. The LSTM is used to measure the performance of the dataset and the validation of data is processed using different machine learning algorithms. As presented in , a deep learning mechanism using LSTM is applied to explore sentiments automatically based on a predefined dictionary. Another deep learning mechanism is applied to social media dataset for analyzing sentiments automatically . This research provided a framework that performs a preprocessing for data using different deep learning models. The authors of  perform a classification process based on both deep learning and machine learning algorithms. Both methods are applied to the preprocessed dataset and the efficiency is measured to explain the best results. As presented in , a hybrid model based on Bi-LSTM and Convolutional Neural Network (CNN) is applied on short sentiments. This model aims to classify sentiments by extracting features from training datasets. Although a deep learning algorithm is merged with CNN to analyze sentiments more effectively. The same algorithms of LSTM and CNN are compared in  to measure the performance and accuracy of analyzing sentiments retrieved from movie ranking evaluations. The dataset is formalized according to the mechanism of each algorithm.
An aspect-based sentiment analysis model is presented in . In this model, the aspect is applied based on the category of the term of the sentiment where the sentiment polarity can contain different orientations according to the aspect of the dataset. Genetic algorithm is also a new applied methodology on sentiment analysis as proposed in  where the sentiments are classified and labeled into 5-weight orientations. A lexicon is created to rank sentiments that are near to the target word and the results of this model are considered relatively average. One of the recent researches in sentiment analysis is presented in  where Hidden Markov Models (HMMs) are used to predict hidden sentiments in the text. The authors aimed to provide different architectures of HMM for training and testing sentiments.
2.2 Unsupervised Sentiment Analysis
In unsupervised sentiment analysis, the dataset is not assigned to any labels for training and testing like supervised sentiment analysis. On the contrary, a lexicon is created automatically or manually for obtaining datasets with different n-grams and weights. As presented in , an Arabic sentiment analysis lexicon is created by assigning a score for each Arabic term with its corresponding term in the English language. Each term is classified according to its polarity and the polarity score is added to each term to define the orientation of the sentence. A framework for sentiment lexicon is created for determining the polarity of each term by assigning a score for each polarity term . The difference in this research from the previous one is that the lexicon is created using Hadoop for storing the sentences. A model is created to define the label for each sentiment based on a recursive neural tensor network (RNTN) to compare its accuracy with the applied lexicon. Another sentiment analysis framework using Hadoop is presented in  where the dataset is collected from Twitter social media. The data is cleaned, preprocessed and finally labeled for classifying sentiments. As explained in the research papers [29–32] different lexicons are created to provide a dictionary for sentiments along with their polarities. The authors of  constructed a lexicon for topics and sentiments where each word in the sentiment can obtain different polarities according to its meaning in the topic. The authors of  created a sentiment lexicon dictionary for the Malay language that stores each term and its polarity in English with its corresponding meaning in Malay. The results of the research provided a challenging accuracy. As presented in , a lexicon dictionary is created for enlarging the size of terms and their polarities. The dataset is collected from user reviews of movies and each term is classified to positive or negative polarity only. As shown in , a traditional method for creating a dictionary is proposed for storing polarity sentiments after performing the preprocessing step for removing stop words and slang terms.
As shown in , a sentiment dictionary is created based on two lexicons. The first lexicon is used to store and detect negative polarities while the second lexicon is used to classify the remaining sentiments. Other sentiment analysis dictionaries are proposed in  but based on Chinese text. Different weights are given based on the degree of polarity in order to increase the accuracy of the lexicon. The experimental results are conducted using supervised machine learning techniques to validate the accuracy of the sentiments. Another Chinese lexicon is proposed in  based on E-commerce customer reviews but the analysis process was conducted using deep learning techniques. As presented in , an augmented lexicon is created based on specific terms and words for classifying the orientation of polarities. The authors started their framework by building a lexicon and performing preprocessing on the data collected from different reviews. Another sentiment lexicon but for the Arabic language was presented in . The lexicon is created by inserting each term in the lexicon and embedding letters to the term such that the term still obtains the same meaning. A 4-weight is applied to the created lexicon to explore the polarity for each term.
Enhanced methodologies in sentiment analysis are proposed in [38–40]. These research papers explore state-of-the-art methodologies and models in sentiment analysis. As presented in , a sentiment analysis model is generated by collecting reviews from different songs and lyrics from YouTube. The degree of agreement is determined based on the classification of data that are related to the same aspect. As shown in , a sentiment analysis model is created for classifying topics and sentiments based on their polarity. Each sentiment is assigned with a score and the overall results are compared to traditional supervised methods. The authors of  applied sentiment analysis but on the reviews related to the COVID-19 pandemic. The accuracy is measured in each social media platform and is compared with other platforms.
2.3 Automated Sentiment Analysis Models
As proposed in our papers [41,42], automated sentiment analysis is applied for analyzing sentiments based on a predefined lexicon. The main objective is to create a lexicon that obtains Arabic linguistic terms from different domains and then analyze these sentiments to measure the accuracy. As presented in , a multi-weight lexicon is created for analyzing Arabic sentiments. The lexicon is created using different classical and slang Arabic terms and the data cleaning is applied for removing stop words and objective terms that do not have polarity. Our paper is extended in  for performing exceptional negation methodology on Arabic terms. Most research papers applied negation terms as a traditional method where the negation term must precede the polarity term to inverse the orientation weight value.
As shown in , a sentiment analysis method for analyzing terms is applied. The proposed mechanism is based on a sentiment graph for categorizing the polarity of each term. Another sentiment analysis method based on topic modeling is presented in  where each sentiment is classified based on its topic. Each topic is manually labeled using a dictionary that measures the false positive rate for each topic. Another automated method for analyzing user comments is presented in  where user reviews are classified into four dimensions. The sentiment polarity is analyzed based on the dimensions to determine the accuracy percentage for each dimension. In supervised mechanisms, the labeled data is considered a time-consuming method due to the manual annotation of data. The authors of  created a lexicon for storing polarities and their orientations. Different algorithms are proposed for scoring terms and polarities.
2.4 Sentiment Analysis Mechanisms and Frameworks
The developed mechanisms and frameworks in sentiment analysis provide a comprehensive view of sentiment architectures and the methods of processing datasets. In addition, the analysis mechanisms that classify data are also identified. As presented in , a hierarchical framework for analyzing sentiments about COVID19 is developed. The dataset is collected from users’ opinions about the virus and a hierarchical tree is proposed for extracting features of data. As proposed in , a fast LSTM model is applied for analyzing text sentiments. The proposed model is inherited from the LSTM model where the data is divided into five parts. Four parts are used for training while the last part is used for testing. The accuracy is conducted between different machine learning techniques and the fast LSTM that achieved high accuracy. Another framework is proposed in  that acquires datasets, extracts sentiments, and classifies sentiments. Different machine learning techniques are used for measuring the accuracy of sentiment polarities. As shown in , a survey is established for measuring the attitude about a specific domain and then the score is given to this attitude.
One of the promising ideas for extending sentiment analysis mechanisms is to review the orientation of polarities on security models on medical datasets. This can increase the robustness of proposed algorithms and provide a clear vision of the capabilities of the enhanced methods. As presented in , a watermarking algorithm is applied for embedding and extracting watermarks. The proposed algorithm is conducted on MRI image datasets that achieved high performance. The authors of  maintain the protection of privacy by applying a reversible watermarking scheme on medial audio datasets.
3 Comparative Analysis of Sentiment Analysis Mechanisms
Based on the previous evaluation of sentiment analysis methods and research methodologies, most of the presented mechanisms and applications fall within the scope of supervised, unsupervised and deep learning mechanisms where the dataset is classified and analyzed based on the detected polarity weight. Each detected term must have a polarity that expresses the orientation of user preferences to evaluate the overall polarity of the sentence or the document. As presented in Tab. 1, some research methodologies used only positive and negative polarities while most of the presented research papers used a 3-weight polarity that contains positive, negative and neutral orientations. The proposed table summarizes the objective, dataset language, polarity weight and applied mechanisms.
As presented in Fig. 1, a summary for multi-weights distribution is provided to explain the relationship between supervised and unsupervised mechanisms with different weights of terms and polarities. As explained, the supervised mechanisms are concentrated on both 2-weight and 3-weight. Using unsupervised mechanisms, most conducted experiments are used on 3-weight with 64.7% while 23.5% of experiments are applied on 2-weight. Semi-supervised mechanisms that apply both supervised and unsupervised are distributed on 3-weight, 4-weight and multi-weight with 57.14%, 14.28% and 28.58% respectively. Finally, deep learning algorithms are applied on only 2-weight and 3-weight with 41.67% and 58.33% respectively.
4 Data Preprocessing
The improvements of services in many sites and platforms depend mainly on the opinions of user reviews. These reviews are distributed in several languages where the dataset is collected and extracted to perform the analysis process. The Arabic language is one of the most widely used languages that contains high morphological and linguistic terms that are difficult to extract and analyze. Data preprocessing is used as a first step for cleaning data and removing unnecessary terms. The classification of subjective-objective sentences is the first step in data preprocessing. The subjective sentences contain polarity terms that express the attitudes and orientations of users. These polarity terms will be extracted and analyzed. The objective sentences are based on real facts and do not have any polarity terms to be analyzed. After performing the discrimination process, the following steps are executed:
4.1 Stop Words Removal
In this step, insignificant terms that do not affect the analysis process are eliminated. The pronouns “and – or” that mean “أو – و” are eliminated. The most widely used preposition terms such as “above – under –across – after – before – into – on – of” that mean “من – على – في – قبل – بعد – خلال – تحت - فوق” respectively are also eliminated. The adverb terms such as “always – sometimes – never – generally – often” that mean “غالبا – عموما – أبدا – أحيانا – دائما” respectively are also eliminated. The elongation terms are also preprocessed by removing recurring letters in the word such as “أهلاااااا” will be converted to “أهلا” that means “Hello”.
4.2 Irony Detection
The irony detection process is used to remove terms that may obtain different polarities whether positive or negative. Irony detection is considered critical for sentiment analysis processes as the terms can obtain confusion meaning that may affect the accuracy of the sentiment orientation. This paper provides automated multi-weight polarity algorithms that contain separate lexicons for storing positive, negative, neutral, negation and irony terms. These terms can affect the sentiment analysis of the sentence and the overall document. For example, the terms “!يا سلام! – يا راجل” that mean “Hey. Man! – Oh. Yeah!” with exclamation mark may obtain negative or positive orientation.
4.3 Negation Terms
As presented in our paper , the negation terms and exceptional index are applied to the dataset. During the lexicon construction, negation terms are added to the lexicon. Once the polarity term is detected with a negation term precedes it, the orientation of the term will be inversed. In addition, the exceptional negation index is applied to trace the negation terms even if they do not precede the polarity term immediately. By applying both negation methods, the accuracy of polarity detection will be improved.
5 Sentiment Analysis Mechanism for Multi-Weight Polarity Selection
Based on the presented comparative analysis, it is clear that sentiment analysis is considered a challenging analysis method, especially in Arabic sentiments due to the high morphological linguistics. In addition, the mechanisms of analyzing data contain some difficulties. Supervised mechanisms apply machine-learning algorithms that achieve moderate or high accuracy but the manual annotation of data is considered a time-consuming process. In unsupervised mechanisms, a lexicon is constructed for storing polarity terms where the accuracy of analyzing data varies based on the size of the dataset. This paper applied a semi-supervised mechanism where a lexicon is constructed for storing large polarity terms and the dataset is labeled for analyzing the sentiments using machine-learning algorithms.
5.1 Dataset Collection
The dataset in this paper is collected from two sources. As presented in Tab. 2, the first dataset is manually collected from different platforms of Twitter. The second dataset is collected from GitHub  contains a labeled dataset. Both datasets are labeled based on a 3-weight polarity that contains positive, negative, and neutral sentiments. The datasets are analyzed based on 3-weight polarity then the multi-weight polarity algorithms will be adapted to the datasets to analyze the performance.
5.2 Lexicon Construction
Based on the collected datasets, four lexicons are constructed for storing negative, positive, neutral and irony terms while the fifth lexicon is used to store negation terms. During the sentiment analysis, if a negation term is detected, the polarity term will be converted to its inverse meaning. Each sentence in the dataset is traced using the constructed lexicons and the datasets are analyzed based on two methods:
• Lexicon programming method: in this method, the word terms and polarity terms are identified and detected. The positive terms and negative terms are counted then the percentage of both positive and negative terms are calculated. The percentage of each polarity is then measured to verify the overall orientation of each sentence.
• Machine learning method: different machine learning algorithms are applied to the labeled datasets to measure the accuracy of training and testing datasets. In this paper, the machine learning algorithms for 3-classes with positive, negative and neutral terms. The experiments are executed again for 2-classes with only positive and negative to measure the effect of neutral terms on the overall accuracy. Both methods will be discussed in detail in Sections 6 and 7.
5.3 Proposed Polarity Selection Framework
The proposed sentiment analysis framework is based on two parallel methodologies for measuring the accuracy and recommending the appropriate polarity weight based on the labeled dataset. The two datasets that are selected in Section 5.1 are applied on two paths. As presented in Fig. 2, the first path uses a lexicon-based method where a dictionary or lexicon is generated for storing polarity terms. A tracing mechanism is applied after data preprocessing for counting word terms and polarity terms ). The percentage of positive and negative polarities are identified for each sentiment term for scaling each sentence to the recommended polarity weight. The second path uses machine-learning algorithms based on the binary, count, and TFIDF approaches.
The binary approach traces each polarity term and verifies whether it is present in the sentiment or not. The counting approach is used to count the polarity terms for identifying sentiment terms that contain more polarity terms. The term frequency-inverse document frequency (TFIDF) scores each detected polarity based on its frequency in the sentiment terms . After executing both methods, the accuracy is measured based on the multi-weight polarity distribution algorithm.
6 Proposed Algorithms for Multi-Weight Polarity Sentiments
Based on our presented comparative analysis of sentiment analysis mechanisms, most of the conducted research methodologies use only 2-weight scaling for positive and negative sentiments or 3-weight scaling for positive, neutral and negative sentiments. Applying multi-weight polarity selection on sentiments, especially in the Arabic language is considered a challenging methodology due to the high difficulty in analyzing morphological terms that may obtain different polarity orientations. In addition, using multi-weight polarities on Arabic sentiments can increase the accuracy of polarity prediction on new sentiments. The process of applying multi-weight polarity is based on two major algorithms. Algorithm 1 is based on distributing the multi-weight polarity manually based on the percentage of detected positive and negative polarities while Algorithm 2 is based on an automatic distribution of multi-weights for recommending the appropriate weight based on the sentiment length and the polarity terms .
As presented in Algorithm 1, the identification of multi-weight polarity is verified by adding the datasets that contain sentiments terms . After performing the data-preprocessing step, the sum of word terms and polarity terms in each sentiment is measured. The minimum and maximum word terms and polarity terms are identified based on Eq. (1):
where refers to the positive polarity, refers to the negative polarity and refers to the neutral polarity.
The scaling process for a 3-weight polarity is presented in Fig. 3. In each sentiment , if the percentage of positive polarity is greater than the percentage of negative polarity , the orientation will be positive and vice versa. If both values are equal, the orientation will be neutral.
As presented in Fig. 4, the scaling process for a 5-weight polarity is divided into 5 parts and the percentage of both and are identified according to detected polarity terms in Algorithm 1.
The 7-weight polarity scaling is applied for any sentiment that may contain more detected polarity terms that need more intensification weights due to the large number of linguistic terms and their diversity. As shown in Fig. 5, the scaling line is divided according to Algorithm 1.
Given a sentiment term and a polarity term , the percentage while the percentage . Using the 3-weight polarity where , the falls in the “positive” scale. Using the 5-weight polarity, the falls in the scale with a “high positive” while using 7-weight polarity, the falls in the scale with a “more positive” polarity. As a result, the same detected polarity will obtain different orientation according to the scale distribution.
Algorithm 2 provides an alternative and advanced method for distributing polarity weights automatically. The core objective of this algorithm is to store the datasets with sentiment terms in the generated lexicons. The maximum and minimum word terms and polarity terms are identified accordingly. For distributing the appropriate polarity weight, intermediate points are identified for both and based on Eqs. (2) and (3):
where: is the intermediate point for distributing word terms and is the intermediate point for distributing polarity terms. Algorithm 2 is used to specify the recommended weight scale as defined on Algorithm 1 automatically by measuring lengthy sentiments that acquire more polarity weight. Lengthy sentiments, especially in the Arabic language contain more polarity terms that should be analyzed more efficiently using the appropriate weight scale. Based on Algorithm 2, the optimal weight is identified automatically based on and that fall in the specified weight scale. As a result, the recommended weight is identified for increasing the efficiency of analyzing sentiments.
7 Experimental Results
The experimental results of the proposed multi-weight polarity algorithm are conducted on both datasets for measuring the performance and accuracy of the algorithm as explained in Tab. 3. The proposed algorithm is compared with logistic regression (LR) , support vector classifier (SVC) , random forest (RF) classifier , Ada boost classifier , K-nearest neighbor (KNN) , extreme gradient boosting (XGB) , extra trees classifier , gradient boosting classifier , and Gaussian NB . These classifiers are conducted based on two and three classes for measuring the performance in each one. The datasets are split into 75% for training and 25% for testing.
Firstly, the proposed multi-weight polarity algorithm is adapted to 3-classes to be compatible with the labeled datasets of the machine learning classifiers. The experiments are conducted again with only 2-classes: positive and negative without neutral sentiments. In neutral sentiments, the number of positive and negative polarities are equal in the sentiments that cause overhead on measuring the accuracy in the same sentiment. Fig. 6 presents the accuracy of the first dataset on both classes. The LR classifier algorithm achieved the highest accuracy of machine learning classifiers with 63% and 70% on 3-classes and 2-classes respectively while the proposed multi-weight distribution algorithm achieved 98.53% and 98.82% on 3-classes and 2-classes respectively. As presented in Fig. 7, the accuracy of the second dataset is measured in both classes. The second dataset is considered a large dataset when compared with the first dataset. As a result, the performance of the classifiers is increased. The XGB classifier algorithm achieved the highest accuracy of machine learning classifiers with 79% and 85% on 3-classes and 2-classes respectively while the proposed multi-weight distribution algorithm achieved 98.61% and 98.89% on 3-classes and 2-classes respectively. As presented in Fig. 8, the average performance of the multi-weight polarity distribution algorithm explained the performance on the 3-classes for positive, negative and neutral polarities and the 2-classes for only positive and negative polarities.
The results are conducted using the binary, count, and TFIDF machine learning approaches. Each approach achieved different accuracy according to the machine-learning algorithm. The average performance of the approaches is compared with the average performance of the proposed multi-weight distribution algorithm on the two and three classes. As presented in Fig. 9, the machine learning algorithms on 3-classes achieved the lowest performance on both datasets with 55.96% and 73.26% respectively. Using only 2-classes the performance is increased to 62.3% and 80.15% on the first and second datasets respectively. The performance of the proposed algorithm in both classes achieved high accuracy especially on the 2-classes due to the elimination of neutral polarities that may affect the orientation of the sentiment. In the first dataset, the achieved accuracy recorded 98.53% and 98.82% using 3-classes and 2-classes respectively. In the second dataset, the achieved accuracy recorded 98.61% and 98.89% respectively.
The created lexicon in this paper is optimized for applying Algorithm 2 to automatically recommending the appropriate weight based on the word term and polarity terms in each sentiment . Based on the conducted datasets with 5025 subjective sentiments, the recommender algorithm on the lexicon stated the following results as shown in Tab. 4:
• , if the word terms are low and the detected polarities are low, the recommended polarity weight will be a 3-weight.
• , if the word terms are high and the detected polarities are low, the recommended polarity weight will be a 3-weight due to the decreased percentage of polarities in a lengthy sentiment.
• , if the word terms are low and the detected polarities are high, the recommended polarity weight will be a 5-weight due to the diversity of polarities in a short sentiment.
• , if the word terms are high and the detected polarities are high, the recommended polarity weight will be a 7-weight due to the diversity of polarities in a lengthy sentiment.
Based on the distribution of polarities and the recommended weights in both datasets, Fig. 10 summarizes the percentage of weight distribution where the 3-weight recorded 65.34% and 54.19% on the first and second datasets respectively. The 5-weight recorded 18.19% and 24.88% on both datasets while the 7-weight recorded 16.47% and 20.93%. From the results of Fig. 8, we conclude that the larger the dataset as in the second dataset, the distribution of multi-weight polarities becomes clearer.
Sentiment analysis is considered a challenging direction due to the difficulty in obtaining and analyzing sentiments, especially in the Arabic language that contains complex linguistics. This paper provides a comprehensive evaluation of recent research to explore the applied mechanisms and polarities. A framework is applied using lexicon-based and machine learning algorithms by using count, binary and TFIDF approaches that are applied on two and three classes to measure the accuracy on two Arabic datasets that contain different lengthy sentiments and linguistic terms. The results showed high performance on the proposed algorithm for detecting polarities and distributing multi-weights effectively. An improved algorithm for recommending and assigning multi-weights automatically is added to the distribution algorithm for speeding up the analysis process without user intervention. Future directions on this research will be directed on measuring the accuracy of the distributed multi-weight polarities on Arabic datasets with slang or colloquial terms that are widely used in social media platforms. This can obtain a wide vision of the major characteristics of the proposed algorithms.
Funding Statement: This work was funded by the Deanship of Scientific Research at Jouf University under Grant No. (DSR-2021-02-0102).
Conflicts of Interest: The author declares that there are no conflicts of interest to report regarding the present study.
|This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.|