SlowGuess/NAACL_2022_OCR huggingface dataset:
Lixing Zhu $^{1}$ , Zheng Fang $^{1}$ , Gabriele Pergola $^{1}$ , Rob Procter $^{1,2}$ , Yulan He $^{1,2}$
$^{1}$ Department of Computer Science, University of Warwick, UK
2The Alan Turing Institute, UK
{lixing.zhu,z.fang.4,gabriiele.pergola.1}
rob.procter,yulan.he}@warwick.ac.uk
Building models to detect vaccine attitudes on social media is challenging because of the composite, often intricate aspects involved, and the limited availability of annotated data. Existing approaches have relied heavily on supervised training that requires abundant annotations and pre-defined aspect categories. Instead, with the aim of leveraging the large amount of unannotated data now available on vaccination, we propose a novel semi-supervised approach for vaccine attitude detection, called VADET. A variational autoencoding architecture based on language models is employed to learn from unlabelled data the topical information of the domain. Then, the model is fine-tuned with a few manually annotated examples of user attitudes. We validate the effectiveness of VADET on our annotated data and also on an existing vaccination corpus annotated with opinions on vaccines. Our results show that VADET is able to learn disentangled stance and aspect topics, and outperforms existing aspect-based sentiment analysis models on both stance detection and tweet clustering. Our source code and dataset are available at http://github.com/somethingx1202/VADet.
The aim of vaccine attitude detection in social media is to extract people's opinions towards vaccines by analysing their online posts. This is closely related to aspect-based sentiment analysis in which both aspects and related sentiments need to be identified. Previous research has been largely focused on product reviews and relied on aspect-level sentiment annotations to train models (Barnes et al., 2021), where aspect-opinions are extracted as triples (Peng et al., 2020), polarized targets (Ma et al., 2018) or sentiment spans (He et al., 2019). However, for the task of vaccine attitude detection on Twitter, such a volume of annotated data is barely available (Kunneman et al., 2020; Paul et al.,
The AstraZeneca one is rough for up to 48 hours; after that you may still be a bit swollen but you'll basically feel fine. I've had that and the virus, and the vaccine is far less unpleasant.
Have felt for the past 24 hours that I've been run over by three double decker buses after the AstraZeneca vaccine yesterday morning. Starting to feel a little normal now but it's not been nice!
This is quite baffling. I got my second Pfizer vaccine last week and I have gone totally off chocolate! As side effects go, it's not so bad.
There are some very interesting ties between this vaccines creators and the eugenics movement which is concerning considering it's mainly been promoted as a vaccine for poor folks in the third world.
Figure 1: Top: Expressions of aspects entangled with expressions of opinions. Bottom: Vaccine attitudes can be expressed towards a wide range of aspects/topics relating to vaccination, making it difficult to pre-define a set of aspect labels as opposed to corpora typically used for aspect-based sentiment analysis.
2021). This scarcity of data is compounded by the diversity of attitudes, making it difficult for models to identify all aspects discussed in posts (Morante et al., 2020).
As representative examples, consider the two tweets about personal experiences for vaccination at the top of Figure 1. The two tweets, despite addressing a common aspect (vaccine side-effects), express opposite stances towards vaccines. However, the aspect and the stances are so fused together that the whole of the tweets need to be considered to derive the proper labels, making it difficult to disentangle them using existing methodologies. Additionally, in the case of vaccines attitude analysis, there is a wide variety of possible aspects discussed in posts, as shown in the bottom of Figure 1, where one tweet ironically addressed vaccine side-effects and the second one expressed instead specific political concerns. This is different from traditional aspect-based sentiment analysis on product reviews where only a small number of aspects need to be pre-defined.
The recently developed framework for integrating Variational Auto-Encoder (VAE) (Kingma and
Human Language Technologies, pages 1566 - 1580
Welling, 2014) and Independent Component Analysis (ICA) (Khemakhem et al., 2020) sheds light on this problem. VAE is an unsupervised method that can be used to glean information that must be retained from the vaccine-related corpus. Meanwhile, a handful of annotations would induce the separation of independent factors following the ICA requirement for prior knowledge and inductive biases (Hyvarinen et al., 2019; Locatello et al., 2020a,b). To this end, we could disentangle the latent factors that are either specific to the aspect or to the stance, and improve the quality of the latent semantics learned from unannotated data.
We frame the problem of vaccine attitude detection as a joint aspect span detection and stance classification task, assuming that a tweet, which is limited to 280 characters, would usually only discuss one aspect. In particular, we extend a pretrained language model (LM) by adding a topic layer, which aims to model the topical theme discussed in a tweet. In the absence of annotated data, the topic layer is trained to reconstruct the input message built on VAE. Given the annotated data, where each tweet is annotated with an aspect span and a stance label, the learned topic can be disentangled into a stance topic and an aspect topic. The stance topic is used to predict the stance label of the given tweet, while the aspect topic is used to predict the start and the ending positions of the aspect span. By doing so, we can effectively leverage both unannotated and annotated data for model training.
To evaluate the effectiveness of our proposed model for vaccine attitude detection on Twitter, we have collected over 1.9 million tweets relating to COVID vaccines between February and April 2021. We have further annotated 2,800 tweets with both aspect spans and stance labels. In addition, we have also used an existing Vaccination Corpus<sup>1</sup> in which 294 documents related to the online vaccination debate have been annotated with opinions towards vaccination. Our experimental results on both datasets show that the proposed model outperforms existing opinion triple extraction model and BERT QA model on both aspect span extraction and stance classification. Moreover, the learned latent aspect topics allow the clustering of user attitudes towards vaccines, facilitating easier discovery of positive and negative attitudes in social media. The contribution of this work can be summarised as follows:
- We have proposed a novel semi-supervised approach for joint latent stance/aspect representation learning and aspect span detection;
- The developed disentangled representation learning facilitates better attitude detection and clustering;
- We have constructed an annotated dataset for vaccine attitude detection.
Our work is related to three lines of research: aspect-based sentiment analysis, disentangled representation learning, and vaccine attitude detection.
Aspect-Based Sentiment Analysis (ABSA) aims to identify the aspect terms and their polarities from text. Much work has been focusing on this task. The techniques used include Conditional Random Fields (CRFs) (Marcheggiani et al., 2014), Bidirectional Long Short-Term Memory networks (BiLSTMs) (Baziotis et al., 2017), Convolutional Neural Networks (CNNs) (Zhang et al., 2015b), Attention Networks (Yang et al., 2016; Pergola et al., 2021b), DenseLSTMs (Wu et al., 2018), NestedLSTMs (Moniz and Krueger, 2017), Graph Neural Networks (Zhang et al., 2019) and their combinations (Wang et al., 2018; Zhu et al., 2021; Wan et al., 2020), to name a few.
Zhang et al. (2015a) framed this task as text span detection, where they used text spans to denote aspects. The same annotation scheme was employed in (Li et al., 2018b), where intra-word attentions were designed to enrich the representations of aspects and predict their polarities. Li et al. (2018c) formalized the task as a sequence labeling problem under a unified tagging scheme. Their follow-up work (Li et al., 2019) explored BERT for end-to-end ABSA. Peng et al. (2020) modified this task by introducing opinion terms to shape the polarity. A similar modification was made in (Zhao et al., 2020) to extract aspect-opinion pairs. Position-aware tagging was introduced to entrench the offset between the aspect span and opinion term (Xu et al., 2020). More recently, instead of using pipeline approaches or sequence tagging, Barnes et al. (2021) adapted syntactic dependency parsing to perform aspect and opinion expression extraction, and polarity classification, thus formalizing the task as structured sentiment analysis.
$^{1}$ https://github.com/cltl/VaccinationCorpus
Disentangled representation learning Deep generative models learn the hidden semantics of text, of which many attempt to capture the independent latent factor to steer the generation of text in the context of NLP (Hu et al., 2017; Li et al., 2018a; Pergola et al., 2019; John et al., 2019; Li et al., 2020). The majority of the aforementioned work employs VAE (Kingma et al., 2014) to learn controllable factors, leading to the abundance of VAE-based models in disentangled representation learning (Higgins et al., 2017; Burgess et al., 2018; Chen et al., 2018). However, previous studies show that unsupervised learning of disentangle-ment by optimising the marginal likelihood in a generative model is impossible (Locatello et al., 2019). While it is also the case that non-linear ICA is unable to uncover the true independent factors, Khemakhem et al. (2020) established a connection between those two strands of work, which is of particular interest to us since the proposed framework learns to approximate the true factorial prior given few examples, recovering a disentangled latent variable distribution on top of additionally observed variables. In this paper, stance labels and aspect spans are additionally observed on a handful of data, which could be used as inductive biases that make disentanglement possible.
Vaccine attitude detection Very little literature exists on attitude detection for vaccination. In contrast, there is growing interest in Covid-19 corpus construction (Shuja et al., 2021). Of particular interest to us, Banda et al. (2021) built an on-going tweet dataset that traces the development of Covid-19 by 3 keywords: “coronavirus”, “2019nCoV” and “corona virus”. Hussain et al. (2021) utilized hydrated tweets from the aforementioned corpus to analyze the sentiment towards vaccination. They used lexicon-based methods (i.e., VADER and TextBlob) and pre-trained BERT to classify the sentiment in order to gain insights into the temporal sentiment trends. A similar approach has been proposed in (Hu et al., 2021). Lyu et al. (2021) employed a topic model to discover vaccine-related themes in twitter discussions and performed sentiment classification using lexicon-based methods. However, none of the work above constructed datasets about vaccine attitudes, nor did they train models to detect attitudes. Morante et al. (2020) built the Vaccination Corpus (VC) with events, attributions and opinions annotated in the form of text spans, which is the only dataset available to us
to perform attitude detection.
The goal of our work is to detect the stance expressed in a tweet (i.e., 'pro-vaccination', 'anti-vaccination', or 'neutral'), identify a text span that indicates the concerning aspect of vaccination, and cluster tweets into groups that share similar aspects. To this end, we propose a novel latent representation learning model that jointly learns a stance classifier and disentangles the latent variables capturing stance and aspect respectively. Our proposed Vaccine Attitude Detection (VADET) model is firstly trained on a large amount of unannotated Twitter data to learn latent topics via masked Language Model (LM) learning. It is then fine-tuned on a small amount of Twitter data annotated with stance labels and aspect text spans for simultaneously stance classification and aspect span start/end position detection. The rationale is that the inductive bias imposed by the annotations would encourage the disentanglement of latent stance topics and aspect topics. In what follows, we will present our proposed VADET model, first under the masked LM learning and later extended to the supervised setting for learning disentangled stance and aspect topics.
Figure 2: VADET in masked language model learning. The latent variables are encoded via the topic layers incorporated into the masked language model.
VADET in the masked LM learning We insert a topic layer into a pre-trained language model such as ALBERT, as shown in Figure 2, allowing the network to leverage pre-trained information while fine-tuned on an in-domain corpus. We assume that there is a continuous latent variable  $z$  involved in the language model to reconstruct the original text from the masked tokens. We retain the weights of a language model and learn the latent representa
Figure 3: VADET in supervised learning. The text segment highlighted in blue is the annotated aspect span. The right part learns latent aspect topic  $z_{a}$  from aspect text span  $[w_{a}:w_{b}]$  only under masked LM learning. The left part learns jointly latent stance topic  $z_{s}$  and latent aspect topic  $z_{w}$  from the whole input text, and trained simultaneously for stance classification and aspect start/end position detection.
tion during the fine-tuning. More concretely, the topic layer partitions a language model into lower layers and higher layers denoted as  $\psi$  and  $\theta$ , respectively. The lower layers constitute the Encoder that parameterizes the variational posterior distribution denoted as  $q_{\phi}(z|\psi(\mathbf{w}))$ , while the higher layers reconstruct the input tokens, which is referred to as the Decoder.
The objective of VAE is to minimize the KL-divergence between the variational posterior distribution and the approximated posterior. This is equivalent to maximizing the Evidence Lower BOund (ELBO) expressed as:
$$
\mathbb {E} _ {q _ {\phi} (z | \psi (\mathbf {w}))} [ \log p _ {\theta} (\mathbf {w} ^ {H} | z, \psi (\mathbf {w})) ] - \mathrm {K L} [ q _ {\phi} (z | \psi (\mathbf {w})) | | p (z) ], \tag {1}
$$
where  $q_{\phi}(z|\psi(\mathbf{w}))$  is the encoder and  $p_{\theta}(\mathbf{w}^H | z, \psi(\mathbf{w}))$  is the decoder. Here,  $\mathbf{w} = [w_{\mathrm{CLS}}, w_{1:n}]$ , since the special classification embedding  $w_{\mathrm{CLS}}$  is automatically pretended to the input sequence (Devlin et al., 2019),  $\mathbf{w}^H$  denotes the reconstructed input.
Following (Kingma and Welling, 2014), we choose a standard Gaussian distribution as the prior, denoted as  $p(z)$ , and the diagonal Gaussian distribution  $z \sim \mathcal{N}(\mu_{\phi}(\psi(\mathbf{w})), \sigma_{\phi}^{2}(\psi(\mathbf{w})))$  as the variational distribution. The decoder computes the probability of the original token given the latent variable sampled from the Encoder. We use the Memory Scheme (Li et al., 2020) to concatenate  $z$  and  $\psi(\mathbf{w})$ , making the latent representation com
patible for higher layers of the language model. Then the latent presentation  $z$  is passed to  $\theta$  to reconstruct the original text.
VADET with disentanglement of aspect and stance One of the training objectives of vaccine attitude detection is to detect the text span that indicates the aspect and to predict the associated stance label. Existing approaches rely on structured annotations to indicate the boundary and dependency between aspect span and opinion words (Xuet al., 2020; Barnes et al., 2021), or use a two-stage pipeline to detect the aspect span and the associated opinion separately (Peng et al., 2020). The problem is that the opinion expressed in a tweet and the aspect span often overlap. To mitigate this issue, we instead separate the stance and aspect from their representations in the latent semantic space, that is, disentangling latent topics learned by VADET into latent stance topics and latent aspect topics. A recent study in disentangled representation learning (Locatello et al., 2019) shows that unsupervised learning of disentangled representations is theoretically impossible from i.i.d. observations without inductive biases, such as grouping information (Bouchacourt et al., 2018) or access to labels (Locatello et al., 2020b; Trauble et al., 2021). As such, we extend our model to a supervised setting in which disentanglement of the latent vectors can be trained on annotated data.
Figure 3 outlines the overall structure of VADET
in the supervised setting. On the right hand side, we show VADET learned from the annotated aspect text span  $[w_a : w_b]$  under masked LM learning. The latent variable  $z_a$  encodes the hidden semantics of the aspect expression. We posit that the aspect span is generated from a latent representation with a standard Gaussian distribution being its prior. The ELBO for reconstructing the aspect text span is:
$$
\begin{array}{l} \mathcal {L} _ {A} = \mathbb {E} _ {q _ {\phi} \left(z _ {a} \mid \psi \left(w _ {a: b}\right)\right)} [ \log p _ {\theta} \left(w _ {a: b} ^ {H} \mid z _ {a}, \psi \left(w _ {a: b}\right)\right) ] \tag {2} \\ - \mathrm {K L} \left[ q _ {\phi} \left(z _ {a} \mid \psi \left(w _ {a: b}\right)\right) \mid \mid p \left(z _ {a}\right) \right], \\ \end{array}
$$
where  $w_{a:b}^{H}$  denotes the reconstructed aspect span. Ideally, the latent variable  $z_{a}$  does not encode any stance information and only captures the aspect mentioned in the sentence. Therefore, the  $z_{s}$  for the language model on the right hand side is detached and the reconstruction loss for [CLS] is set free.
On the left hand side of Figure 3, we train VADET on the whole sentence. The input to VADET is formalized as: '[CLS] text'. Instead of mapping an input to a single latent variable  $z$ , as in masked LM learning of VADET, the input is now mapped to a latent variable decomposing into two components,  $[z_{s}, z_{w}]$ , one for the stance and another for the aspect. We use a conditionally factorized Gaussian prior over the latent variable  $z_{w} \sim p_{\theta}(z_{w} | w_{a:b})$ , which enables the separation of  $z_{s}$  and  $z_{w}$  since the diagonal Gaussian is factorized and the conditioning variable  $w_{a:b}$  is observed.
We establish an association between  $z_{w}$  and  $z_{a}$  by specifying  $p_{\theta}(z_w|w_{a:b})$  to be the encoder network of  $q_{\phi}(z_a|w_{a:b})$ , since we want the latent semantics of aspect span to encourage the disentanglement of attitude in the latent space. In other words, the prior of  $z_{w}$  is configured as the approximate posterior of  $z_{a}$  to enforce the association between the disentangled aspect in sentence and the de facto aspect. As a result, the ELBO for the original text is written as
$$
\begin{array}{l} \mathbb {E} _ {q _ {\phi} \left(z _ {w} \mid \psi (\mathbf {w})\right)} \left[ \log p _ {\theta} \left(\mathbf {w} ^ {H} \mid z _ {w}, \psi (\mathbf {w})\right) \right] \tag {3} \\ - \mathrm {K L} \left[ q _ {\phi} \left(z _ {w} | \psi (\mathbf {w})\right) | | q _ {\phi} \left(z _ {w} | \psi \left(w _ {a: b}\right)\right) \right], \\ \end{array}
$$
where  $\mathbf{w}^H$  denotes the reconstructed input text,  $z_w|\mathbf{w}\sim \mathcal{N}(\mu_\phi (\psi (\mathbf{w})),\sigma_\phi^2 (\psi (\mathbf{w})))$ . The KL-divergence allows for some variability since there might be some semantic drift from the original semantics when the aspect span is placed in a longer sequence.
The annotation of the stance label provides an additional input. To exploit this inductive bias, we
enforce the constraint that  $z_{s}$  participates in the generation of [CLS], which follows an approximate posterior  $q_{\phi}(z_s|\psi (\mathbf{w}_{[\mathrm{CLS}]})$  ).We place the standard Gaussian as the prior over  $z_{s}\sim \mathcal{N}(\mathbf{0},\mathbf{I})$  and obtain the ELBO
$$
\begin{array}{l} \mathbb {E} _ {q _ {\phi} \left(z _ {s} \mid \psi (\mathbf {w} _ {[ \mathrm {C L S} ]})\right)} \left[ \log p _ {\theta} \left(w _ {[ \mathrm {C L S} ]} ^ {H} \mid z _ {s}, \psi (\mathbf {w} _ {[ \mathrm {C L S} ]})\right) \right] \tag {4} \\ - \mathrm {K L} \left[ q _ {\phi} \left(z _ {s} \mid \psi \left(\mathbf {w} _ {[ \mathrm {C L S} ]}\right)\right) \mid \mid p \left(z _ {s}\right) \right] \\ \end{array}
$$
Since the variational family in Eq. 1 are Gaussian distributions with diagonal covariance, the joint space of  $[z_s,z_w]$  factorizes as  $q_{\phi}(z_s,z_w|\psi (\mathbf{w})) = q_{\phi}(z_s|\psi (\mathbf{w}))q_{\phi}(z_w|\psi (\mathbf{w}))$  (Nalisnick et al., 2016). Assuming  $z_{w}$  to be solely dependent on  $\psi (w_{1:n})$  we obtain the ELBO for the entire input sequence:
$$
\begin{array}{l} \mathcal {L} _ {S} = \mathbb {E} _ {q _ {\phi} (z _ {w})} \mathbb {E} _ {q _ {\phi} (z _ {s})} [ \log p _ {\theta} (\mathbf {w} ^ {H} | z, \psi (\mathbf {w})) ] \\ - \mathrm {K L} \left[ q _ {\phi} \left(z _ {w} | \psi \left(w _ {1: n}\right)\right) \mid \mid q _ {\phi} \left(z _ {w} | \psi \left(w _ {a: b}\right)\right) \right] \tag {5} \\ - \operatorname {K L} \left[ q _ {\phi} \left(z _ {s} | \psi (\mathbf {w})\right) | | p (z _ {s}) \right]. \\ \end{array}
$$
Note that the expectation term can be decomposed into the expectation term in Eq. 3 and Eq. 4 according to the decoder structure. For the full derivation, please refer to Appendix A.
Finally, we perform stance classification and classification for the starting and ending position over the aspect span of a tweet. We use negative log-likelihood loss for both the stance label and aspect span:
$$
\mathcal {L} _ {s} = - \log p \left(y _ {s} \mid w _ {[ C L S ]} ^ {H}\right),
$$
$$
\mathcal {L} _ {a} = - \log p \left(y _ {a} | \operatorname {M L P} \left(w _ {1: n} ^ {H}\right)\right) - \log p \left(y _ {b} | \operatorname {M L P} \left(w _ {1: n} ^ {H}\right)\right),
$$
where MLP is a fully-connected feed-forward network with tanh activation,  $y_{s}$  is the predicted stance label,  $y_{a}$  and  $y_{b}$  are the starting and ending position of the aspect span. The overall training objective in the supervised setting is:
$$
\mathcal {L} = \mathcal {L} _ {s} + \mathcal {L} _ {a} - \mathcal {L} _ {S} - \mathcal {L} _ {A}
$$
We present below the experimental setup and evaluation results.
Datasets We evaluate our proposed VADET and compare it against baselines on two vaccine attitude datasets.
VAD is our constructed Vaccine Attitude Dataset. Following (Hussain et al., 2021), we crawl tweets using the Twitter streaming API with 60 predefined keywords $^2$  relating to COVID-19 vaccines
2The full keyword list and the details of dataset construction are presented in Appendix B.
Specification	VAD	VC
Train	Test	Train	Test
# tweets	2000	800	1162	531
# anti-vac.	638	240	822	394
# neutral	142	76	41	27
# pro-vac.	1220	484	299	110
Avg. length	33.5	34.13	29.6	30.24
len(aspect)	17.5	18.75	1.03	1.08
len(opinion)	27.97	29.01	3.25	3.15
# tokens	67k	27.3k	34.4k	16.8k
Table 1: Dataset Statistics. '#tweets' denotes the number of tweets in VAD, and for VC it is the number of sentences. 'anti-vac.' means anti-vaccination while 'pro-vac.' means pro-vaccination. 'Avg. length' and '# token' measure the number of word tokens.