Abstract
Sentiment analysis is a method of analyzing emotions and using text analysis techniques with natural language processing methods. Sentiment analysis uses data from various sources to identify the user’s attitude through different aspects. It is widely used for extracting opinions and recognizing sentiments, which helps Business organizations understand the user’s needs. This paper proposes a simple but compelling sentiment analysis method, showing the combined scores based on positive and negative words. Then, the tweets are categorized as Neutral, Negative, or Positive according to the scores. Sentiment analysis and opinion mining have grown significantly in the last decade. Different studies in this domain try to determine people’s feelings, opinions, and emotions about something or someone. The main objective of this analysis is to determine the sentiment of the review using a machine learning model and then compare the result with the manual review of the data. This would allow researchers to represent and analyze opinions objectively across different domains. A hybrid method that combines a supervised machine learning algorithm with natural language processing techniques is suggested for review analysis. This project aims to find the best model to predict the sentiment of the tweets on airlines. During the research process and considering various methods and variables that should be considered, we found that methods like naïve Bayes and random forest were not fully explored. The proposed system improves an effective and more feasible method for sentimental analysis using machine learning, multinomialNB, linear regression, and regular expression.
Keywords
Introduction
In the digital era, social media platforms have become a reservoir of unfiltered opinions, reflections, and sentiments of the masses. Among these platforms, Twitter is a real-time microblogging platform where users express their thoughts succinctly in 280 characters or less. Understanding and deciphering the sentiments embedded within these terse messages hold immense significance, particularly in industries like airlines, where public perceptions profoundly influence service quality and customer experiences. Sentiment analysis, a branch of natural language processing (NLP), is a pivotal tool in discerning the sentiment nuances encapsulated within the vast ocean of social media data. Specifically, in the context of the airline industry, comprehending public sentiments shared on Twitter offers airlines unprecedented insights into customer preferences, grievances, and satisfaction. Leveraging this information empowers airlines to tailor their services, engage customers effectively, and augment overall experiences. However, the inherent challenges embedded in analyzing unstructured text data within the dynamic landscape of social media necessitate innovative and robust methodologies for accurate sentiment extraction. Traditional machine learning models offer substantial support in this realm. Yet, they often need help capturing the intricate contextual and nuanced elements inherent in social media conversations, particularly within the constrained space of tweets. This paper introduces a novel approach that amalgamates the prowess of machine learning algorithms with the finesse of regular expression techniques, aiming to dissect sentiments embedded within airline-related tweets. By synthesizing these two methodologies, we endeavor to enhance the precision and depth of sentiment analysis, capturing the subtleties embedded within the concise language of tweets. In this pursuit, we employ diverse machine learning models, encompassing Support Vector Machines (SVM), Naive Bayes, and Recurrent Neural Networks (RNN) alongside regular expression-based techniques. Integrating regular expressions enriches the preprocessing phase by isolating emoticons, intensifiers, negations, and other sentiment-indicative textual elements, augmenting the machine learning models’ capability to discern nuanced sentiments. This study aims to evaluate the efficacy of this combined approach using a substantial dataset of airline-related tweets, analyzing its impact on sentiment analysis precision and recall compared to standalone machine learning models. The results obtained are promising, showcasing the potential of this amalgamated methodology in unveiling sentiment nuances within the dynamic environment of social media discourse, particularly within the domain of airline industry tweets. The subsequent sections delve into this approach’s methodology, evaluation, and findings, shedding light on its effectiveness in unraveling sentiments within Twitter discourse’s concise yet potent world within the airline industry. Public opinion research can offer us valuable insights. Sentiment analysis on social media platforms such as Twitter or Facebook is a powerful technique to understand more about users’ views and has many applications. However, natural language processing (NLP) challenges limit effectiveness and accuracy. In this project, we applied Regular Expression and Multinomial naive bias to address sentiment analysis issues. We used models based on the term frequency-inverse document frequency (TF-IDF) and word embedding to a collection of datasets. Lastly, we compared the experimental outcomes for the different models and input features.
Tweets are marked as positive, negative, and neutral based on the ratings. Sentiment evaluation and opinion mining have seen tremendous growth over the past decade. Various studies in this field attempt to determine people’s feelings, opinions, and emotions about something or someone. The first goal of this evaluation is to assess the sentiment of the review using a machine learning model and then compare the result with the manual review of the data. This could enable scientists to present and check evaluations comprehensively and objectify data evaluation. A hybrid technique that mixes a supervised machine learning algorithm with natural language processing techniques is proposed for verification assessment. This mission aims to find the prime version to anticipate the sentiment of tweets about airlines. While conducting studies and considering different strategies and variables, we realized that processes like Nave Bayes and Random Forest still needed to be fully explored. In this mission, we wanted to evaluate a more viable technique using MultinomialNB, linear regression, and regular expressions. This study addresses the need for improved sentiment analysis methods and offers a practical approach for categorizing tweets based on sentiment, benefiting both businesses and researchers.
Motivation
Using a hybrid model (Regular Expression and MultinomialNB), the accuracy and f1 score can be enhanced. Sentiment analysis can help businesses monitor the effectiveness of their marketing campaigns on social media and other online platforms. They can also check online feedback to see any problems with their new product launches. Furthermore, they can gauge the reaction of their target market to their new product. Based on the outcomes of the analysis, they can modify their sales and marketing strategies to respond to or influence consumer sentiment. Understanding the feelings expressed by users on social media platforms, especially on Twitter, holds immense significance for businesses, including airlines. It provides valuable insights into customer satisfaction, preferences, and concerns, enabling companies to tailor their services and strategies accordingly. However, analyzing sentiments within social media’s concise and often informal language, such as tweets, poses several challenges. Unstructured text data, noise, nuanced expressions, and limited character space demand innovative methodologies for accurate sentiment extraction. The motivation for this article lies in merging machine learning algorithms’ capabilities with the precision of regular expression-based techniques. By combining these methodologies, the aim is to refine sentiment analysis accuracy, capturing the subtle nuances embedded within airline-related tweets. Ultimately, the goal is to empower airlines with robust tools to decipher sentiment nuances within social media discourse. This understanding, derived from the proposed methodology, can aid airlines in enhancing service quality, addressing customer concerns, and shaping positive customer experiences. This article seeks to bridge the gap between traditional sentiment analysis techniques and the intricacies of social media language, particularly within the domain of airline-related discussions on Twitter. It aims to provide a comprehensive framework for discerning sentiments, contributing to more informed decision-making and customer-centric strategies within the airline industry. In essence, this article’s motivation lies in offering an innovative approach to sentiment analysis that effectively navigates the challenges inherent in analyzing social media data, particularly tweets, to extract meaningful insights beneficial for businesses, specifically within the context of the airline industry.
Innovation idea
Several machine learning models are available for sentiment analysis on tweets and reviews, including Random Forest, Support Vector Machine (SVM), and Naïve Bayes algorithm. To improve the accuracy of our sentiment analysis classifier, we are exploring the use of regular expressions and the MultinomialNB algorithm. Our goal is to optimize the f1-score and recall values of the model.
The requirement gathering
Functional requirements
Feature Extraction –Our model should be able to split the log and extract keywords from the log description report. Dataset –We use a Kaggle and Twitter API dataset.
They describe system elements related to how the system meets functional requirements. They are as follows: Performance and Response Time –The system should be high-performance. Error Handling –Errors should be minimized as much as possible, and a suitable error message should be provided to assist the user through the recovery process. Ease of Use –The users should be able to interact with the model easily.
A literature review involves searching for similar systems and identifying differences between a researcher’s project and existing systems. It aims to comprehensively understand the project by combining theoretical, methodological, and current knowledge. The information gathered is specific to the task at hand. This chapter will describe how our model differs from similar models in the field. Brandon Huynh and James Schaffer et al. [1] conducted a visual comparative analysis of the various courses to examine the effects of the course structure differences while considering the characteristics of the student’s behavior. They made several recommendations for teachers and course designers when making predictions. In their research, Leandro N de and Ana Lima et al. [2] offered three methods for categorizing the emotions of Tweets— a strategy centered on word, emotion, and a hybrid model. The sentiment infused into the feelings is considered a criterion for categorizing the messages in the emotion-based method. The inclusion of an emoticon was a selection factor for the tweet. Words like Good, Bad, Excellent, etc. that reflect sentiment are considered when using the word-based technique to infer emotion. The hybrid method took into account the use of both words and emoticons. S. Tanwar, C. Verma, V. Stoffová, N. Kumar, and Z. Illés et al. [3] performed three major experiments to determine the student’s place of origin toward technical understanding in a global educational setting. Students from two different nationalities participated in this research study. They used PCA and SVM to do the same. Considering three well-known Airlines, M. J. Adarsh and P. Ravikumar et al. [4] gave an efficient and straightforward method of detecting attitudes on Twitter. The score calculation served as the basis for identifying the neutral, negative, and optimistic sentiments. I. D. L. Torre-Dez, J. Qadir, B. Sainz-De-Abajo, F. Es-Sabery, A. Hair, and B. Garcia-Zapirain, et al. [5] performed the basic architecture using 2 machine learning algorithms which are made up of the data gathering stage, text pre-processing techniques to reduce noisy data, and word embedding techniques to convert text-based data into numerical based figures, CNN for extracting features, using MFS to categorize their input into a negative, positive, or neutral class, and FFNN to calculate both PSS and NSS values. A. Ishaq, S. Asghar, and S. A. Gillani et al. [6] propose an effective method for sentiment analysis using a genetic algorithm and a convolutional neural network. After extracting semantic features, various models are jointly trained using the suggested CNN-based ensemble, SVM, maximum entropy, random forest, decision tree, stabilized discriminant analysis, and generalized linear model. X. Lei, X. Qian, and G. Zhao et al. [7] This paper present a recommendation model that uses sentiment data from online reviews by users as a source of information. The authors combine three factors: the reputation of items based on sentiment, the similarity of users based on opinion, and the influence of social sentiment on users’ choices. They use a matrix factorization framework to predict ratings based on these factors. They also use social media sentiment to capture user preferences.
Z. Chen, F. Lu, X. Yuan, and F. Zhong et al. [8] present a cross-modal hypergraph model that uses textual and sentimental information for sentiment classification, which can help with online service recommendations. They also use the LDA topic model to incorporate global higher-level details and reduce the ambiguity of some terms. T. Manshu and W. Bing et al. [9] proposed the HANP procedure for CDSC jobs. Essential words and phrases can receive more attention from the suggested HANP when classifying sentiment. Critical pivots, non-pivots, and dispivots can all be captured using the sentiment dictionary match layer. The HANP can determine what a non-pivot or a dis-pivot means by learning synonyms. K.Abdalgader and A. A. Shibli et al. [10] have presented a new application of the context-expanded lexicon-based word polarity identification technique on several user evaluations. The improved method analyses the semantic relatedness between a target word’s context expansion and WordNet’s synonyms and glosses to identify the polarity of the word. Lee et al. [11] uses significant data sources to examine the early impact of COVID-19 sentiment on the US stock markets. The author uses the Daily News Sentiment Index (DNSI) and Google Trends data on coronavirus-related searches. The aim is to explore the relationship between COVID-19 sentiment and 11 US stock market sector indexes during a specific period. G. Xu, Z. Yu, H. Yao, F. Li, Y. Meng, and X. Wu et al. [12] present a method for Chinese sentiment analysis based on a comprehensive dictionary. The complete dictionary includes the essential dictionary, some domain-specific sentiment words, and some words with multiple meanings and sentiments in different domains. The method uses the naive Bayesian domain classifier to identify the part of the text that contains a term with various views, so the sentiment polarity of the word can be determined. M. Rathi, A. Malik, D. Varshney, R. Sharma, and S. Mendiratta et al. [13] proposed a paper that improves the classifier’s accuracy in categorizing tweets. They presented hybrid sentiment classification models based on SVM, ADABOOSTED, and DECISION TREE. Their proposed method labels the tweets as Positive or Negative, which helps analyze the sentiments and use them for further decision-making. They applied preprocessing techniques to ensure the data input for the training process was accurate. T. Zhong, Y. Mo, W. Tai, and F. Zhou et al. [14] proposed StockNF, a flow-based generative framework for stock movement prediction. The framework aims to learn latent representations of Tweets and historical stock prices that are more flexible and expressive. Normalizing flows are a common technique for image generation. M. Rathi, A. Malik, D. Varshney, R. Sharma, and S. Mendiratta et al. [15] suggested Pos-TAN, a model for sentiment classification. The model combines the POS-Attention, which captures the sentiment information from part of speech, and the Self-Attention, which learns the feature representation of the text. The model also uses the Focal Loss to reduce the impact of sample imbalance on the classification performance. Renata Avros, Zeev Volkovich et al. [16] propose a new method inspired by the current techniques of classifying short texts using deep learning methods. The method treats the test collection and the collections of imposters as sequences of short patterns like “tweets.” A deep neural network with a CNN layer followed by LSTM layers is trained to differentiate between the imposters’ collections in the first stage. The trained network assigns labels to the batches of the test collection, converting their texts into signals, which allows for identifying their writing style. This method aims to explore new ways of analyzing textual material for detecting authorship features of medieval Arabic documents from a new computational perspective. Vedavathi N., Anil Kumar K.M. et al. [17] propose a recommendation system for e-learning platforms that uses machine learning techniques to analyze user sentiments and preferences. The proposed system is designed to provide optimal course recommendations to users based on their interests and behavior. The system involves several components, including a filtering component, profile learner, and content analyzer. The sentiment analysis of user reviews and preferences is performed using hybrid deep similarity to enhance the accuracy of the recommendation system. The proposed system outperforms existing recommendation systems regarding accuracy, recall, precision, and F-measure. The study highlights the importance of sentiment analysis in developing effective recommendation systems for e-learning platforms. Sayyida Tabinda Kokab, Sohail Asghar, Shehneela Naz et al. [18] propose a generalized sentiment analysis model that can handle noisy data, out-of-vocabulary words, and sentimental and contextual loss of review data. The proposed model is a Bi-directional Encoder Representation from Transformers (BERT) based Convolution Bi-directional Recurrent Neural Network (CBRNN) model. The model uses the zero-shot classification for labeling the reviews by calculating their polarity scores. Then, a pre-trained BERT model is employed to obtain sentence-level semantics and contextual features from the data and generate embeddings. The obtained contextual embedded vectors are then passed to the neural network of dilated convolution and Bi-LSTM to extract local and global contextual semantic features from the embedded data. The CBRNN model is evaluated across four diverse domain text datasets based on accuracy, precision, recall, f1-score, and AUC values. Renata Avros, Zeev Volkovich et al. [19] propose a new approach motivated by the contemporary classification procedures of short texts through deep learning methodology. The method considers the tested collection and the collections of imposters as sequences of short patterns like “tweets.” A deep neural network combined with a CNN layer accomplished by the LSTM ones is trained to distinguish between the imposters’ collections at the first stage. The obtained network classifies the bathes of the test collection, transforming its texts into signals, making it possible to label them according to their writing style. The proposed methodology suggests a new look at the perusal of medieval documents’ inner structures and possible authorship from the short-patterning and signals processing perspectives. Nandwani, P., Verma, R. A. et al. [20] explain the different stages of sentiment analysis and emotion recognition from textual data. They also describe various models of emotions and the levels at which sentiment analysis can be performed.
Hyunsang Son et al. [21] Firms collect user-generated content (UGC) to analyze consumers’ opinions about brands and firms. Analyzing unstructured UGC is challenging due to the need for a more analytic frame. The authors of this study collected 680,410 tweets related to airline companies and analyzed 4961 retweets to predict user engagement levels on Twitter. The study found that consumer sentiment was positive for United Airlines, Delta Airlines, and Alaska Airlines, whereas it was negative for Southwest Airlines and Hawaiian Airlines. The study also examined the effects of word count, gaps between the tweet generated date and the retweeted date, the number of hashtags, and extracted topics on predicting the level of user engagement. Wajdi Aljedaani et al. [22] discuss using Twitter data to understand public sentiment, especially in industries like airlines. It highlights the challenges in accurately analyzing sentiments due to contradictory text and proposes a hybrid method combining lexicon-based techniques and deep learning models for better accuracy. The study examines TextBlob’s impact on sentiment analysis compared to other methods like Afinn and VADER. Various models like CNN, LSTM, GRU, and CNN-LSTM are compared, with LSTM-GRU performing the best. The support vector classifier and extra tree classifier achieve high accuracy using TF-IDF and BoW. While TextBlob helps improve model performance, it’s emphasized that human annotators are still necessary due to biases and subjectivity. The proposal is to use TextBlob-generated labels as a guide for human annotators. Ali Pourranjbar et al. [23] explore the growing concern about electronic waste and the pressure on manufacturers to develop sustainable products. It introduces the product-service (PSS) as a circular economy model and highlights consumers’ crucial role in waste management and PSS success. While existing research has focused on consumer-facing sustainability aspects, this study delves into waste management within product-oriented PSS using social media as a primary data source. It utilizes machine learning and AI methods to assess consumer feedback over an extended period. The study evaluates leading companies like Apple, Samsung, and Google in Waste Electrical and Electronic Equipment (WEEE) using the Delphi method, identifying key consumer opinions such as cost, trust, convenience, awareness, benefits, and data privacy. It concludes that cost significantly influences consumer participation in waste management programs, offering businesses a six-year overview of consumer responses to their initiatives in WEEE.
Sayyida Tabinda Kokab et al. [24] outline the significance of sentiment analysis (SA) as a method for extracting subjective information from text-based data and its application in various fields like Natural Language Processing (NLP) and computational linguistics. It highlights the challenges of existing models, such as overlooking contextual and sentimental information, dealing with vocabulary words (OOV), and the need for more annotated data, leading to potential misclassification. The paper proposes a bi-directional encoder representation from transformers (BERT) based on the convolution bi-directional recurrent neural network (CBRNN) model to address these issues. This model utilizes zero-shot classification for polarity scoring, employs pre-trained BERT for contextual features, and combines dilated convolution with Bi-LSTM to extract semantic and contextual features effectively. The CBRNN model is evaluated across diverse text datasets, showcasing its efficiency in performing sentiment analysis tasks on social media reviews while minimizing information loss.
M. Ghiassi et al. [25] introduce an unsupervised approach to text classification, aiming to simplify the process while maintaining or surpassing the accuracy of traditional methods. It combines a new clustering algorithm, Yet Another Clustering Algorithm (YAC2), with a domain-transferrable feature engineering approach for Twitter sentiment analysis and YouTube comment spam filtering. The study evaluates this integrated solution using multiple datasets for sentiment analysis (Starbucks, Verizon, Southwest Airlines) and spam filtering (Psy, LMFAO, Shakira, Katy Perry). Compared to established clustering solutions like KNN, Spectral, and DBSCAN, the integrated solution outperforms all alternatives in sentiment analysis and closely competes with KNN in spam filtering. Moreover, the feature engineering approach enhances accuracy, reduces model complexity and matrix sparsity, and offers transferability across diverse datasets.
Dharmendra Dangi et al. [26] discusses the significance of sentiment analysis using artificial intelligence, particularly focusing on the challenges associated with deep learning techniques and the introduction of a novel approach using the Artificial Rabbits optimized Robust Random Vector Functional Link Network (RRVFLN) to enhance sentiment analysis accuracy. It highlights that while deep learning combined with Natural Language Processing (NLP) offers high performance in sentiment analysis, challenges like computational complexity, high training time, and sensitivity to learning rate hinder their real-time applicability. The paper addresses this issue by introducing the RRVFLN model optimized using Artificial Rabbits Optimization (ARO) for sentiment analysis improvement. The methodology involves data preprocessing, analysis of word vectors using FastText, and employing ARO to optimize the RRVFLN model’s input weights and hidden layer biases. The proposed approach is evaluated on three datasets: News Headline Sentiment, Sentiment140, and 4000 Short Story datasets, classifying sentiments into positive and negative. Simulation results comparing the proposed model with existing techniques showcase its effectiveness through metrics like F1 score, precision, classification accuracy, error rate prediction, and kappa statistics, demonstrating improved performance in sentiment analysis.
Research gap/limitations
Identified
While the paper effectively combines machine learning algorithms with regular expression techniques for sentiment analysis, it primarily focuses on these two methods. There is a potential gap in not exploring other text processing or feature engineering methodologies that further enhance sentiment analysis accuracy in social media text, especially in tweets. The research focuses explicitly on sentiment analysis within the airline industry using tweets. This industry-specific approach limits the generalizability of the proposed methodology to other domains or social media platforms, where language usage and sentiment expressions vary significantly. Though the paper discusses enhanced sentiment analysis accuracy through the combined approach, it needs to delve deeper into the complexities of sentiment nuances within tweets. Understanding and dissecting subtle sentiment variations, sarcasm, or context-dependent expressions might require more comprehensive analysis. While the paper evaluates the combined approach against standalone machine learning models, it needs more comparison with the latest or state-of-the-art sentiment analysis techniques or frameworks. This absence might hinder a holistic understanding of the proposed method’s competitiveness against cutting-edge methodologies. (M. J. Adrsh and P. Ravikumar, 2018) [4] The disadvantage of this strategy is that it might not produce the intended results when applied to sarcastic tweets since the placement of positive and negative terms results in different inferences. Secondly, A. Ishaq, S. Asghar, and S. A. Gillani [6] do not give an optimized solution, so we still try to provide an optimized solution. The F1-score is significantly less in the model studied so that we will increase the f1-score and overall accuracy. Social media data often contains noise, biases, and variations in language styles, impacting sentiment analysis. The paper might not adequately address how the combined approach handles these challenges inherent in analyzing unstructured text from platforms like Twitter. Addressing these research gaps could contribute to a more comprehensive and robust sentiment analysis methodology, ensuring its applicability across diverse domains and offering insights into nuanced sentiment expressions within social media text.
Proposed methodology
This paper presents a comprehensive approach to sentiment analysis applied to tweets within the airline industry, utilizing machine learning algorithms and regular expression techniques. Sentiment analysis is pivotal in understanding public perceptions and sentiments towards airlines, enhancing customer experiences and service quality. However, the inherent challenges of analyzing unstructured text data, particularly in social media, necessitate robust methodologies for accurate sentiment extraction. Our proposed methodology involves a hybrid approach merging machine learning algorithms and regular expression-based techniques. Machine learning models, such as Support Vector Machines (SVM), Naive Bayes, and Recurrent Neural Networks (RNN), are employed to categorize sentiments from tweets. Simultaneously, regular expressions are used to preprocess and extract specific patterns or expressions conveying sentiment nuances.
Regular expressions enhance preprocessing, isolating emoticons, intensifiers, negations, and other sentiment-indicative textual elements. These expressions complement the machine learning models by providing finer-grained contextual information, refining sentiment analysis accuracy. The study evaluates the proposed methodology on a large dataset of airline-related tweets, assessing the performance of various machine learning algorithms and the impact of regular expression-based preprocessing on sentiment classification accuracy. Results indicate that the combined approach demonstrates improved sentiment analysis precision and recall compared to standalone machine learning models. The amalgamation of machine learning algorithms and regular expression techniques offers a robust framework for sentiment analysis of airline tweets. This approach showcases promising results in discerning sentiment nuances within the airline industry, empowering airlines to comprehend customer sentiments better and enhance their services and customer experiences. Sentiment analysis of airline tweets using machine learning algorithms is a fascinating application that leverages AI to analyze the emotional tone behind customers’ opinions and experiences shared on social media platforms. This process involves using natural language processing (NLP) techniques to categorize tweets into positive, negative, or neutral sentiments based on the language used. Gathering a comprehensive dataset of tweets related to airline experiences is crucial. Tweets can be scraped from various platforms like Twitter, and then they need to be preprocessed. This involves tokenization, removing stop words, and handling emojis or slang terms that might convey sentiment. This paper proposes a Regular expression and Machine Learning method to improve the model’s accuracy. Here, we create a list of positive and negative sentiments using regular expressions. This List includes all the modern text abbreviations, slang, and emojis. We will start a flag for each view by looking at all patterns defined in the list. After the above step, we get a new dataset, and after applying the ML algorithm on a new dataset, we get better accuracy. We also aim to conduct a comparative study to display the actual difference in the classification when a Machine Learning algorithm is used.
Dataset pre-processing
The pre-processing of a dataset by removing unwanted data and noise. In the next step, we will do stemming and lemmatization of the dataset. Stemming is a process of extracting or removing the last characters of a word, which often leads to incorrect meanings and spelling. Lemmatization looks at the context and converts the word into its meaningful base form, called the lemma. Here, we will use Porter stemmer and Wordnet lemmatizer for the same. Now we will clean our dataset by removing abbreviations like @, #, *.%, $, &, etc.
One way to identify the most frequent word in a text or document is to use TF-IDF. This measure combines two separate metrics, TF and IDF, which are helpful when dealing with many records. The idea behind this measure is that words that are rare across all documents are more informative than words common in every paper. TF and IDF are computed using these formulas: where d is a document, N is the total number of documents, and df is how many documents contain the term t. TF-IDF scores indicate how relevant a word is for a given document. The scores tend to emphasize words that are unique to a specific document.
Classification
The last step of the method is to use the classifier chosen for this task, Multinomial Naive Bayes and Linear Regression with regular expression. This type of classifier can assign documents to categories based on a statistical analysis of their contents. It offers a more straightforward way to classify textual data than “heavy” AI-based semantic analysis. The Bayesian probability (
Bayesian Probability Formulae
The main idea behind the naïve Bayes is that all features in
The outcome that C
k is the class of
Transforming the text data into numerical features is essential for machine learning models. Techniques like TF-IDF (Term Frequency-Inverse Document Frequency) or word embeddings (Word2Vec or GloVe) can represent words numerically. Different machine learning algorithms can be employed for sentiment analysis, such as Naive Bayes, Support Vector Machines (SVM), Random Forest, or more complex models like Recurrent Neural Networks (RNNs). The selected model needs to be trained and validated on a ensure it can accurately predict sentiments. This involves splitting the dataset into training and testing sets and fine-tuning the model parameters for better performance. Metrics like accuracy, precision, recall, and F1-score are used to evaluate the model’s performance. Also, confusion matrices can help understand how well the model classifies sentiments. The flow of architecture is explained in Figs. 1 and 2, where it is shown where we begin after taking the dataset of airline review tweets. Pre-processing and morphological feature extraction are performed on this dataset. We try to remove the noise and unwanted data from the dataset. Next, we will use Porter stemming for keywords in the processed datasets. We use IF-TDF (term frequency-inverse document frequency) to check the importance or relevance of string representations (words, phrases, lemmas, etc.) in a dataset or text. Next, we will use a regular expression to list negative and positive comments and emojis. Further, we will flag our dataset tweets based on their positive or negative attributes. Next, we will train our model using Linear Regression and Multinomial Naive Bayes to categorize the text positively or negatively.

Stemming of words.

Sentimental analysis architecture.
Implementing the model in real-time to analyze incoming tweets allows airlines to monitor and promptly respond to customer sentiments Fig. 3. It aids in understanding customer satisfaction, identifying potential issues, and improving overall services. Several challenges in sentiment analysis include sarcasm, irony, context-based emotions, and language nuances. Handling these complexities requires advanced algorithms and continuous model improvement. Ensuring the ethical use of sentiment analysis is crucial. Respect for user privacy, avoiding biases in data and algorithms, and being transparent about data usage are essential. Models must be updated regularly to adapt to changing language trends, new phrases, and evolving customer sentiments. Sentiment analysis of airline tweets using machine learning algorithms offers airlines valuable insights into customer satisfaction levels, enabling them to enhance services, address grievances promptly, and build better customer relationships.

Sentimental analysis for social networking workflow.
The comprehensive analysis of sentiment extraction from airline-related tweets using a combined approach of machine learning algorithms and regular expression techniques yields several noteworthy observations and insightful discussions.
Table 1 shows the outcomes after applying the cleaning function.
Cleaning of data
Cleaning of data
The proposed model generated performed significantly better than earlier models. The multinomialNB and the models that we developed are contrasted.
MultinomialNB
Table 1 illustrates the cleaning functions, and its details are shown. Multinominal NB Hybrid approach comparisons before and after are shown in Table 2 and Table 3, respectively. The evaluation of the logistic regression result before and after the hybrid approach is illustrated in Tables 4 and 5.
Result before the hybrid approach
The result after the hybrid approach
Confusion Matrix:
Result before the hybrid approach
Confusion Matrix:
The result after the hybrid approach
Confusion Matrix:
In Table 6 illustrates the accuracy of the proposed system production and the positive sentiments in the Table.7 moreover, negative sentiments are shown in Table 8.
The current state of the art for MultinomialNB has an accuracy value of 0.82. However, our model shows an accuracy value of 0.86. For positive sentiment, see Figs. 5 and 6. displays a recall value of 0.52, significantly higher than the state-of-the-art value of 0.22 for MultinomialNB. Our model has an f1 score of 0.56, considerably higher than the state-of-the-art score of 0.35 for MultinomialNB.
Accuracy observed from highlighted algorithms
For positive sentiment
For negative sentiment

Confusion Matrix.

Evaluation Metric with performance measures for MultinomialNB.

Evaluation Metric with performance measures for MultinomialNB.
The amalgamation of machine learning algorithms, including Support Vector Machines (SVM), Naive Bayes, and Recurrent Neural Networks (RNN), with regular expression-based preprocessing noticeably enhances the precision of sentiment analysis. Incorporating regular expressions to isolate sentiment-indicative textual elements such as emoticons, intensifiers, and negations complements the machine learning models’ ability to discern nuanced sentiments.
The current state of the art for Logistic Regression has an accuracy value of 0.82. However, our model shows an accuracy value of 0.86. For positive sentiment, see Figs. 7 and 8. displays a recall value of 0.52, significantly higher than the state-of-the-art value of 0.22 for logistic regression. Our model has an f1 score of 0.56, considerably higher than the state-of-the-art score of 0.35 for Logistic Regression.

Evaluation Metric with performance measures for Logistic Regression.

Evaluation Metric with performance measures for Logistic Regression.
One of the notable observations pertains to the methodology’s effectiveness in enhancing contextual understanding within the limited space of tweets. The combination of machine learning models and regular expressions aids in capturing subtle nuances, sarcasm, and contextual cues often prevalent in social media conversations. This capability significantly contributes to a more nuanced and accurate sentiment analysis.
The methodology demonstrates robustness in handling unstructured text data, a common challenge in social media analysis. The regular expression-based preprocessing phase effectively filters noise and extracts sentiment-indicative patterns, addressing the inherent challenges of analyzing informal and condensed language typical of tweets. There is clear evidence that the proposed model has a positive and overall sentiment accuracy using a regular expression and machine learning hybrid model. The discussion also highlights the methodology’s adaptability within the domain-specific context of the airline industry. By focusing on airline-related tweets, the combined approach showcases its effectiveness in discerning sentiments unique to this industry, offering airlines valuable insights for service enhancement and customer satisfaction. The observed success of this approach in extracting sentiments from airline-related tweets suggests potential transferability to other industries or social media platforms. The robustness of contextual understanding and sentiment extraction hints at the methodology’s applicability beyond the airline industry, warranting further exploration in diverse domains.
Despite the promising results, certain limitations warrant consideration. The methodology’s performance might vary across different languages, cultural contexts, or evolving linguistic trends, suggesting avenues for future research to enhance its adaptability. Additionally, continuous advancements in machine learning techniques and evolving social media language necessitate ongoing refinement of this approach to maintain its efficacy. Its demonstrated precision, contextual understanding, and adaptability within the industry underscore its potential for facilitating informed decision-making and enhancing customer experiences.
Conclusion
This research article proposes a simple yet effective sentiment analysis method that combines positive and negative word scores to categorize tweets as Neutral, Negative, or Positive. This approach allows us to identify the user’s attitude and extract opinions from various sources, aiding business organizations in understanding user needs. To achieve this, we suggest a hybrid method combining supervised machine learning algorithms, such as MultinomialNB and linear regression, with natural language processing techniques. This combination enhances the accuracy of sentiment analysis and opinion mining across different domains. Our research did not fully explore methods like naïve Bayes and random forest. Hence, we aim to evaluate the feasibility of using MultinomialNB, linear regression, and regular expression for sentiment analysis of tweets on airlines. Our study also emphasizes the importance of high performance, error handling, and ease of use in the system. These functional requirements ensure the sentiment analysis model is efficient, minimizes errors, and provides a user-friendly experience. Additionally, it is observed to conduct a comparative study to showcase the actual difference in classification when a machine learning algorithm is used. This allows us to evaluate the accuracy of our model and compare it with other systems in the field. To preprocess the dataset, we employ techniques such as stemming and lemmatization to clean the data and improve the accuracy of the sentiment analysis model. Final evaluation to test the performance of our model using evaluation metrics such as accuracy, recall, and f1 score. These metrics comprehensively assess the model’s effectiveness in predicting sentiment. This article presents a sentiment analysis method that combines machine learning algorithms and regular expressions to categorize sentiment-based tweets accurately. This approach can potentially provide valuable insights for business organizations and researchers in understanding user opinions and needs.
