Abstract
Social media platforms, namely Instagram, Facebook, Twitter, YouTube, etc. have gained a lot of attention as users used to share their views, and post videos, audio, and pictures for social networking. In near future, understanding the meaning and analyzing this enormously rising volume and size of online data will become a necessity in order to extract valuable information from them. In a similar context, the paper proposes an analysis model in two phases namely the training and the sentiment classification using the reward-based grasshopper optimization algorithm. The training architecture and context analysis of the tweet are presented for the sentiment analysis along with the ground truth processing of emotions. The proposed algorithm is divided into two phases namely the exploitation and the exploration part and creates a reward mechanism that utilizes both phases. The proposed algorithm also uses cosine similarity, dice coefficient, and euclidean distance as the input set and further processes using the grasshopper algorithm. Finally, it presents a combination of swarm intelligence and machine learning for attribute selection in which the reward mechanism is further validated using machine learning techniques. The comparative performance in terms of precision, recall, and F-measure has been measured for the proposed model in comparison to existing swarm-based sentiment analysis works. Overall, simulation analysis showed that the proposed work based on grasshopper optimization outperformed the existing approaches for Sentiment 140 by 5.93% to 10.05% SemEval 2013 by 6.15% to 12.61% and COVID-19 tweets by 2.72% to 9.13%. Thus, demonstrating the efficiency of the context-aware sentiment analysis using the grasshopper optimization approach.
Introduction
Social Media platforms have been widely popular among every category of user around the world [1]. Social activists, media analysts, celebrities, sports persons, separatists, politicians, beurocrats, and who not uses social media platforms like Instagram, Facebook, Snapchat, Daily, Twitter, and a lot of other social media platforms [2]. Out of these platforms, Twitter and Facebook have two different sets of users, and being a discussion forum rather than just being a social media platform, Twitter is more popular among the enthusiasts of the social media platform to analyze sentiments using recent techniques [3]. Being a discussion forum, sometimes one tweet posted against a topic may have a lack of retweets and replies and they put a tremendous amount of pressure if the story is sensitive. It has been observed in India, that being one of the biggest democratic countries of the world, elections have always been found to be affected due to sagas of retweets in favor and against political parties [4]. It is not also hidden from the modern world where news spreads like anything around the world, leaks about the relative president in the US elections over Twitter have changed the perception of the voter about the fighting [5]. Prior to and post to attack Ukraine by USSR raised substantial emotion in favor of the people of Ukraine [6]. Students from around the world posted tweets and videos on socialmedia platforms that compelled the concerned governments to take prior action. As a result, thousands of students were saved, and unfortunately, some of them were killed.In inclusion to this, social media platform has also become a center where users share their views related to a product of their choice that helps bring change to the company policy or architecture, or design of the product [7]. It is quite obvious that organizing a survey of such kind is not feasible due to cost factors and hence social media platforms are widely used in such kinds of promotions and discussions about the product by several companies including Google, Facebook, YouTube, One-Plus, Samsung, SmartTech Technologies, etc. [8, 9]. The analysis of context and its effect has attracted the attention of researchers in the last couple of years [10]. The evidence of the interest is presented in the literature that presents the context analysis models for extracting sentiments, especially from the posted tweets [11]. Utilization of machine learning algorithms and optimization techniques such as latent semantic analysis (LSA), Principal Component analysis (PCA), Genetic Algorithm, and Spider Monkey optimization have been often observed when it comes to training a system for classification [12–14]. An analysis model involves two phases namely the training and the sentiment classification (SC). The training architecture involves the data being trained along with the ground truth of the data [15]. In the case of context analysis of the tweet, the ground truth will be the emotion of the tweet that has to be processed [16]. As shown in Fig. 1, the raw data is passed to pre-processing phase in which stop words like is, the are removed followed by removal of punctuation marks, and tokenization are involved.

