2227-Article Text-12723-1-18-20221119
2227-Article Text-12723-1-18-20221119
Corresponding Author:
Supangat,
Department of Informatics Engineering,
Universitas 17 Agustus 1945 Surabaya.
Email: [email protected]
analysis is to categorize polarity or textual elements found in sentences or documents and identify the
viewpoint being expressed [4].
A previous study by [5] used Naive Bayes to map the keywords and sentiment of Twitter users toward a
product's halalness. It divided the polarity into three categories: positive, neutral, and negative. Out of a total
of 967 tweets, there were 682 (70%) tweets with positive responses, 135 (14%) tweets with negative
responses, and 150 (16%) tweets with neutral responses.
Furthermore, the employment of multinomial discriminative methods of Naive Bayes and TF-IDF
enhanced accuracy by 0.3%, according to the data [6]. Using the Nave Bayes technique, we observed a high
categorization accuracy of 91 percent for short Tweets. We also discovered that the logistic regression
categorization algorithm provides 74 % decent accuracy with shorter Tweets [7]. We classify Twitter's
sentiment data by displaying machine learning results using the Naive Bayes technique. Even though it takes
longer than the listing technique, this algorithm can generate reasonably accurate estimations [8]. The Naïve
Bayes and decision tree approaches were compared in this study. With 73.59 % accuracy, Nave Bayes
outperformed Decision Tree [9].
The Naive Bayes, Support Vector Machine, and Maximum Entropy methods were compared in this
study. Max Entropy possessed an accuracy value of 82.6% and a precision value of 84.0536512%, whereas
Naive Bayes possessed an accuracy value of 86% and a precision value of 88.695952 percent., SVM had an
accuracy value of 74.6 percent and a precision value of 75.88235235 percent, and SVM had an accuracy
value of 74.6 percent and a precision value of 75.88235235 percent. According to the study, the most
accurate machine learning methods are Naive Bayes. They are considered fundamental learning approaches,
although the Maximum Entropy method is useful in some situations [10]. Based on statistical data, the goal
of this work was to identify a machine learning strategy that was relatively better than SVM and Naive Bayes
classifiers. The system achieves 82.853 percent precision, 82.884 percent recall, and 82.662 percent f1 score
for SVM classifiers.
Since 1950, Nave Bayes has been widely employed for document classification [10]. However, Naive
Bayes classifiers are built on too simplistic assumptions of conditional probability and data distribution shape
[11], [12]. Data from has also been utilized extensively for crisis analysis and tracking, including pandemic
analysis [13]. The application is built utilizing the Python and PHP programming languages. This
investigation yielded an accuracy rating of 91.67 percent [14].
Previous research [15] compared the selection of features using BOW and TF-IDF. TF-IDF is one of the
selection features that includes information other than the frequency of word occurrences, unlike BOW.
However, TF-IDF also analyzes the document's most and least significant terms. The conclusion is that TF-
IDF is superior to BOW, hence TF-IDF is utilized to choose features in this study.
With the implementation of government policies related to Covid-19, many public responses, some
have positive opinions, and some have negative opinions, especially on Twitter, where people are free to
express their opinions. Based on this discussion, the author tries to conduct research on opinion sentiment
analysis on Twitter in implementing government policies related to Covid-19 using Naive Bayes. The Naive
Bayes algorithm demonstrated superior performance against competing algorithms and feature weighting
using TF-IDF in previous studies. to support the naive bayes algorithm in increasing accuracy to classify
opinions from the public on Twitter social media which is built using python language. Commented [L3]: - Penelitian ini permasalahanya tidak
spesifik apa yang menjadi konsen untuk diberikan solusi.
2. RESEARCH METHOD -Penelitian sebelumnya sudah dijelaskan diparagraf sebelumnya
dan sudah menggunakan kombinasi beberapa metode data
The stages of the research process carried out in this study are described in a research methodology flow mining, sehingga kebaruan/novelty penelitian ini tidak
as shown in Figure 1. tampak..apa yang menjadi kesenjangan dari penelitian ini
dibanding penelitian sebelumnya tidak terlihat, untuk di teliti dan
dikembangkan lebih lanjut.
Commented [HM4]: On the methodology, the authors have not
explained in detail the method of labeling data into positive,
negative and neutral classes.
Table 1. Case Folding Commented [L5]: Isi tabel sulit untuk ditafsirkan…buat
Output Text sesuaikan dengan template dan rapikan
Input Text
@ZaskiaWulanda13 : Khofifah menjdi @ZaskiaWulanda13: khofifah menjadi
pembicara Sharing Session Penanggulangan pembicara sharing session penanggulangan
Covid - 19 yang digelar oleh GATRA Media covid - 19 yang digelar oleh gatra media group
Group bersama Satgas Penanganan Covid - 19 [ bersama satgas penanganan covid – 19 [
Gubernur Jatim ] gubernur jatim ]
b. Tokenizing
The tokenizing stage is then utilized to break down the sentences in the string into single-word
chunks. An example of the tokenizing stage can be seen in Table 2.
Table 2. Tokenizing
Input Text Output Text
khofifah menjadi pembicara sharing session khofifah | menjadi | pembicara | sharing | session
penanggulangan covid yang digelar oleh gatra | penanggulangan | covid | yang | digelar | oleh |
media group bersama satgas penanganan covid gatra | media | group | bersama | satgas |
gubernur jatim penanganan | covid | gubernur | jatim
diketahui bahwa gubernur khofifah menjadi diketahui | bahwa | gubernur | khofifah | menjadi
pembicara sharing session penanggulangan | pembicara | sharing | session | penanggulangan |
covid gubernur jatim covid | gubernur | jatim
sharing session penanggulangan covid akan sharing | session | penanggulangan | covid | akan
dibicarakan oleh gubernur | dibicarakan | oleh | gubernur
c. Stopword
At this stage, the disposal of words that are less important or words that often appear (Stopwords),
such as connecting words and adverbs that are not unique words, such as "sebuah", "oleh", "pada",
and so on. The stop words in this investigation were generated using a modified Sastrawi library
[20]. Table 4.3 provides an illustration of the stopword stage.
Table 3. Stopword
Tokenizing Result Stopword Result
d. Stemming
The stemming stage removes affixes, prefixes, and suffixes to change the words back to their
original form.
Table 4. Stemming
Stopword Result Stemming Result
Word weighting is used in news classification to determine a category. TF-IDF (Term Frequency–
Inverse Document Frequency) is one of the weighting methods. Its weight value expresses the
importance of a word (term) in representing the title. The weight will be more significant in the TF-
IDF weighting if the frequency of occurrence of the term is higher. However, it will be lower if the
word appears more frequently in other news.
3. Planning
At this stage, a design for the distribution of training data and test data will be made based on the
dataset that has been obtained. Because the dataset obtained was 1000 tweets in this study, this study
will try to compare three datasets, namely 70%-30%, 80%-20%, and 90%-10%, based on references in
previous studies.
4. Implementation
At this stage, according to the collected data, it is made into a web-based application using the Naïve
Bayes algorithm with the TF-IDF weighting feature using the python language. Commented [L6]: Bagaimana metode Naïve Bayes diterapkan
5. Testing dalam penelitian ini..? perlu di jelaskan Algoritmanya.
In the last stage, the training dataset was tested by looking at the level of accuracy generated by the
training from each experiment. Then perform sentiment analysis based on available data and calculate
the level of precision, recall, and accuracy using a confusion matrix.
The object of this research is community Twitter data related to the community's response to the Covid-
19 response in Indonesia. There are three classification classes, namely negative, positive and neutral
sentiments. The dataset is taken through a web scraping process to get data from Twitter social media. The
following is a labeled dataset used in this study which can be seen in table 1.
In this study, the analysis was carried out by dividing the training data and testing data into three
categories to test a good level of accuracy for sentiment classification with 1000 datasets, namely 70%-30%,
80%-20%, 90%-10%.
3. RESULTS AND ANALYSIS Commented [HM7]: In the results and analysis there must be a
A total of 1000 data points are classified as either positive, negative, or neutral. Using the confusion reference cited as a comparison/analysis of the relevance of the
matrix method, the data that has been normalized before being entered into the classification engine is findings with previous research which also discusses the analysis of
public sentiment towards government policies related to COVID-19.
separated into three experiments, namely
• 700 data for training and 300 data for testing, utilizing the confusion matrix method.
• 800 data for training and 200 data for testing, utilizing the confusion matrix method
• 900 data for training and 100 data for testing, utilizing the confusion matrix method.
From table 2, the results of the experiment of several dataset distributions show that the comparison of
70%-30% datasets shows the most excellent accuracy value compared to the distribution of 80%-20% and
90%-10% datasets. Therefore, in this study, what will be used for calculating the confusion matrix, precision,
recall, and f-score is a dataset with a division of 70% as training data and 30% as test data.
Table 3. describes the results of data acquisition and then, through preprocessing 1000 existing data,
divided into three sentiments, namely category one is positive, category 2 is neutral, and category 3 is
harmful. The data that has been normalized before being entered into the classification engine is separated
into training data and test data.
Based on calculations using a confusion matrix, this study resulted in Sentiment Analysis using DMNB
and TF-IDF on Twitter regarding the Covid-19 response into 3 categories, namely positive, neutral, and
negative with positive sentiment as much as 28.7%, neutral as much as 43.9%, and negative as much as
27.4%. Then it will use the formula and look for precision, recall, accuracy and f-1 measure values to
determine the classification results with the following formula [6]:
𝑇𝑃
𝑃𝑟𝑒𝑐𝑖𝑠𝑠𝑖𝑜𝑛 = (1)
𝑇𝑃+𝐹𝑃
𝑇𝑃
𝑅𝑒𝑐𝑎𝑙𝑙 = (2)
𝑇𝑃+𝐹𝑁
𝑇𝑃+𝑇𝑁
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 = 𝑋100% (3)
𝑇𝑃+𝐹𝑃+𝑇𝑁+𝑇𝑁
𝑝𝑟𝑒𝑐𝑖𝑠𝑠𝑖𝑜𝑛+𝑟𝑒𝑐𝑎𝑙𝑙
𝐹1 − 𝑀𝑒𝑎𝑠𝑢𝑟𝑒 = 2𝑥 (4) Commented [L8]: Dibagian hasil harusnya sudah memberikan
𝑝𝑟𝑒𝑐𝑖𝑠𝑠𝑖𝑜𝑛+𝑟𝑒𝑐𝑎𝑙𝑙 penjelasan pengolahan datanya, bukan menjelaskan rumus. Rumus
harusnya di ulas dibagian metode dan didiskripsikan sesuai fungsi
The outcomes of additional evaluation measures for negative, neutral, and positive tweets are presented rumusnya.
in Table 4.
According to Tables 3 and 4, the Naive Bayes classifier has a recall measure of 0.71 for negative tweets,
0.87 for neutral tweets, and 0.70 for positive tweets. In addition, the experiment achieves 0.77 average
weighted precision, 0.76 average weighted recall, and 0.76 average weighted f-score. This study
demonstrates that the precision of sentiment analysis is 76%.
[6] H. Alsalman, “An Improved Approach for Sentiment Analysis of Arabic Tweets in Twitter Social
Media,” ICCAIS 2020 - 3rd International Conference on Computer Applications and Information
Security, pp. 23–26, 2020, doi: 10.1109/ICCAIS48893.2020.9096850.
[7] J. Samuel, G. G. M. N. Ali, M. M. Rahman, E. Esawi, and Y. Samuel, “COVID-19 public sentiment
insights and machine learning for tweets classification,” Information (Switzerland), vol. 11, no. 6, pp.
1–22, 2020, doi: 10.3390/info11060314.
[8] M. Alshaikh and M. Zohdy, “Sentiment Analysis for Smartphone Operating System: Privacy and
Security on Twitter Data,” IEEE International Conference on Electro Information Technology, vol.
2020-July, pp. 366–369, 2020, doi: 10.1109/EIT48999.2020.9208303.
[9] I. C. Sari and Y. Ruldeviyani, “Sentiment Analysis of the Covid-19 Virus Infection in Indonesian
Public Transportation on Twitter Data: A Case Study of Commuter Line Passengers,” pp. 23–28,
2020, doi: 10.1109/iwbis50925.2020.9255531.
[10] L. Mandloi and R. Patel, “Twitter sentiments analysis using machine learninig methods,” 2020
International Conference for Emerging Technology, INCET 2020, pp. 1–5, 2020, doi:
10.1109/INCET49848.2020.9154183.
[11] K. Kowsari, K. J. Meimandi, M. Heidarysafa, S. Mendu, L. Barnes, and D. Brown, “Text
classification algorithms: A survey,” Information (Switzerland), vol. 10, no. 4, 2019, doi:
10.3390/info10040150.
[12] A. H. Alamoodi et al., “Sentiment analysis and its applications in fighting COVID-19 and infectious
diseases: A systematic review,” Expert Systems with Applications, p. 114155, 2020, doi:
10.1016/j.eswa.2020.114155.
[13] J. Samuel, Md. M. Rahman, G. G. Md. N. Ali, Y. Samuel, and A. Pelaez, “Feeling Like it is Time to
Reopen Now? COVID-19 New Normal Scenarios Based on Reopening Sentiment Analytics,” SSRN
Electronic Journal, no. May, 2020, doi: 10.2139/ssrn.3604802.
[14] E. D. Sri Mulyani, D. Rohpandi, and F. A. Rahman, “Analysis of Twitter Sentiment Using the
Classification of Naive Bayes Method about Television in Indonesia,” 2019 1st International
Conference on Cybernetics and Intelligent System, ICORIS 2019, vol. 1, no. August, pp. 89–93,
2019, doi: 10.1109/ICORIS.2019.8874896.
[15] V. L. Nguyen, D. Kim, V. P. Ho, and Y. Lim, “A new recognition method for visualizing music
emotion,” International Journal of Electrical and Computer Engineering, vol. 7, no. 3, pp. 1246–
1254, 2017, doi: 10.11591/ijece.v7i3.pp1246-1254.
[16] S. Efendi and P. Sihombing, “Sentiment Analysis of Food Order Tweets to Find Out Customer
Demographic Profile using SVM,” vol. 21, no. 3, pp. 583–594, 2022, doi:
10.30812/matrik.v21i3.1898.