<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Classification Approach to Detect Public Sentiments towards COVID-19 Vaccines</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Karabo Johannes Ntwaagae</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nkwebi Peace Motlogelwa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Edwin Thuma</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tebo Leburu-Dingalo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gontlafetse Mosweunyane</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Botswana</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, team University of Botswana Computer Science (UBCS) investigate the opinions of Twitter users towards vaccine uptake. In particular, we build three diferent text classifiers to detect people's opinions and classify them as provax-for opinions that are for vaccination, antivax for opinions against vaccination and neutral-for opinions that are neither for or against vaccination. Two diferent datasets obtained from Twitter, 1 by Cotfas and the other by Fire2022 Organizing team were merged to and used for this study. The dataset contained 4392 tweets. Our first classifier was based on the basic BERT model and the other 2 were machine learning models, Random Forest and Multinomial Naive Bayes models. Naive Bayes classifier outperformed other classifiers with a macro-F1 score of 0.319.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Vaccination</kwd>
        <kwd>BERT classification</kwd>
        <kwd>Sentiment Analysis</kwd>
        <kwd>COVID-19</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In recent years, there has been rapid increase in internet access and usage all over the world.
This increase in internet access has resulted in large volumes of structured and unstructured data
being deposited on online repositories [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The increase in media sharing across multiple social
media platforms has sparked interest from researchers and policy makers across the globe on
mining and analyzing this data [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Twitter has been the mostly used platform for getting dataset
used to provide informative conclusions on whether people share similar views and behavior
on certain topics of interest. The increase in volume of this structured and unstructured data
comes with a challenge of mining and analyzing the mined data [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. To address this challenge,
researchers have developed and employed diferent techniques to deal with both mining the
data from social media platform and analyzing the data, of which sentiment analysis is one.
According to Catapang et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], sentiment analysis, a common natural language processing
task, has been done on several major topics such as politics, health, economy, vaccinations, and
sports to name but a few. Of recent, sentiment analysis has been done on studies that aimed
at analyzing people’s opinion on the outbreak of COVID-19. COVID-19 is a virus that causes
severe respiratory problems and was first detected in China, Wuhan Province in December 2019.
China was later hit hard by the virus while the rest of the world felt the immense impact of the
virus in early 2020. This outbreak was later declared a global pandemic by the World Health
Organization (WHO) in 2020. Since its outbreak, COVID-19 has claimed over 6.5 million lives
to date and the virus was detected in over 613 million people (positive cases) worldwide [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
As COVID-19 presented a greater threat to the entire population, countries all over the world
implemented some measures and restrictions on their people as a way of trying to reduce the
spread of the virus [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Some of the restrictions which included lockdowns and working from
home, resulted in a lot of internet users spending most of their time on their gadgets as a way
of reducing boredom, getting updates on the virus as well as sharing their views on diferent
social media platforms on issues relating to COVID-19. This availed lots of media on social
media platforms which was used by researchers to analyse the impact of the restriction on
the society as well as making recommendations on what could work to curb the spread of the
virus. Although the restrictions worked to some extent to reduce the spread, scientists and
doctors believed the most efective and fast way of reducing the pandemic is vaccination [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In
their study carried out in 2020, [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] argued that vaccinations are a way of developing immunity
against pandemics such as COVID-19 if the world reach herd immunity.
      </p>
      <p>
        For the world to attain herd immunity or break the spread of the COVID-19 pandemic, Trapman
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and Frontanet et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] highlighted that a vaccination rate of at least 65% to 67% must be
reached. According to the currents statistics reported in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], over 4.9 million people have been
fully vaccinated around the world, which makes up to 62% vaccination rate, 3% short of the
65% of attaining the herd immunity. The society has since had diferent views on vaccinations
which resulted in the slow rollout due to diferent reason ranging from politics to the safety of
the vaccines. The hesitancy to take vaccines may lead to the pandemic taking years to end as
countries are continuing to record new cases daily. This paper aims to analyze the opinions of
the public on COVID-19 vaccines by considering the data collected from Twitter (provided by
the FIRE2022 organizing team). The tweets were then classified using the basic BERT model
with Hugging face, random forest technique and Naïve Bayes technique.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        Sentiments Analysis is becoming a widely used natural language processing technique to mine
people’s opinions from diferent media sharing platforms. It has been used in many social issues
in the past to cope with mining people’s opinions from text [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Kitchat et al. [10] defines
sentiments analysis as a natural language processing technique used to mine the people’s
opinions or the underlying tone of the given data. Due to its wide usage, various sentiment
analysis methods have been developed to analyse the data mined from diferent social media
platforms. In previous studies, sentiment analysis has been used to get people’s opinions on
diferent social issues such as the perception of economic weakening, measuring the impact of
movement bans on society, measuring the desire to stock products under the pandemic and the
vaccination of children to mention a few [
        <xref ref-type="bibr" rid="ref3 ref6">3, 6</xref>
        ].
      </p>
      <p>A study by Machucha et al. [11] used sentiment analysis to get the people’s general opinions
on corona virus using binary logistic regression. They classified the sentiments as positive
and negative only. After extracting the data, they preprocessed it by removing all punctuation
marks, transforming each tweet to lowercase and tokenizing tweets to facilitate the removal of
non-English words and stopwords. The tweets were stemmed and rejoined. TF-IDF vectorizer
was used for vectorization in this study. When the evaluated the performance of their classifier,
they obtained a classification accuracy of 78.5%.</p>
      <p>Delizo et al. [12] conducted a study that uses sentiment analysis to examine the polarity of
COVID-19 related opinions on Twitter using Multinomial Naïve Bayes algorithm, targeting
tweets from Philippines. Their preprocessing stage included removing special characters,
hyperlinks, hashtags and mentions, and removing tweets containing less than 2 words and
less than 3 characters from each tweet. 10% of the cleaned tweets was manually labelled as
either positive or negative Words were then converted to their lowercase equivalents. TF-IDF
vectorizer was used for feature extraction from the training data. Multinomial Naïve Bayes
algorithm was employed to test the efectiveness of the proposed it achieved an overall accuracy
score of 72%.</p>
      <p>
        The study of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] focused on using aspect-base twitter sentiment analysis to classify the
society’s views on the vaccination and determine which vaccine type is preferred by the public
from 8 countries being USA, UK, Canada, Turkey, France, Germany, Spain and Italy. They
used TF-IDF and word2Vec applications to determine the aspects from the datasets and used 4
diferent BERT models (i.e mBERT-base, BioBERT, ClinicalBERT and BERTurk) for classification.
In their evaluation, they reported F1 scores of between 84% and 88% with a classification accuracy
of 87%. The vaccine type that received less negative sentiment was Novavax, developed by
Pfizer/BioNTech.
      </p>
      <p>
        In another study that aims to use sentiment analysis to analyses people’s opinions on
COVID19 vaccine, Trapman [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] focused on using sentiment analysis to map the determinants of
COVID-19 vaccine uptake from mining Twitter data. They focused on determining whether the
5As (based on a study by Thompson et al. [13]) being Afordability, Awareness, Acceptance,
Activation and Access together with the addition of the sixth A, Assurance, could directly
cover and organize all the determinants identified from tweets regarding COVID-19 vaccine
uptake using the bottom-up approach. The dataset used in this study was collected from
people’s tweets using the Qualitative Data Analysis (QDA) software. The dataset put together
by choosing keywords related to COVID-19 vaccines and combining them into an OR query.
After preprocessing data, topic modelling was performed using WordStat software and a 33-topic
model was seen as optimal, described by top-weighted keywords. In their final step, the authors
linked the 17 determinants with the 6As. Their results indicate that the 6A taxonomy was
successful in capturing all the determinants of COVID-19 uptake.
      </p>
      <p>The study by Kitchat et al. [10] also used sentiment analysis to investigate people’s opinions
from tweets in New York City. Keywords relating to COVID-19 vaccines were used to filter out
relevant tweets. To further filter out relevant tweets, the location from which the tweets were
from was also specified and in this study, New York City was specified as the location of tweets.
After collecting the data, they cleaned the data by removing hashtags, punctuation marks, URLs,
emojis stopwords (through tokenization) and converting all letters to lowercase. The tweets
were stemmed and rejoined after tokenization. The tweets were classified as positive, negative
and neutral. To test the performance of the proposed system, they used 6 machine learning
models, namely, Random Forest, Decision Trees, Support Vector Machine (SVM), Naïve Bayes,
Logistic Regression and Multi-Layer Perceptron (MLP). According to their results, all machine
learning models used performed exceptionally well, giving an accuracy of over 90% except for
Naïve Bayes which registered an accuracy of 82.13%. Multi-Layer Perceptron model performed
better than all other models, with an accuracy of 93.63</p>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology</title>
      <p>In this Section, we present our BERT and machine learning approaches for classifying tweets into
three classes, namely: ProVax, AntiVax and Neutral. AntiVax indicates that there is hesitancy in
the tweet (of the user who posted the tweet) towards the use of vaccines. Neutral indicates that
the tweet does not have any discernible sentiment expressed towards vaccines or is not related
to vaccines. We propose using the basic BERT classifier and 2 machine learning classifiers
provided by scikit-learn library 1, namely, Multinomial Naive Bayes classifier, which is a Nave
Bayes variant used in text classification in python as well as the Random forest classifier.</p>
      <sec id="sec-3-1">
        <title>3.1. Training Dataset</title>
        <p>The training dataset was pre-processed to make it compatible with machine learning models
and BERT model by converting words to numbers which are easily understood by the models.
In addition, the following pre-processing steps were applied to the main dataset:
• For the BERT experiment, BERTokenizer provided by the Transformer library was used
to convert the tweets into tokens and tokenIDs.
• For the machine learning algorithms, the Tfidf Vectorizer from scikit-learn library was
employed to perform feature extraction from the training as well as stopwords removal.
• The training data was stemmed and rejoined.</p>
        <p>• Hashtags and mentions not removed, as well as punctuations not removed.</p>
        <p>The training dataset contains 4392 tweets. The dataset was obtained from Twitter by diferent
teams as follows:
• Cotfas dataset: Crawled from Twitter between November-December 2020. 2792
tweettexts were crawled along with tweetIDs and labels (proVax, neutral, antiVax). This crawled
data formed the first part of the training data.
• IRMiDis Fire2022 organizing team dataset: Tweets crawled from March to December
2020. Tweets were annotated with three labels by crowdworkers. A total of 1600 tweets
were crawled, and this formed the second part of the training data.</p>
        <p>Of this 4392 tweets, 1676 are provax, 1081 are antivax and 1635 are neutral. During training,
the training dataset was subdivided such that 3952 tweets train our classification models and
440 tweets are used for validation.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Testing Dataset</title>
        <p>The same pre-processing done in the training dataset was performed on the test data set, except
for pre-processing that deals with labelling the tweets as provax, neutral and antivax.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Description of Runs</title>
      <p>We submit 3 runs for: Task 1: COVID-19 vaccine stance classification from tweets. Below is a
brief description of each run:
4.1. Run 1 - UBCS
This is our baseline run. We used BERT model to build a BERT classifier for the identification
of sentiments. Since BERT works with fixed-length sequences, we set a maximum length for
the sequences, guided by the number of tokens in the tweets. Most tweets seemed to contain
less than 140 tokens and we then set our maximum length to 150 to allow for tweets that may
be longer than the ones we used for training during testing. We also set the batch size to be
16 because 16 and 32 are recommended by BERT authors as the best sizes for fine tuning the
model. We built our sentiment classifier on top of the basic BertModel. In our classifier, we used
a dropout layer for some regularization and a fully connected layer for our output. . Both the
training and test dataset underwent the same pre-processing steps as described in Section 3.1.
4.2. Run 2 - UBCS and Run 3 - UBCS
In these runs, we used the Random Forest and Multinomial Naïve Bayes models respectively.
We vectorized our tweets into numbers using TFIDFVectorizer. We defined variable X, to hold
all the features to be used in predictions while variable y holds the labels. We then imported the
Machine Learning models, Random Forest and Multinomial Naives Bayes (an implementation of
Naïve Bayes algorithm in scikit-learn), from scikit-learn library using their default parameters.
For all the three runs, we divided the data into training data(90% of the data), validation data(10%).
Data loaders for the 3 sets of data were created for each set of data.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Results and Analysis</title>
      <p>In this paper, we employ diferent text classifiers and compare their performance to determine
the best classifier among them. Table 1 presents the results of our investigation. Run 3 - UBCS
is our best run as it performed better than all the other runs in all the evaluation metrics, with a
Macro F1 score and Accuracy of 0.319 and 0.337 respetively.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Discussion and Conclusion</title>
      <p>The results of our investigation suggests no significant diference in the performance of the
diferent classifiers used in this study. The results might have been afected by not preprocessing
data further and not converting the emojis to text. A study by [14], suggest that BERT based
models produce better performance as BERT is empirical and a powerful tool. This is also
evidenced by the overall performance of teams that used BERT models in the previous studies.
Further work needs to be carried out in order to determine whether emojis can significantly
improve the classification accuracy when building a classifier to detect the opinions of Twitter
users towards vaccine uptake. A further study with more focus on the efects of stopword
removal and semantic enrichment of tweets when build classifiers to detect people’s opinions is
also recommended.
[10] K. Kitchat, K. Limjumroonrat, T. Surasak, Twitter sentiment analysis towards covid-19
vaccines: A case study in new york city, in: 2021 IEEE 2nd International Conference on
Technology, Engineering, Management for Societal impact using Marketing,
Entrepreneurship and Talent (TEMSMET), IEEE, 2021, pp. 1–6.
[11] C. R. Machuca, C. Gallardo, R. M. Toasa, Twitter sentiment analysis on coronavirus:
Machine learning approach, in: Journal of Physics: Conference Series, volume 1828, IOP
Publishing, 2021, p. 012104.
[12] J. P. D. Delizo, M. B. Abisado, M. I. P. De Los Trinos, Philippine twitter sentiments during
covid-19 pandemic using multinomial naïve-bayes, International Journal 9 (2020).
[13] A. Thomson, K. Moon, G. Vallee-Tourangeau, The 5as: A practical taxonomy for the
determinants of vaccine uptake, Vaccine 34 (2015). doi:10.1016/j.vaccine.2015.11.
065.
[14] J. Devlin, M. Chang, K. Lee, K. Toutanova, BERT: pre-training of deep bidirectional
transformers for language understanding, in: J. Burstein, C. Doran, T. Solorio (Eds.),
Proceedings of the 2019 Conference of the North American Chapter of the Association
for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019,
Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), Association for
Computational Linguistics, 2019, pp. 4171–4186. URL: https://doi.org/10.18653/v1/n19-1423.
doi:10.18653/v1/n19-1423.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Woldemariam</surname>
          </string-name>
          ,
          <article-title>Sentiment analysis in a cross-media analysis framework</article-title>
          ,
          <source>in: 2016 IEEE International Conference on Big Data Analysis (ICBDA)</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . doi:
          <volume>10</volume>
          .1109/ ICBDA.
          <year>2016</year>
          .
          <volume>7509790</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>D.</given-names>
            <surname>Yeung</surname>
          </string-name>
          ,
          <article-title>Social media as a catalyst for policy action and social change for health and well-being: Viewpoint</article-title>
          ,
          <source>Journal of Medical Internet Research</source>
          <volume>20</volume>
          (
          <year>2018</year>
          )
          <article-title>e94</article-title>
          . doi:
          <volume>10</volume>
          .2196/ jmir.8508.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J. K.</given-names>
            <surname>Catapang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. V.</given-names>
            <surname>Cleofas</surname>
          </string-name>
          ,
          <article-title>Topic modeling, clade-assisted sentiment analysis, and vaccine brand reputation analysis of covid-19 vaccine-related facebook comments in the philippines</article-title>
          ,
          <source>in: 2022 IEEE 16th International Conference on Semantic Computing (ICSC)</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>123</fpage>
          -
          <lpage>130</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICSC52841.
          <year>2022</year>
          .
          <volume>00026</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4] WorldoMeter, Covid live - coronavirus statistics - worldometer
          <year>2022</year>
          ,
          <year>2022</year>
          . URL: https: //www.worldometers.info/coronavirus.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>I.</given-names>
            <surname>Aygun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Kaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kaya</surname>
          </string-name>
          ,
          <article-title>Aspect based twitter sentiment analysis on vaccination and vaccine types in covid-19 pandemic with deep learning</article-title>
          ,
          <source>IEEE Journal of Biomedical and Health Informatics</source>
          <volume>26</volume>
          (
          <year>2022</year>
          )
          <fpage>2360</fpage>
          -
          <lpage>2369</lpage>
          . doi:
          <volume>10</volume>
          .1109/JBHI.
          <year>2021</year>
          .
          <volume>3133103</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Baj-Rogowska</surname>
          </string-name>
          ,
          <article-title>Mapping of the covid-19 vaccine uptake determinants from mining twitter data</article-title>
          ,
          <source>IEEE Access 9</source>
          (
          <year>2021</year>
          )
          <fpage>134929</fpage>
          -
          <lpage>134944</lpage>
          . doi:
          <volume>10</volume>
          .1109/ACCESS.
          <year>2021</year>
          .
          <volume>3115554</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Trapman</surname>
          </string-name>
          ,
          <article-title>Review 2: "Herd immunity thresholds for SARS-CoV-2 estimated from unfolding epidemics"</article-title>
          , Rapid
          <string-name>
            <surname>Reviews</surname>
          </string-name>
          COVID-
          <volume>19</volume>
          (
          <year>2020</year>
          ). Https://rapidreviewscovid19.mitpress.mit.edu/pub/bat0d0fq.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Fontanet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Cauchemez</surname>
          </string-name>
          , Covid-19
          <source>herd immunity: where are we?</source>
          ,
          <source>Nature Reviews Immunology</source>
          <volume>20</volume>
          (
          <year>2020</year>
          )
          <fpage>583</fpage>
          -
          <lpage>584</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>H.</given-names>
            <surname>Ritchie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Mathieu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Rodés-Guirao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Appel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Giattino</surname>
          </string-name>
          ,
          <source>Coronavirus (covid-19) vaccinations</source>
          ,
          <year>2020</year>
          . URL: https://ourworldindata.org/covid-vaccinations?country=OWID_ WRL.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>