General training and classification architecture for sentiment analysis.
The tokenization is required to convert the textual data into a numeral form that can be processed further. The tokenized data is passed to attribute or attribute set selection. One keyword in the case of text data can be considered as one feature for the related segment. As shown in Fig. 1, the pre-processed data is passed to attribute or attribute set selection, and one set of attributes will be referred to as an attribute set.
There are two types of possibilities of implementation in the attribute or attribute set selection namely by natural computing and by Swarm Intelligence (SI) such as Particle Swarm Optimization (PSO) to select the lexicon words [17]. However, some focused on improving collaborative filtering using the lexicon-based analysis of sentiments [18]. Practitioners use the cat optimization algorithm for feature selection with long short-term memory (LSTM) [19]. SI has been utilized for the selection of attributes and attribute sets for the last couple of years. Specifically, Hybrid Filter–Wrapper for sentiment analysis had been used to select the features [20]. These studies have motivated the authors to present a model which is inspired by the outstanding performances demonstrated by both swarm intelligence as well as machine learning techniques.
Thus, the proposed work has presented a model which combies the strengths of both SI and machine learning concepts that led to the following contributions.
A reward mechanism is introduced based on the concept of SI for attribute selection.
A new fitness function is introduced for optimal selection.
The reward mechanism is further validated using machine learning methods to justify the success of the present research.
The rest of the paper is organized in the following manner. Section 2 illustrates the related work which incorporates the usage of SI in the feature selection and optimization process and also for the attribute set selection process. The proposed work is illustrated in Section 3 where the proposed modified grasshopper algorithm is explained. Various validation scenarios have been also presented and described in the same section. The evaluation of the results based on the quantitative parameters is shown and described in Section 4 viz. the results and illustration section. The paper is concluded in Section 5 which describes the overall outcome of the research article.
The social media platform is a center where the users share their views related to a product and that helps bring change to the company policy and design of the product. Social media largely impact the sentiments of the user, and thus SC is vital. In the literature, there are several techniques developed to analyze the sentiments of the user. Further, the literature is found highly motivated by the strengths of swarm intelligence techniques and machine learning approaches,and several hybrid approaches combining the two were proposed. A handful of them are also discussed in this section.
Yuvraj and Sabari 2017 proposed a sentiment classification algorithm using the feature selection techniques such as Naïve Bayes, KNN, etc. The proposed methodology presented a hybrid of swarm intelligence and machine learning that included the shuffled frog algorithm as a swarm intelligence technique to extract the features. Further, machine learning was applied using Radial Basis Function (RBF) technique considering the 1325 positive Twitter corpus and 875 negative datasets. Further, the authors used the feature selection technique using the information gain and GA. The results of the different classification algorithms were compared to measure the accuracy, and precision for positive and negative opinions, and the same for the F-measure. The outcomes show that the proposed technique was improved by 1.37% for the RBF classifier considering the positive sentiments and negative sentiments, F-measure was improved by 1.86% [21].
Pandey et al. 2017 presented a Twitter sentiment analysis work that was inspired by the behaviors of cuckoos. The tweets were preprocessed to improve the further processing steps. The combination of k-means and the cuckoo search method was used as an approach to present a metaheuristic-based clustering method for the classification of sentiments. The efficiency was tested against a number of approaches such as differential evolution, particle swarm optimization, gauss-based cuckoo search, etc [22].
Zainuddin et al. 2018 performed a finer-grained analysis for sentiment analysis on Twitter. By using a feature selection technique, a novel hybrid SC for Twitter had been offered. This research had been compared the classification accuracy of the PCA, LSA, and random projection (RP) feature selection approaches. Moreover, the hybrid SC was validated using Twitter datasets to represent various domains, and the evaluation of the proposed approach had been done with various classification algorithms indicating that it yielded relevant findings. The outcomes show that classification accuracy was improved by about 77% in comparison to other SC techniques [16].
Lee et al. 2018 categorize the overall sentiment analysis by identifying the main terms that contributed to the classification, in order to optimize the usefulness of sentiment analysis results. Most sentiment analysis datasets, on the other hand, merely provide the sentiment label for each text or sentence. To put it another way, there is a scarcity of knowledge on which terms are significant in sentiment classification. In this paper, they offer a method for recognizing essential terms in positive and negative sentences using a convolutional neural network and a poorly supervised learning method (CNN). Each word is represented as a continuous-valued vector in the developed model, and each sentence is represented as a matrix with rows corresponding to the words. The proposed study is limited to analyzing the sentiments of all the classes [23].
Kumar & Jaiswal 2019 proposed the SC using the SI algorithms such as binary grey wolf optimization (BGWO) and binary moth flame (BMF). For feature optimization, SC performance accuracy is demonstrated in this study. The research was based on tweets and features were extracted using a traditional word frequency-inverse (FI) weighted filter, followed by SI methods. The Nave Bayesian, SVM, KNN, multilayer perceptron, and DT are the five baseline classifiers used to train the features. Thus, the proposed work can also be understood as a hybrid of swarm intelligence and machine learning techniques for sentiment classification work.The results show that meta-heuristic algorithms outperform classification techniques for the selection of feature subsets. Average accuracy was improved by about 9.4% using the BGWO method and 10.6% improvement using the BMF algorithm [24].
Iqbal et al. 2019 developed a sentiment analysis approach in opinion mining has grown in popularity. The effectiveness of recent studies has been described with various sentiment categorization algorithms, ranging from simple rule-based to lexicon-based ones. The ML algorithms were increasingly complicated while lexicon-based techniques have been harmed as a result of a lack of dictionaries and labeled data. The goal of this research was to present an integrated framework that bridges the gap between lexicon-based and ML approaches. The developed technique improves accuracy and scalability. Further, the authors address the issue of scalability that emerges as the feature set size by up to 42% while maintaining accuracy. The feature reduction technique was compared to Principle Component Analysis (PCA). The outcomes show that PCA had a 15.4 percent increase in accuracy and LSA had a 40.2 percent increase in accuracy. Other metrics such as precision, recall, and F-measure were measured to evaluate the proposed method [13].
Naz et al. 2021 proposed a study by merging the two algorithms, Decision Tree (DT) and Feed Forward Neural Network (FFNN) for sentiment analysis. Independent Component Analysis (ICA) was used to pre-process data, while the Windowed Multivariate Autoregressive Model (WMAR) was used to identify possible features. Then, using the Improved Bat Algorithm (IBA) technique, the highest scores are retrieved, and the experimental results were compared to show an accuracy of about 98% the suggested method greatly beats existing sentiment analysis algorithms. In other words, the work presented the combination of bat optimization algorithm as a swarm intelligence technique and neural networks as the machine learning architecture and thus represented a hybrid model for sentiment analysis and classification [25].
Ducange et al. 2021 proposed a Decision Support System (DSS) that can support businesses and organizations to handle marketing activities across numerous social media channels. The proposed model gathers social media users’ views on different aspects of the marketing campaigns in the form of promotions of products, and services. The promotional campaigns need to monitor continuously across different social networks. The DSS then calculates the brand’s reputation associated with certain organizations’ and gives feedback about the campaign based on the examination of these data. Further, Sentiment Analysis (SA) Engine is developed, the heart of the proposed DSS, and it can estimate the different emotions of the user. The engine is built on an ML model that is developed with real data collected from several social media platforms. Then, on a continuous basis, comments are retrieved from a collection of public pages for monitoring and sentiment classification. The proposed technique is efficient and provides the outcomes in terms of accuracy which is more than 90% [26].
From the studied literature, it is concluded that not only ML-oriented techniques have been utilized for the analysis of the sentiments extracted from tweets, but the integration of swarm intelligence approaches has also shown tremendous popularity. Though every studied literature has shown improvement in the context of quantitative analysis compared to state of art techniques, the contributions of these authors widen the scope and potential of the present research study to present something that is inspired and motivated by the existing research studies. For instance, Yuvraj and Shabri 2017 illustrated the importance of feature selection utilizing natural computing-oriented GA whereas Iqbal et al. utilized PCA for feature selection. Both the selection algorithms vary in nature and co-relation evaluation criteria. Hence, provides a clear understanding that the result for different datasets could vary significantly in quantity but the main motif was the same in both studies. Swarm Intelligence was adopted by Naz et al. in 2021 as per the studied literature that works with a sampling technique that further reduced the computation complexity of selection while improving co-relation among the groups. This is also referred to as ground truth in the proposed research. Thus, the outperformance of the combination of these two popular fields namely, SI and machine learning [13, 25] boosts the present research to integrate SI and machine learning in the proposed work architecture.
When talking about machine learning there are a number of studies that shows that the concept of machine learning for decision-making [27] hasa significant impact in each and every field including the marvelous revolution of the healthcare system [28–30]. Since 2001, the field of SI has also presented a number of updates in terms of new algorithm architecture as well as in proposing new behaviors. Among them, Grass Hopper was introduced by Mirjalili in 2017 [31] as the latest SI algorithm in the insect category in addition to the usage of the popular Firefly algorithm [32] and Bat algorithm [25]. This boosts the researcher’s choice for the integration of the Grasshopper algorithm as a SI technique in the presented work.
Proposed work
As illustrated in the introduction and the literature section, the validation of any machine learning algorithm is dependent upon training and classification architecture, the proposed work is also presented similarly. The proposed work is composed of a presentation of the algorithmic architecture that is utilized for the selection of the most relevant features from the supplied dataset and the channelization of the inference engine to attain maximum classification accuracy.The proposed work is divided into two segments namely the Reward generation and training which is illustrated in 3.2. Classification and validation that is explained in 3.3.
Dataset
To address the significance of the selection procedure, the proposed algorithm architecture has been evaluated for 3 different data sets.
Sentiment 140 datasets with 1.6 million tweets
The data set belongs to sentiment analysis of twitter tweets. The dataset contains 1,600,000 tweets that has been extracted against 3 emotions namely negative, neutral and positive. It is available online at https://www.kaggle.com/datasets/kazanova/sentiment140. These annotations have been used to detect sentiments [33]. The annotation scheme is a little surprising where 0 represents negative tweets whereas 2 represents neutral and 4 represents positive tweets. There are basically 6 attributes in the provided dataset shown in Table 1. Out of 6 attributes, the proposed work is utilizing two attributes namely the target and the text.
Dataset fields with description
Dataset fields with description
This It is quite an interesting dataset and opens the world of exploration for context analysis. It contains the data for Word Sense Disambiguation that associates words with several meanings if they are put in a sentence based on the context. As for example, a mouse has a roller that rotates with 360 degrees and a mouse significant sense of smell represents the mouse in two different contexts. The dataset is supervised that represents that all the data elements are labeled. The researchers can easily split their data with whatever ratio suits them for the validation and testing. This is an open source dataset and is available on https://paperswithcode.com/paper/semeval-2013-task-2-sentiment-analysis-in-1. The dataset contains emotions against different contexts and is cited in a lot of articles.
COVID 19 Tweets
COVID-19 tweets have been fetched using Twitter Streaming and process the tweet features such as (tweet ID, location if available, tweet text, and data have been collected using the https://github.com/mykabir/. COVID19) [34]. Every single file is specified with a certain name. There are six different attributes in the contained data file (tweet_id, loc, user_text, user_id, verified). The tweets in the data contain the location information and data attributes represented as follows.
Features of COVID-19 Tweets
Features of COVID-19 Tweets
There is some analytics from the processed dataset and 20 bigrams have been recorded as given in Fig. 2.

Frequent tweets or bigrams [35].
The reward generation and training section contain information regarding used utilities and the processing architectures. This section has 2 subsections:
Preprocessing and feature extraction
Feature selection along with the application of the attribute set selection using SI.
Pre-processing and feature extraction
Due to the massive submission of data over the internet and social media, the data contains a lot of non-relevant data and is full of stop words. A stop word is a word that does not contribute to any decision-making. For example, “I am going to watch the cinema” and “I am going to the UK” must have two different aspects and sense but has 4 words in common viz. {1. I 2. Am 3. Going 4. To}. These words are not going to help the training engine understand better regarding the data. Hence they must be removed from the data. There are a bunch of lists of stop words from several websites including GitHub. Porter Stemming Algorithm (PSA) has been utilized to remove the stop words from the input data set [36]. In such a manner, a filtered set of keywords belonging to each tweet is extracted. The extracted tweets are passed for feature extraction.
Text data does not have many options in terms of extracted features and hence the proposed algorithm has used a standard set of features namely term frequency (tf) and inverse document frequency (idf) which is further utilized to evaluate the co-relation factors among the attributes. To evaluate the co-relation, the proposed algorithm uses Cosine-Similarity, Dice Coefficient, and Euclidean Similarity.
Term Frequency-Inverse document frequency (tf-idf)
Term frequency (tf) represents the word (w) frequency appearing in the searching document (d) while idf measures the significance of the term (n) in all the specified documents to the document frequency.
Both terms are linked with each other and required weight to determine the document frequency.
Where, N total : Total Number of Documents
DF: Document Frequency
The weight of the function has been obtained by multiplying the tf and idf.
If the tf of a term is high, it denotes the significance of the term in a local document or tweet or file and idf indicates the word’s significance in the entire document. The tf-idf is useful to evict the common words and select the most important words in the document. These terms are also associated with word frequency (F
W
)that appears in the entire document and is expressed as follows:-
In the given dataset, words of high DF and low F
W
has been selected from the dataset and words with low DF and high F
W
are discarded due to inefficient word selection. However, some words with low DF and high F
W
are important as they provide vital information, and therefore such words are reserved. In other words, the count for tf is given as
Where,
Further, a vector space has been created in which the vocabulary of a term represents each tweet. Now, each tweet is represented in vector form as given below:
Further, normalization has been done to avoid spamming words that are of high frequency. Then, dividing the vector by its length and length has been computed using a Euclidian distance.
Cosine Similarity
Cosine Similarity has been used as a metric to compute the performance of the developed sentimental analysis system for evaluation. The score of cosine similarity falls in the range of 0 to 1. This score expresses the similarity between the proposed and expected results. The proposed results and expected results are mapped using the following equations:
The system performance in terms of sim (P
r
, E
r
) has been measured as:-
This type of equation has been used to consider each pair of tweets and determine the distance between the two results using t Euclidean distance given as follows:
The given equation measures the Euclidean distance in which positive and negative counts of the tweet are considered using individual words.
Dice co-efficient
To determine the significance of the lexical records and their intersection related to the lexica contents, the dice coefficient metric has been computed. The similarity coefficient has been computed as follows:
Where x: lexical intersection
y: the size of lexicon 1
z: the size of lexicon 2.
Dice coefficient provide a way to measure the importance of the intersection between the two lexical words. Dice coefficient provide a measure to determine the overlap notion and, the relationship between the lexicons. 0 value of the lexicon records indicates that there is no overlap while 1 shows the complete overlapping of lexicon records.
The Grass Hopper Algorithm (GHO) is one of the most recently developed algorithms from the category of Swarm Intelligence. The usage of SI has been observed in feature sets and feature selection in a lot of research articles that are cited in the literature. The evolution of SI algorithms started in 2012 and till 2017, approximately 20 SI algorithms have been newly proposed and hundreds of variations in different aspects of the research have been also proposed. The proposed algorithm modifies the GHO algorithm as per the desired utilities and is illustrated in this section of the paper itself.
Grass Hopper (GHO) Algorithm
The GHO algorithms are generally having a destructing behavior, categorized as a pest [37]. Generally, grass hopers attack the farms individually and then joined together to develop a large swarm considered disruptive for peasants. The search process using the GHO is taken place in two different ways: Exploitation and Exploration. The exploitation, phase includes the local movement of the pests while in the exploration phase, there is a rapid movement of the search agent. The swarm behavior of the grasshopper has been illustrated mathematically as:
While G
P
represents the grasshopper position which is the combination of social interaction (I
S
), gravity force (F
G
), and (B
WA
) behavior of the grasshopper due to wind advection. The equations as per random numbers written as follows:
The social interaction has been calculated as follows:
where M: total number of hoppers where
r: co-relation between the two positions viz. m and n of the hopper
From the above equation, it is clear that the distance among mth and nth positions of the grasshopper is detected as follows:
The unit vector (
The gravity force has been evaluated as follows:
Where F
c
signifies the gravitation constant and
Where V
c
is the constant and
Proposed GHO
The proposed GHO algorithm uses a feature vector that contains the different variables and input set illustrated below:
Variables-
Cs- Cosine Similarity Measure
Dc- Dice Coefficient
Eu- Euclidian Distance
Input Set- {Cs, Dc, Eu}
The proposed GHO algorithm is divided into two stages namely the Exploitation and the Exploration part. The proposed algorithm creates a reward mechanism that utilizes both phases. Each record from each category is considered to be one grasshopper and each grasshopper must go through both phases. The sole aim of the application of the proposed algorithm is to select the best attribute set in order to enhance classification accuracy. To do so, a reward-based GHO(r-GHO) algorithm is designed in which the hopper gets a reward every time it takes one leap toward any direction. The process architecture can be illustrated using r-GHO for the exploitation part is presented with a work diagram in Fig. 3.

The exploitation phase of the baby hopper.
The prepared attribute set is passed to the algorithm as the input. Initially, each hopper that comes to the world, goes for the exploitation phase after a certain interval of time, in which, the hopper roams in the nearby region in search of food. To do so, the baby hopper collaborates with other hoppers around the baby hopper.As shown in Fig. 3, for each ground truth i in the dataset, there could be ma number of rows and each row will contain the same number of columns viz. 3 in the case of the proposed work. In order to perform the exploration and the exploitation phase, the data must be divided into home and away regions. To divide the data into regions, the proposed algorithm has utilized k-means and has divided the data into 3 regions.The associated region of the current baby hopper bh i , is the clustered index of the bh i as C bh i . The members of C bh i will be considered as home members whereas the members ∉C bh i will be considered as away members and they will be utilized in the exploration phase. The total number of members to be collaborated will be 9 and including the baby hopper bh i , the group size will be 10.The evaluate the generated fitness function for the grass hopper algorithm, two food values viz. f1 and f2 will be created.
The aim to see the preciseness of the current hopper to its home index relative to the other generated indexes. The fitness function will evaluate the Euclidean distance between the centroid of the home cluster to the attribute set of the current hopper, which is given by f2. As the current baby hopper might not be the best hopper of the lot but it might be a suitable one. The selection order of hoppers from the home group is random and hence to provide a relaxing window to the baby hopper, 20% of the selection population viz2, hoppers will take from any other two groups and the last hopper will be the current baby hopper. Every time the fitness function will evaluate the average Euclidean distance of the entire population to the home centroid and the Euclidean distance between the current hopper and its homecentroid.
where p is ∈ {1 ... p’-1,10) where p’-1 = 7, as 7 members are going to be from home group and 8–10th position, will be filled by other hoppers.
Where f2: is the soul attribute set of current hoppers.
For the exploration phase, when the baby hopper matures in size and architecture, it starts to roam around with other flies in the field, the arrangement of f1 and f2 should be reconsidered. With 10 members on the list, the majority of members should be from away or other groups rather than being it from the home group. Hence another food set that is f3 is created as follows
t is ∈ {1 ... t’–1,10) where t’–1 = 7, as 7 members are going to be from away group and 8–9th position, will be filled by home hoppers. 10th position will be attained by the mature hopper.
Both food values f1 and f2 will be passed to the designed hopper fitness that is illustrated by Fig. 4 for the exploitation phase. In the case of exploration, the reverse order fitness function has to be applied as the aim is to keep the hopper in the home group and not in the away group.

Fitness function of proposed r-GHO.
The fitness function of r-GHO calculates the Ed of the group hopper food f1 to the centroid C bh i as e1 and Ed of the sole baby hopper food f2 to the centroid C bh i as e2. The aim is to check the feasibility of generating possibilities for the baby hopper to fit into its home group. If the difference between the e1and e2 is more than 30% the fitness function concludes through fitness evaluation that, the baby hopper does not perform well with the existing group and sends a negative reward and vice-versa. The exploration phase continues for 5 Levy formations in which the baby hopper will be associated with 10 different hoppers of the same class every time the baby hopper meets a new group member. The exploitation phase can be algorithmically written as follows.
The Algorithm takes the hopper food and hopper index of the related ground truth and returns the reward of the exploitation phase as illustrated earlier. After the exploitation phase, as time passes by, the hopper gets mature and starts to roam with other hoppers that are found may be nearby or maybe some distance apart. The maturity phase is covered under the exploration phase. The algorithm applies reverse fitness of the proposed fitness function in order to justify that the hopper is best suitable for the home group and not for other groups that it forms in its exploration phase. The paper also considers that for a hopper to survive, it is necessary for the hopper to form groups outside home groups and hence to justify the hopper life span, the proposed algorithm keeps a dual threshold policy in order to evaluate the Exploration phase. The dual threshold policy compels the hopper to pass atleast one significant flight with the hoppers of another index but should not exceed more than one. This will keep the hopper alive in the exploration phase as well and the hopper will show loyalty to the home group. The higher reward towards the home group will lead to an increase in the sustainability of the data in the relevant label class.
In the case of the exploration phase, a reverse reward mechanism is applied and if the fitness function returns 0, a reward of.10 is credited to the hopper. The condition is, in order to survive the exploration phase, the hoper must get 1 positive value even in the exploration phase. To illustrate the significance of the proposed r-GHO, an average illustration for all three datasets is presented in Table 3.
Statistical parameter evaluation
An average of 25000 documents were evaluated. As illustrated in Table 1, an average drop of 10–15% has been observed in each set of records. To validate, Standard Error (SE) and Mean Squared Error (MSE) have been evaluated. It is clear from the table that the proposed r-GHO algorithm reduces both MSE and SE by significant margins. To be on the presentable side, Fig. 4 represents the percentage improvement for the provided set of records.
In order to perform the classification for the proposed algorithm, the Quasi-Newton Backpropagation algorithm has been utilized with 5 propagation layers that are being judged by cross-entropy.

% Improvement.
The Quasi-Newton BP algorithm has been used to infer complex problems and optimization problems without any constraints. Quasi-Newton BPA is an optimization technique used for the optimization of training by modifying the weight in the network. Backpropagation is the training algorithm in ANN. The architecture of backpropagation is multilayer, which makes the output model more relevant and accurate. The architecture of the network generally affects the training time and accuracy outcomes of training results. In case of complexity, training time is long. BP is generally done to revamp the accuracy of ANN by decreasing the training convergence level and thus, improving the accuracy of BP. It was formed using the generalization of rules in the prescribed network model by combining a hidden layer. The propagation of the hidden layer can be only done utilizing three propagation architectures namely linear propagation, quadratic propagation, and polynomial propagation. The complex data architecture cannot be separated by linear propagation models and hence polynomial propagation architecture is utilized. There are two separate propagations in such architecture viz. forward movement and backward movement. In the case of forward movement, the hidden layer generates weights using the propagation methods that are defined during the creation of the network. For example, in the case of the proposed algorithm architecture, Levenberg propagation is utilized [38]. Levenberg integrates the weights generated in the previous layer into the newly generated weights and selects the best-suited feature until the propagating layer. Mathematically, it can be defined as follows
Results and discussions
The proposed algorithm is for the selection of the features from the dataset to produce maximum attainable accuracy and hence the results have been formed on the base of the selected features. The proposed algorithm utilized GHO which selects some feature set and drop some feature set as well. If the dropped feature set, contributes to the enhancement of the accuracy that has been dropped by the selection algorithm, the total count of features will be considered as a false native (fn). The selected feature set that contributes to the enhancement of the classification accuracy is called true positive (tp). Those that are picked wrongly for the processing and decreases the classification accuracy overall, is termed false positive (fp). The feature set, that is rejected by the processing algorithm and does not contribute in the enhancement of the accuracy, is called true negatives (tn).
Based on tp, fp, tn, and fn precision and recall have been evaluated using equations 23 and 24 as follows.
The evaluation of the parameters has been done on three different datasets as mentioned earlier in the 3rd section. The results have been provided for each dataset. Tables 4, 5 and 6, illustrates precision, recall, and f-measure for sentiment 140, whereas Tables 7, 8, and 9 for SemEval 2013 and Tables 10, 11, and 12 for COVID-19 tweets. The studies used for the comparative analysis have integrated Cat Swarm-LSTM [19], Filter Wrapper [20], PSO based Lexicon [17], CS-based filtering [22] and Bat Optimization [25] for sentiment analysis work. Thus, the proposed algorithm is also compared with swarm intelligence and machine learning inspired state of art techniques that has been illustrated in the literature survey as well. All the datasets are different immature and contains different set of emotions. In order to be precise on the work architecture, the other compared state of art algorithms were also implemented on simulation tool and based on the selected tweets for the processing, the results were evaluated. The tweets were taken random from each category and the results have been formed by considering total number of tweets taken for all categories. During evaluation percentage improvement is computed in case proposed r-GHO over the existing works.
Precision analysis for Sentiment 140
Recall analysis for Sentiment 140
F-measure analysis for Sentiment 140
Precision analysis for SemEval 2013
Recall analysis for SemEval 2013
F-measure analysis for SemEval 2013
COVID 19 Tweet analysis
Recall for COVID 19 Tweet analysis
F-measure for COVID 19 Tweet analysis
Table 4 shows the precision analysis for 140 sentiments using the proposed technique r-GHO and other existing techniques. The outcomes show that precision using the r-GHO for 11000 tweets is 0.90 while using Cat Swarm-LSTM and Filter wrapper is 0.84. But, precision is 0.85 using PSO based Lexicon technique. The outcomes show that average precision value using the proposed approach is 0.94 while using the Cat Swarm-LSTM, and Filter wrapper, it is 0.88. For PSO based Lexicon technique, average precision is 0.87, CS based filtering is 0.86 and Bat Optimization is 0.87.
The improvement analysis shown in Fig. 6 demonstrates that an average improvement of 6.59% 6.55% 8.31% 8.97% and 7.74% is observed over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

Precision analyses for Sentiment 140.
Table 5 shows the recall analysis for 140 sentiments using the proposed technique r-GHO and other existing techniques. The outcomes show that recall using the r-GHO for 14000 tweets is 0.97 while using Cat Swarm-LSTM and Filter wrapper is 0.88 and 0.94 respectively. But, recall is 0.90 using the PSO based Lexicon technique. The outcomes show that average recall value using the proposed approach is 0.96 while using the Cat Swarm-LSTM 0.901, PSO based Lexicon technique is 0.907. For Filter wrapper, average recall is 0.88,CS based filtering is 0.878 and Bat Optimization is 0.873.
The recall improvement analysis shown in Fig. 7 shows that an average improvement of 6.61% 9.15% 5.93% 9.39% and 10.05 is observed over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

Recall analysis for Sentiment 140.
Table 6 shows the F-measure analysis for 140 sentiments using the proposed technique r-GHO and other existing techniques. The outcomes show that F-measure using the r-GHO for 16000 tweets is 0.93 while using Cat Swarm-LSTM and Filter wrapper; it is 0.89 and 0.88, respectively. However, F-measure is 0.90 using the PSO based Lexicon technique. Consequently, the outcomes show that average F-measure value using the proposed approach is 0.95 while using the Cat Swarm-LSTM, and PSO based Lexicon technique, it is 0.89. For Filter wrapper, average F-measure is 0.88, CS based filtering is 0.872 and Bat Optimization is 0.875.
The improvement analysis in Fig. 8 shows that the % improvement exhibited by the proposed work using r-GHO over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis is 6.90% 7.81% 6.92% 9.25% and 8.95% respectively.

F-measure analysis for Sentiment 140.
Table 7 shows the precision analysis for SemEval 2013 using the proposed technique r-GHO and other existing techniques.The outcomes show that average precision value using the proposed approach is 0.94 while using the Cat Swarm-LSTM, and Filter wrapper, it is 0.89 and 0.85. For PSO based Lexicon technique, average precision is 0.88, and Bat Optimization based filtering it is 0.87. Thus, proposed technique shows better results in comparison to existing techniques.
The precision improvement using SemEval 2013 is shown in Fig. 9. It is observed that an average % improvement of 6.47% 10.73% 7.72% 11.28% and 8.16% over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

Precision analysis for SemEval 2013.
Table 8 shows the recall analysis for SemEval 2013using the proposed technique r-GHO and other existing techniques. The outcomes show that average recall value using the proposed approach is 0.96 while using the Cat Swarm-LSTM it is 0.89, and PSO based Lexicon technique, it is 0.906. For Filter wrapper, it is 0.85, PSO based Lexicon technique is 0.906 and Bat Optimization based filtering it is 0.86.
The improvement analysis for recall values obtained for SemEval 2013 is shown in Fig. 10. The figure shows that overall an average improvement of 7.32% 12.43% 6.15% 12.61% and 11.70% is exhibited by the proposed work using r-GHO over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

Recall analysis for SemEval 2013.
Table 9 shows the F-measure analysis for SemEval 2013 using the proposed technique r-GHO and other existing techniques. The outcomes show that average F-measure value using the proposed approach is 0.95 while using the Cat Swarm-LSTM, and PSO based Lexicon technique, it is 0.89. For Filter wrapper and CS based filtering, average F-measure is 0.88 and Bat Optimization based work showed an average f-measure of 0.86.The values show that the using r-GHO the proposed work exhibited better performance over existing works.
The improvement analysis shown in Fig. 11 shows that average improvement of 6.87% 11.56% 6.95% 11.87% and 9.85% is exhibited over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

F-measure analysis for SemEval 2013.
Table 10 shows the precision analysis for COVID 19 Tweet Analysis using the proposed technique r-GHO and other existing techniques. The overall analysis shows that an average precision value using the proposed approach is 0.93 while using the Cat Swarm-LSTM, and Filter wrapper, it is 0.87 and 0.85. For PSO based Lexicon technique, average precision is 0.87, CS based filtering is 0.86, Bat Optimization is 0.87.
Overall, the average improvement for precision analysis for proposed work using r-GHO is shown in Fig. 12. It is observed that an average improvement of 6.55% 9.13% 6.69% 8.03% and 6.24% is exhibited by existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively. Thus, better performance is observed using GHO as optimization approach.

Precision for COVID 19 Tweet analyses.
Table 11 shows the recall analysis for COVID 19 Tweet Analysis using the proposed technique r-GHO and other existing techniques. The outcomes show that average recall value using the proposed approach is 0.95 while using the Cat Swarm-LSTM is 0.89, and Filter wrapper, it is about 0.88. For PSO based Lexicon technique, average recall is 0.89, CS based filtering is 0.92 and Bat Optimization is 0.93. Thus, proposed approach exhibited better performance over the existing techniques.
The improvement analysis shown in Fig. 13 demonstrates that an average improvement of 7.07% 8.40% 6.95% 3.94% and 2.72% is exhibited by proposed work using r-GHO over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

Recall for COVID 19 Tweet analysis.
Table 12 shows the F-measure analysis for COVID 19 tweet using the proposed technique r-GHO and other existing techniques. The tabulated outcomes show that average F-measure value using the proposed approach is 0.945 while using the Cat Swarm-LSTM is 0.88, and Filter wrapper, it is 0.87. For PSO based Lexicon technique, average F-measure is 0.88, using CS based filtering it is 0.89, and using Bat Optimization is 0.905. Thus it shows that proposed technique performed better in comparison to existing technique by a significant margin.
The improvement analysis shown in Fig. 14 for f-measure analysis shows that an average improvement of 6.80% 8.78% 6.81% 5.99% and 4.48% is exhibited by proposed work using r-GHO over existing sentiment analysis work using Cat Swarm-LSTM, Filter Wrapper, PSO based Lexicon, CS based filtering and Bat Optimization for sentiment analysis, respectively.

F-measure for COVID 19 Tweet analysis.
In order to validate the proposed work in terms of optimization, significant tests have also been applied. The proposed work applied Friedman test for the validation [39]. The results of the test has been applied for varying records in terms of number of tweets. The friedman test calculates the average rank based on the co-relation among the data attributes.
Friedman test
As evident from table, the rank of proposed GHO algorithm is comparative higher than the other state of art algorithms. The reason of this conciseness is due to efficient grouping behaviour of the proposed algorithm.
This paper presents the GHO based sentiment analysis using the analysis model. It comprises into two phases namely the training and the sentiment classification (SC). The proposed r-GHO algorithm is divided into two phases namely the Exploitation and the Exploration part, and creates a reward mechanism which utilizes both the phases.The training architecture involves the data to be trained using the reward based Grass Hopper Optimization (r-GHO) algorithm. The training architecture and context analysis of the tweet is presented for the sentiment analysis. The proposed algorithm uses Cosine Similarity, Dice Coefficient, and Euclidean Distance as the input set and further processes using the r-GHO algorithm. The evaluation of the parameters has been done on three different datasets using the precision, recall, and F-measure. The proposed algorithm is compared with various swarm intelligence based techniques. The outcomes show that proposed approach is improved by 5.93% to 10.05% Sentiment 140, 6.15% to 12.61% for SemEval 2013, and 2.72% to 9.13% for COVID 19 tweets dataset. In future, authors will look forward to evaluate some animal swarm algorithms to improve the attribute selection process. Further, deep learning concept in machine learning will also be involved for the validation of the outcomes.
