---
title: "Leveraging knowledge sources for detecting self-reports of"
description: "How medical term lists and grammatical structure help identify personal health reports in tweets about medication, flu shots, and birth defects."
canonical: "https://research.elamur.ai/free/en/papers/bagherzadeh-2021-leveraging-knowledge-sources-detecting-self/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bagherzadeh-2021-leveraging-knowledge-sources-detecting-self/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Leveraging knowledge sources for detecting self-reports of particular health issues on social media

# Leveraging knowledge sources for detecting self-reports of particular health issues on social media

Paper · 2021 · Parsa Bagherzadeh and Sabine Bergler

**Authors:** Parsa Bagherzadeh and [Sabine Bergler](https://md.research.elamur.ai/free/en/authors/sabine-bergler/) · **Year:** 2021 · **Venue:** Proceedings of the 12th International Workshop on Health Text Mining and Information Analysis · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Cited by **3** papers in our library of more than 163,000 papers whose bibliographies we read · Proceedings of the 12th International Workshop on Health Text Mining and Information Analysis · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.louhi-1.5/)
- [PDF](https://aclanthology.org/2021.louhi-1.5.pdf)

## Summary

A tweet can name a medication without saying that anyone took it. It can mention a flu shot without describing a vaccination, or discuss a birth defect without referring to the writer’s child. These distinctions matter when researchers use social media to look for reports of health experiences. Bagherzadeh and Bergler study whether a system can make those distinctions more reliably when it has access to medical terminology and grammatical information alongside the words of the tweet. They test the approach on shared tasks covering medication intake, flu vaccination behavior, adverse drug reactions, and birth defects.

The authors give the system curated term lists, called gazetteers, that identify such things as drugs, symptoms, body parts, pregnancy complications, and family relationships. Some lists draw on the Medical Subject Headings hierarchy, known as MeSH. The system also marks person and organization names, distinguishes grammatical person in pronouns, and uses a dependency parse to connect words that play related roles in a sentence. A word receives numerical representations for its annotations in addition to its ordinary word representation. Because the system adds these vectors together, a new annotation type can have its own trainable vector while the width of the representation stays fixed.

The strongest results combine terminology and grammar. On the official adverse drug reaction test, the full RoBERTa configuration reaches F1 of .66, and the full BioBERT configuration reaches .67. The shared-task reference in the paper is .64. On the official birth defect test, the full configurations both reach micro-F1 of .73 against a reference of .69. The two earlier tasks use held-out portions of their training collections because the official test data were unavailable to the authors. Gains from terminology are smaller for flu vaccination, where the topic itself offers little lexical variety. Across the comparisons, precision frequently improves more than recall. The experiments show how curated terms can help a classifier recognize relevant language and how grammar can help it decide whether that language belongs to a personal report.

## Deep dive: Leveraging knowledge sources for detecting self-reports of particular health issues on social media

How medical term lists and grammatical structure help identify personal health reports in tweets about medication, flu shots, and birth defects. · about 38 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### A health mention and a report of an experience

Researchers studying health through social media start with messages written for many different purposes. Some describe something that happened to the writer. Others relay news, offer advice, discuss someone else, or raise awareness. The paper places its work in the context of disease surveillance, outbreak management, and research on medication safety. For these applications, it matters whether a relevant expression appears in a message and what claim the writer makes with it. A system that gathers messages simply because they contain a health term can supply many examples about the topic while missing the distinction the researcher needs.

The heart of the problem is easiest to see when a drug name gives little guidance about the label. A tweet can describe taking a medication for a headache, explain that the writer relies on a medication to sleep, or advise another person to take one and calm down. All three messages contain a plausible medication name. Only the first makes intake clear in the way the examples are labeled. The second can be interpreted as describing a habit or condition without establishing a concrete instance of intake. The third addresses somebody else. Recognizing the name is useful in every case, but identifying the reported act also depends on tense, person, and the relationship between the drug and the verb.

The birth defect task puts the same problem in terms of family relationships. A message about a pregnancy ending in stillbirth and identifying hydrocephalus can express a personal experience. A message naming a child and saying she was born with Down syndrome leaves the relationship between that child and the writer open. An awareness message about the condition can name it directly while giving no indication of an affected child in the writer’s family. These class distinctions explain why recognizing the condition provides only part of the evidence. They also explain why a classifier that identifies a personal name still has work to do.

The vaccination and adverse reaction tasks draw their boundaries differently. For vaccination, a report that the writer has received a flu vaccine or intends to get it is positive. A message about a flaw scientists found in a vaccine belongs on the other side of that boundary. For adverse reactions, the issue is whether the tweet describes an effect of taking a drug. A message praising someone for taking a medication can contain a clear drug mention with no side effect. A message that attributes sweating to Vyvanse supplies evidence of an effect and of a connection to the drug. Each benchmark asks the classifier to recover a particular kind of relationship from the entire tweet.

This makes the work an instance of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/). The outcome is a category for the whole message. Recognizing a drug, a condition, or a child’s name can help predict that category, but the prediction concerns what the message conveys. That distinction shapes both the architecture and its evaluation. The authors need token-level evidence for the position of a term and tweet-level evidence about who did what, to whom, and with what consequence. The benchmark labels turn those combinations of clues into decisions that can be compared against assigned categories.

#### Why a familiar sentence can contain an unfamiliar term

The authors give parallel examples in which a parent describes a son’s diagnosis. One names leukemia and the other hydrocephalus. The surrounding words offer much the same account of the event and the relationship of the people involved. The medical terms put the accounts in different categories for the paper’s purposes. A system can therefore learn a plausible general pattern for reporting a diagnosis without learning enough about the particular term that completes it.

[Word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) represent words as numerical vectors. A contextual representation can change with the surrounding words, which helps when the same expression is used in different senses or when the surrounding sentence establishes its role. The examples expose the other side of that arrangement. Different specialized terms can fit into much the same context. If a rare condition is poorly represented in training, the context may tell the system that it is a diagnosis while supplying little basis for deciding which kind of diagnosis it is. In the authors’ account, that gap matters particularly in medicine, where specialized terminology continues to grow.

A gazetteer can supply the missing category when the expression occurs in its entries. The authors use the term to mean a curated list whose matches can be marked in the input. A condition from a relevant branch of MeSH can receive a birth defect annotation even if the training examples did not make that condition familiar. That gives the classifier an explicit indication of its category. The classifier still has to judge how the condition is being discussed, and the useful lexical coverage is bounded by the lists available to it.

The paper also notes the practical cost of relying on large pretrained systems. It gives DistilBERT as an example with 66M parameters and RoBERTa Large as one with 340M parameters. The authors connect this scale to the time needed for adaptation and testing and to the need for adequately representative training examples. The study uses that observation to motivate a comparison between representations of different sizes and kinds. A curated resource may make some of the distinctions directly available to a smaller input representation, and the same resource may still help when used alongside a larger pretrained representation. [DistilBERT](https://md.research.elamur.ai/free/en/papers/sanh-2019-distilbert-distilled-version-bert-smaller/), [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/)

#### What earlier systems used

The authors describe several strands of work on health messages. Earlier studies had examined personal accounts of smoking, non-medical opioid use, and medication experiences. Classification systems for related tasks differed in how much of the relevant evidence was supplied explicitly. Some counted selected features and passed those counts to a statistical classifier. Others learned from word representations and labeled examples. A smaller group combined learned representations with features derived from linguistic or medical resources.

The hand-selected features varied with the problem. Work reviewed in the paper counted emotion words, first-person pronouns, and other pronouns for personal health surveillance. A vaccination system used grammatical tag counts and features such as the frequency of special characters. It combined support vector machines, logistic regression, and random forests. The same study tried an approach based on ULMfit and reported results close to those of its feature-based system. For drug and adverse reaction tasks, other work used combinations of drug names, sentiment, grammatical relations, negation, and patterns of word or character sequences. The paper presents these examples to show that explicitly selected evidence had remained competitive in some shared tasks.

A separate line of work used pretrained word representations as inputs to neural classifiers. The paper discusses Word2Vec and [GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) as examples and describes later use of contextual methods such as ELMo and BERT variants. It observes that BERT-based entrants frequently placed among the strongest systems in shared tasks. Their success helped motivate using contextual representations for the narrow distinctions found in health tweets, since a labeled collection can teach patterns that an expert would have difficulty listing exhaustively. The paper also emphasizes that the usefulness of such learning depends on how well the training data represent the cases encountered at test time. [ELMo](https://md.research.elamur.ai/free/en/papers/peters-2018-deep-contextualized-word-representations/), [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/)

Prior hybrid approaches are the closest comparison. The cited work had already used grammatical tags, gazetteer matches, and sentiment alongside word vectors for adverse reaction classification. Other systems added medical concept and side-effect features or encoded the scope of negation and modality. These approaches commonly used concatenation, which places different vectors side by side in a larger vector. A network configured to receive each annotation in a separate part of its input needs a change to that interface when a new annotation type adds another part. The authors see this as a problem for adaptation by a person who knows which vocabulary is useful but does not design neural networks.

The distinction from these approaches is thus partly about who can supply knowledge and how the architecture receives it. An epidemiologist may know which terminology separates relevant from irrelevant cases in a new task. The proposed encoding gives each such annotation an independent trainable representation that fits the existing input width. That choice addresses the cost of changing the network when the resource changes. A separate design choice, using grammatical dependencies, addresses how the system can relate those annotated terms to the surrounding account.

### The method, step by step

#### From a tweet to a class prediction

The system first gives each token a representation of its identity in the tweet. Where the relevant resources supply additional information, it adds representations for that information at the token’s position. A contextual encoder then lets each position draw on the rest of the input. A graph convolution uses the grammatical links between tokens to update their representations again. Finally, an attention mechanism gives each position a weight, and the system combines the positions into a single vector from which it predicts the label.

From tweet annotations to a health report prediction The steps in order.

The order lets the same token carry different kinds of evidence at different stages. Consider the paper’s diagram of a tweet about stopping Crestor because of muscle pain. A drug list can identify the medication, and medical resources can flag words connected with the reported problem. The contextual encoder receives the words around them, including the expression that introduces the reason for stopping. The dependency graph then determines which nearby or distant tokens are direct grammatical neighbors. The final decision draws on the representations produced by these steps.

The diagram illustrates how the linguistic and lexical components can work together. A dictionary match indicates the position at which the system found a drug or a health expression. The graph gives that position a path to the verb, a subject, or another expression carrying evidence about the event. A cue near the end of the message can consequently influence the representation of a grammatically related position earlier in the message. The pooling stage can also assign weight to the representations at both positions when it builds a vector for the tweet.

#### Choosing vocabulary for each task

The general disease gazetteer comes from MeSH subtree C. It includes terms for disease and other health problems, including injuries and pain. The authors use it in medication-intake classification because a tweet may give a condition or symptom as the reason for taking a drug. DrugBank supplies commercial and scientific drug names for the drug gazetteer. Together, these lists help the classifier locate the expressions that may identify the treatment and what prompted it. The same drug name can then appear in examples whose surrounding wording supports different classes.

The adverse reaction task uses both lists and adds an adverse reaction lexicon and an anatomy gazetteer. The adverse reaction lexicon brings together resources including SIDER, the Consumer Health Vocabulary, COSTART, and the DIEGO Lab lexicon. The anatomy terms come from MeSH subtree A. A report may describe a side effect through an affected body part, so anatomical language can be relevant even when the message uses a brief or informal description. The task also uses relationship terms for descendants, family members, and acquaintances, giving the classifier cues about the person involved.

For birth defects, the authors use MeSH C16 for the gazetteer they call BirthDef. It covers congenital, hereditary, and neonatal conditions and abnormalities. Multiple entries can refer to the same condition, as illustrated by the alternative names for Down syndrome discussed in the paper. The authors separately draw pregnancy complication terms from subtree C13.703. A message may mention a pregnancy complication alongside a birth defect, and separate annotations allow the system to see which kind of mention it has encountered. The birth defect task also uses the anatomy, descendant, and family lists.

For the flu vaccination task, the gazetteer set consists of descendant, family, and acquaintance terms. The authors describe the vaccination task as narrowly focused on flu, which gives the subject matter little variety in its central trigger term. Relationship language has a different purpose here. It can help establish whose plans or actions the message describes. The choice of lists therefore depends on both the terminology of the task and the relationship that its labels ask the classifier to judge.

The descendant gazetteer covers terms such as son, daughter, baby, and infant. It also includes age descriptions. These can point to a child even when the tweet uses an age expression in place of a kinship noun. The paper writes the pattern as follows.

```
CD (-| )?(day|days|month|months|year|years)(-| )?old
```

`CD` stands for a number. The parentheses group alternatives or group an expression that can be optional. The vertical bar `|` represents a choice between the strings on its sides, and `?` allows the preceding group to occur zero or one time. In each optional separator group the alternatives are a hyphen and a space. The middle group lists the singular and plural time units, and `old` is a literal ending. The paper uses the pattern as an additional way to recognize expressions that describe a child’s age.

The family gazetteer contains expressions for relatives, such as mother, grandfather, spouse, and cousin. For acquaintances, the authors draw vocabulary such as friend and colleague from the General Inquirer and use the SocRel annotation. One reason to keep these categories distinct from the descendant category is that a single tweet can contain both. A writer referring to a cousin’s child is using language about a child and a relative, with the words and their grammatical relationships establishing which relationship applies. The classification criteria for a writer’s own child make that difference relevant.

The distinction between gazetteers also determines what the resource can contribute if the same condition occurs in several kinds of messages. A birth defect term provides evidence about the condition, an anatomy term about the body part, and a relationship term about the people. The system receives those signals in separate annotations even if several occur close together or apply at the same position. During training, the relevance of each annotation is learned through the labels of the particular task. Membership in a list does not carry a predetermined class decision.

#### Marking names and grammatical roles

The authors use ANNIE for [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/), the identification and categorization of expressions such as people’s names and organization names. A personal name can be a clue in a message about someone’s child. An organization name can occur in a report about legislation or another public matter where the health condition is mentioned in general. The paper’s examples give reasons to preserve these signals as distinct categories. A name makes the reference more specific without establishing the named person’s relationship to the author. An organization name can help characterize a news-like message while still leaving open the possibility that the tweet also contains a personal account.

[Part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/) assigns a grammatical category to each token, such as a pronoun or a verb. The standard Penn Treebank tags form the paper’s POS1 setting. The extended POS2 setting distinguishes grammatical person in pronouns and possessives. The ordinary pronoun tag is divided into PRP1, PRP2, and PRP3, for first, second, and third person. The corresponding possessive categories receive the same distinctions. The finer labels let a representation identify that a pronoun refers to the writer, addresses the reader, or refers to somebody else.

This information addresses a recurring ambiguity in the benchmarks. A phrase about taking a medication can be framed as the writer’s act, advice to another person, or a description of a third party. In the birth defect task, possessive forms can be especially useful because they can identify whose child is being discussed. Verb tags can provide information relevant to whether an event is reported as having occurred. The expanded tags give grammatical person a dedicated place in the input while leaving the contextual encoder to interpret its relevance in the sentence.

[Dependency parsing](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/) supplies labeled grammatical links between tokens. The paper uses the Stanford parser. In a dependency graph, a token can be linked to a verb as its subject or object even when intervening words separate them in the tweet. The authors point to patterns in which first-person pronouns occur as subjects of self-reports and health expressions enter constructions in roles such as direct object. For classification, the useful information is both which tokens are connected and what kind of link the parser assigns.

Part-of-speech tags and dependency links give different views of the same sentence. A tag can tell the classifier that a token is a first-person pronoun. A link can connect that pronoun to the action for which it serves as subject. Likewise, a drug annotation says what a word names, and a dependency link can show which action the word participates in. The system handles these two kinds of grammatical information at different stages. Tag representations are included in the input vector, while the links determine which contextual representations are combined later.

#### Adding annotations at each token

The authors compare token representations based on GloVe, ELMo, RoBERTa, and BioBERT. The GloVe setting uses Twitter vectors of dimension 200. The original ELMo setting and the large RoBERTa setting are listed with dimension 1024. These input representations change the information available before the explicit features are applied. The comparisons therefore let the authors ask whether annotation and grammar still contribute when the starting representations differ. [GloVe](https://md.research.elamur.ai/free/en/papers/pennington-2014-glove-global-vectors-word-representation/), [BioBERT](https://md.research.elamur.ai/free/en/papers/lee-2019-biobert-pre-trained-biomedical-language/)

To represent the grammatical tags, the authors run Word2Vec on sequences of tags in place of sequences of words. They use Gensim and a context window of size 5. The material for this pretraining is the training data from all the tasks studied in the paper. One consequence of training on tag sequences is that neighboring grammatical categories determine the initial representation. The supervised classification training can then adjust those tag vectors for the decisions the system has to make.

```
P ∈ ℝ^(φ × d_emb)
```

`P` is the matrix of part-of-speech vectors, and `∈` indicates that it belongs to the indicated space. `ℝ` denotes real-valued entries. The dimensions inside the parentheses are the number of rows and columns, with `×` separating them. `φ` is the number of distinct tags and `d_emb` is the width of a word embedding. The shared width enables the tag vector to be added to the vector for a token.

```
Gₓ ∈ ℝ^(d_emb)
```

`Gₓ` denotes the trainable vector associated with annotation type `x`. The symbol `∈` again indicates membership in a space of real-valued vectors, and `d_emb` gives the number of entries in that vector. The value of `Gₓ` is updated during training for the tweet classification task. An annotation marks a position where the corresponding vector is to be included.

The illustration of additive annotation uses Hydrocephalus at timestep 3. Its input representation combines a vector for the token, one for a birth defect match, and one for the grammatical tag NNP. In the notation below, the same operation is written for a general token position.

```
h¹ᵢ = Eᵢ + P[tᵢ] + Σ[x ∈ Aᵢ] Gₓ
```

`i` identifies a position in the tweet, and `h¹ᵢ` is its resulting representation in the embedding layer. `Eᵢ` denotes the word vector used at that position. `tᵢ` is the token’s grammatical tag, and `P[tᵢ]` is the row selected from the tag matrix. `Aᵢ` is the collection of applicable annotation types. `Σ` adds the vectors `Gₓ` for types `x` that belong to `Aᵢ`, as indicated by `∈`. Each `+` is elementwise vector addition, and `=` identifies the resulting vector. In settings without the corresponding features, those additions are absent.

The sum allows several annotations at a position while preserving the dimensionality expected by the following layers. A new type `y` can be represented by a vector `Gᵧ` of the same width as the other annotation vectors. The author of a new gazetteer can change which terms receive it without widening the encoder input. The paper’s proposed adaptation still involves [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/), meaning further training on the classification task so the new feature can acquire an appropriate effect. The distinction is between changing the information entering the system and changing the shape of the network that receives it.

The inspiration for this additive encoding is the use of segment embeddings in BERT. In this paper, the same general operation assembles different kinds of evidence about a token. The vector seen by the encoder can contain a lexical identity, a grammatical category, and memberships in curated terminology categories. The annotations are learned in a shared numerical space, so their contribution can interact with the word representation in the next layer. Matching a term specifies where an annotation applies. Supervised training determines how that annotated representation contributes to a prediction.

#### Contextualizing and connecting the tokens

The next stage is a [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/) encoder. Its self-attention operation builds a representation for each position from the input sequence, allowing information at different places in the tweet to interact. The authors use 4 attention heads and a feed-forward dimension of 1024. Each position enters this encoder as `h¹ᵢ` and leaves as `h²ᵢ`, the representation used in the dependency stage. This first attention operation acts within the sequence and serves a different purpose from the attention used later to pool the tweet into one vector. [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/)

The graph stage receives the contextualized vectors. A graph convolution associates a token with a combination of its neighbors in the dependency parse. The paper follows the use of graph convolution for sentence encoding, with a different transformation for each dependency label. Thus a word connected as a subject can contribute through a different set of learned weights from a word connected through another grammatical relation. The graph constrains which contextual positions send information in this operation. [Semi-Supervised Classification with Graph Convolutional Networks](https://md.research.elamur.ai/free/en/papers/kipf-2016-semi-supervised-classification-graph-convolutional/), [Encoding Sentences with Graph Convolutional Networks for Semantic Role Labeling](https://md.research.elamur.ai/free/en/papers/marcheggiani-2017-encoding-sentences-graph-convolutional-networks/)

```
h³ᵢ = ReLU(Σ[j ∈ N(i)] W[L(i,j)] h²ⱼ + b)
```

`h³ᵢ` is the graph layer’s output for token `i`. `N(i)` is the set of tokens adjacent to it in the dependency graph, and `j` ranges over that set as indicated by `∈` and `Σ`. `L(i,j)` gives the label of the arc from `j` to `i`. `W[L(i,j)]` is the learned matrix for that label, and the juxtaposition of this matrix with `h²ⱼ` denotes multiplication by the contextual representation of token `j`. The `+ b` adds a learned bias to the combined result. `ReLU` is the rectified linear operation, which sets negative components to zero. The equality gives the updated vector at position `i`.

The label-dependent matrices are important because the same neighboring term can play different roles. A drug in the grammatical neighborhood of a verb can be what the writer took, what someone was advised to take, or part of a statement about another person. The graph supplies a way to condition each transfer of information on the type of link. It receives vectors that already include context from the self-attention encoder, so a neighbor can pass along evidence beyond its isolated dictionary meaning. The graph links add structure to that information flow.

#### Turning the sequence into a tweet decision

The classifier needs a representation of the complete tweet. The authors use attention pooling to construct it. A learned scoring vector assigns a numerical importance score to each graph-layer representation. A normalization then gives the scores a common scale across all positions in the tweet. This allows certain expressions to contribute strongly to the final representation when their contextual and grammatical information makes them informative. [Neural Machine Translation by Jointly Learning to Align and Translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/)

```
eᵢ = w_attᵀ h³ᵢ
```

`eᵢ` is the importance score at token position `i`. `w_att` is the learned context vector used to score positions, and `ᵀ` denotes its transpose. Multiplication by `h³ᵢ`, the graph representation of the position, gives a single value through a dot product. This is an unnormalized score evaluated before the weights for different positions are compared.

```
αᵢ = exp(eᵢ) / Σ[j] exp(eⱼ)
```

`αᵢ` is the normalized attention weight for position `i`. `exp` is the exponential function, and `eᵢ` and `eⱼ` are the importance scores of positions `i` and `j`. The slash divides the exponential of the score at `i` by the sum over the scores at all token positions, given by `Σ[j]`. This normalization is the softmax. It makes the positions share the total available attention weight.

```
H = Σ[i] αᵢ × h³ᵢ
```

`H` is the pooled representation of the tweet. In the sum, `i` ranges over token positions, `αᵢ` is the weight just computed for a position, and `h³ᵢ` is its graph-layer vector. The multiplication sign `×` means that the scalar weight multiplies every component of that vector. The sum combines the weighted vectors, and a linear classification layer uses `H` to produce scores for the possible tweet labels.

A token’s score at this stage reflects the representation it acquired from the preceding operations. A birth defect match can change that representation directly, while annotations at other positions can influence it through contextual attention and grammatical links. This is why the authors examine attention when comparing systems trained with and without gazetteers. The figures show where the final pooling stage places emphasis under those conditions. The class prediction still depends on the content of the weighted vectors and on the parameters of the final linear layer.

#### Training the configurations

The system is implemented in PyTorch. It minimizes cross-entropy, which makes the training objective sensitive to the score assigned to the correct class, and uses Adam to update trainable parameters. The tag embeddings start from their Word2Vec initialization and are updated during the classification training. The gazetteer vectors are learned in that same supervised training. Thus the lists supply the category and location of an annotation, while the classification examples determine how the network uses the resulting input. [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/)

The paper reports a training duration in epochs and a learning rate for each pairing of task and embedding family, with RoBERTa and BioBERT sharing a row of settings for each task. An epoch is a pass through the training data. The learning rate controls the scale of parameter updates. These settings belong to the corresponding task and embedding family in the experiments.

| Task | GloVe, epochs and learning rate | ELMo, epochs and learning rate | RoBERTa or BioBERT, epochs and learning rate |
| --- | --- | --- | --- |
| SM18-2 | 5, `.1e-3` | 6, `.5e-4` | 10, `.5e-5` |
| SM18-4 | 4, `.1e-3` | 6, `.1e-3` | 6, `.1e-4` |
| SM19-1 | 6, `.1e-3` | 8, `.1e-4` | 10, `.1e-5` |
| SM20-5 | 4, `.1e-4` | 6, `.1e-4` | 8, `.5e-5` |

The computational structure follows the feature choices in each experiment. The part-of-speech settings determine which tag information enters the additive input, and the gazetteer and name settings determine which other marks are available there. The dependency condition adds the graph operation to the classification pipeline. The strongest combined setting in the comparison uses the extended tags, the dependency graph, the task’s gazetteers, and the two categories of named entities. The experiments ask how the results change when these sources are available separately or in these combinations.

### Experiments and results

#### The datasets and the test conditions

All the evaluations use Social Media Mining for Health shared-task data. The tasks share the tweet as a unit of classification but differ in what qualifies as relevant. SM18-2 separates clear personal medication intake, possible intake, and a drug mention with no evidence of personal intake. SM18-4 distinguishes reports of receiving or intending to receive a flu vaccine from other tweets. SM19-1 asks whether a tweet reports an adverse drug reaction. SM20-5 distinguishes accounts about the author’s child, cases where that relationship is unclear, and mentions that do not concern the author’s child.

The official test data are used for SM19-1 and SM20-5. SM19-1 has 25,678 training examples and 4575 official test examples. SM20-5 has 18,382 training examples and 4603 official test examples. Scores for these tasks can be read in relation to the corresponding competition references in the paper. The competition data provide specific definitions of the target cases, so the scores apply to decisions under those definitions.

The authors had no access to the official test data for SM18-2 or SM18-4. They use held-out portions of the original training data and reproduce the reference systems for comparison. The reported split for SM18-2 contains 14,219 training examples and 3554 held-out test examples. For SM18-4 it contains 4579 training examples and 1144 held-out test examples. The reference rows for these two tasks are therefore comparisons on the paper’s own splits. The distinction matters when interpreting a reported improvement against a prior shared-task approach.

#### The metrics and reference systems

Precision measures how often the classifier’s predictions for a scored category are correct. Recall measures how often it recovers the examples belonging to the scored category. The F score combines precision and recall, yielding a higher value when both are strong. For SM18-2 and SM20-5, the shared-task evaluation is micro-averaged over Class 1 and Class 2. The counts for those classes are pooled before their precision, recall, and F score are calculated. The category for a general mention still matters to the decision, since confusing it with a scored class affects the errors, but the reported micro-F score is centered on the personal and ambiguous categories.

The vaccination and adverse drug reaction comparisons report precision, recall, and F score for their respective positive decisions. In vaccination, that decision concerns actual or intended receipt of the flu vaccine. In adverse reactions, it concerns a reported side effect of drug consumption. The same numerical metric thus summarizes different types of decisions in the different tasks. Reading precision and recall alongside F score helps identify whether a change mainly reduces incorrect positive predictions or helps recover more target examples.

The reference for medication intake is Xherija’s system, which uses stacked bidirectional recurrent processing with context-aware attention, as described in the work cited by the paper. The vaccination reference comes from Joshi and colleagues. For the official test tasks, the references are the shared-task results attributed to Chen and colleagues for adverse reactions and Bai and Zhou for birth defects. The paper also includes an internal comparison for each embedding family with none of the added features. Those comparisons help establish what changes with the external resources while holding the family of input representations fixed.

#### Medication intake and flu vaccination

On the held-out medication intake split, the full BioBERT configuration reaches micro-F1 of .77. It has micro-precision of .77 and micro-recall of .77. The full RoBERTa configuration also reaches micro-F1 of .77, with micro-precision of .77 and micro-recall of .78. The reference system on the same held-out split has micro-F1 of .70, micro-precision of .63, and micro-recall of .77. In this comparison, the improvement in the combined score goes with a stronger precision result. Recall is already relatively high for the reference.

For the held-out flu vaccination task, the full RoBERTa and BioBERT configurations each reach F1 of .89. The RoBERTa setting has precision of .90 and recall of .89, and the BioBERT setting also has precision of .90 and recall of .89. The reproduced reference has F1 of .80, precision of .82, and recall of .79. The combined system gives a stronger result on both components. The feature comparisons help distinguish the effect of the grammatical information from the smaller effect of the gazetteer and named entity bundle on this particular task.

Flu vaccination systems on the SM18-4 held-out split by F1 The full configurations share the highest score on the held-out vaccination data.

**The numbers**

| System or setting | F1 |
| --- | --- |
| Joshi and colleagues, reproduced reference | .80 |
| GloVe with all resources | .81 |
| ELMo with all resources | .84 |
| RoBERTa without added features | .85 |
| RoBERTa with all resources (this paper) | .89 |
| BioBERT with all resources | .89 |

The vaccination results also show why the reference comparison and the feature comparison answer different questions. The combined classifier improves upon the reproduced reference, but RoBERTa begins at F1 of .85 even without the added features. To assess what the paper’s annotations and grammatical information contribute, the relevant comparison is between rows inside that embedding family. To see how the entire classifier performs against earlier work under the held-out conditions, the reproduced reference is the appropriate point of comparison.

#### Adverse drug reactions and birth defects

For adverse reactions on the official SM19-1 test, the full BioBERT configuration reaches F1 of .67, with precision of .68 and recall of .65. The full RoBERTa configuration reaches F1 of .66, with precision of .69 and recall of .62. The competition reference has F1 of .64, precision of .60, and recall of .68. The two full configurations therefore achieve higher precision and F scores while the competition reference recovers more of the labeled cases. RoBERTa has the higher precision of the two combined configurations, while BioBERT has the higher recall and F score in this comparison.

Adverse reaction systems on the official SM19-1 test by F1 The full BioBERT and RoBERTa configurations exceed the competition reference, with BioBERT highest.

**The numbers**

| System or setting | F1 |
| --- | --- |
| Chen and colleagues, competition reference | .64 |
| GloVe with all resources | .60 |
| ELMo with all resources | .61 |
| RoBERTa without added features | .60 |
| BioBERT without added features | .62 |
| RoBERTa with all resources (this paper) | .66 |
| BioBERT with all resources | .67 |

On the official SM20-5 birth defect test, both full configurations reach micro-F1 of .73. RoBERTa has micro-precision of .79 and micro-recall of .67. BioBERT has micro-precision of .79 and micro-recall of .68. The competition reference reports micro-precision of .65, micro-recall of .73, and micro-F1 of .69. The distribution of errors again matters. A higher F score and substantially higher precision coexist with lower recall. A reader interested in how much of the labeled material the system retrieves gets a different view from one who is mainly concerned with the reliability of its positive predictions.

Birth defect systems on the official SM20-5 test by micro-F1 The full RoBERTa and BioBERT configurations share the highest score on the official test.

**The numbers**

| System or setting | micro-F1 |
| --- | --- |
| Bai and Zhou, competition reference | .69 |
| GloVe with all resources | .62 |
| ELMo with all resources | .69 |
| RoBERTa without added features | .65 |
| BioBERT without added features | .66 |
| RoBERTa with all resources (this paper) | .73 |
| BioBERT with all resources | .73 |

The authors see the improvements in precision as attractive for health applications, where irrelevant messages can make the retrieved material less useful. The result is specific to the decisions scored here. The official test comparisons show systems that return more accurate positive predictions under these labels while missing more of the target examples than the reference systems. A task concerned with finding as many candidate reports as possible may give that recall difference more weight. Reporting both makes the observed improvement interpretable without relying on the combined score alone.

#### What the stronger input representations contribute

The paper also asks whether a lighter form of word representation can approach a stronger pretrained alternative if it receives explicit resources. On the official adverse reaction test, GloVe with the full resource set reaches F1 of .60. ELMo without the resources reaches .54, and RoBERTa without them reaches .60. The same comparison on the held-out vaccination data gives GloVe with resources F1 of .81, ELMo without resources .79, and RoBERTa without resources .85. These comparisons show that curated and grammatical information can compensate for some of the gap associated with the starting representation.

On the official birth defect test, GloVe with all resources and ELMo with no extra features both have micro-F1 of .62 at the displayed precision. RoBERTa without extra features scores .65. Adding the complete feature set to RoBERTa brings its result to .73. This is a different benefit from substituting a richer set of annotations for some of the information in the word representations. External resources also improve the stronger configurations themselves. The table makes it possible to assess both patterns within the same tasks rather than infer them from separate evaluations.

### What the ablations show

#### Grammatical person is a useful distinction

The authors compare a configuration without added features, one with standard part-of-speech tags, and one with the extended pronoun tags. They also compare each grammatical tag set in the presence of the dependency graph. This lets the reader examine the contribution of explicit grammatical categories and, within that component, the contribution of telling grammatical persons apart. The changes are typically modest, and some rows tie at the reported precision.

The ELMo comparisons for SM20-5 illustrate what the extended tags can add on the official birth defect test. Micro-F1 is .62 without extra features, .63 with standard tags, and .64 with extended tags. Precision and recall both change across those settings. The explicit distinctions have a plausible connection to the classification problem, since possessives and pronouns can help identify whether an account concerns the writer’s child. The aggregate comparison measures the effect of providing those distinctions across the test data. The paper does not break the gain down into individual pronoun types.

In the RoBERTa comparison on the official adverse reaction test, F1 is .60 without features, .60 with the standard tags, and .61 with extended tags. In BioBERT on the official birth defect test, the corresponding micro-F1 values are .66, .68, and .69. The size of the change therefore depends on the task and starting representation. The paper interprets the overall tag comparison as evidence that explicitly available grammatical distinctions can help even when the token vectors already reflect properties of the words and their context.

The distinction between standard and extended tags also remains relevant after the graph is added. On the birth defect test, ELMo with standard tags and dependencies gives micro-F1 of .66, and the extended tags with dependencies give .67. For RoBERTa on the medication intake holdout, the same pair of settings gives micro-F1 of .75 and .76. These comparisons show that the expanded categories have a contribution in the presence of structural links. A first-person marker on a pronoun and the grammatical relation attaching that pronoun to an action are available together.

#### Dependencies often help precision

The comparison labeled Dep gives the classifier dependency information without the tag and gazetteer bundles. For RoBERTa on the official SM20-5 birth defect test, this changes micro-precision from .68 to .74 while micro-recall moves from .62 to .60. Micro-F1 moves from .65 to .67. The structural information helps the combined score in this setting, with the change concentrated in the reliability of the positive predictions. Dependency links can help the classifier condition the interpretation of a relevant expression on the wording to which it is grammatically related.

A similar pattern appears on the held-out medication intake test with BioBERT. The setting without features has micro-precision of .72, micro-recall of .76, and micro-F1 of .74. With dependencies alone, micro-precision is .78, micro-recall is .72, and micro-F1 is .75. The comparisons give a concrete meaning to the paper’s claim that grammatical evidence can favor precision. The reported change in recall also shows that when the classifier gains a way to be more selective, it can lose examples it would otherwise have recovered.

The tags and dependencies can compensate for different gaps. On the official birth defect test, RoBERTa reaches micro-F1 of .67 with dependencies alone and .70 with extended tags alone. With the extended tags and dependencies together, it reaches .71. For ELMo on the official adverse reaction test, the extended tags alone give F1 of .55, dependencies alone give .57, and their combination gives .60. These are comparisons of sources of information in the same task and embedding family. They support the authors’ conclusion that adding the graph need not make the grammatical tag stream redundant.

The dependency comparison also helps make sense of the strongest configurations on the official data. The results can improve even where the combined classifier leaves the earlier system ahead on recall, since the additional structure changes which cases the system labels as relevant. The tables report that outcome at the level of whole test splits. They do not identify every construction the dependency stage handles better or every example it makes harder. The specific claims about subjects and objects in the method explain the design, while the ablation measures the consequence of including that design in the system.

#### The vocabulary bundle matters most where terminology varies

The lexical comparison adds the task’s gazetteers together with the annotations for names and organizations. The paper labels the task-specific list bundle Gaz. Its composition varies by task, so the same column heading can represent very different vocabulary sources. SM20-5 receives birth defect, pregnancy, anatomy, and relationship lists. SM18-4 receives relationship lists in a task whose central topic is already confined to flu. The named entity annotations are included with those resources in the reported comparison.

On the official birth defect test, RoBERTa has micro-F1 of .65 without the extra features, .71 with the gazetteer and named entity bundle, and .73 with the lexical bundle and the extended tags and dependencies. The corresponding ELMo values are .62, .68, and .69. This is the kind of task for which the paper’s motivation about specialized terms applies most directly. A list can place alternative ways of naming a condition under the same annotation, while the grammar and relationship features help judge how that condition is being discussed.

For held-out flu vaccination, RoBERTa without features scores F1 of .85, and the lexical bundle gives .86. The extended tags and dependencies together give .88, with the full combination reaching .89. The authors connect the smaller lexical change to the narrow vocabulary of the task. Once a tweet is discussing a flu vaccine, the important remaining issue is whether the writer actually received it or intends to receive it. More lexical evidence about relationships can help, while there is little scope in this setup to expand the range of terms that mark the vaccination topic itself.

The adverse reaction results show why the authors stress the combination of features. For BioBERT on the official test, the gazetteer and named entity bundle alone yields F1 of .63, compared with .62 without added features. The extended tags and dependencies are associated with .65, and using all the resources gives .67. The lexical features can indicate what is a drug, an adverse reaction expression, or an affected body part. The grammatical features help supply the relation among those expressions and the person reporting the experience. The full comparison tests their joint availability, while the separate rows show that neither bundle accounts for the full pattern on its own.

The released comparison in the paper does not isolate every individual resource. A row containing Gaz, Name, and Org cannot identify how much of its change comes from the lists and how much comes from detecting people or organizations. Within Gaz, the role of a particular MeSH branch is also pooled with that of the other lists supplied to the task. The paper’s interpretation of lexical variety is supported by the contrast across tasks and by the illustrative tweets. The table gives stronger evidence about bundles of annotations than about the separate causal responsibility of each resource.

#### What changed in the attention examples

The authors inspect the importance scores used in attention pooling for one birth defect example and one adverse reaction example. Each visualization compares a configuration with gazetteers against one without them. Darker shading corresponds to a higher importance score. The diagrams address a narrower question than the accuracy evaluation. They show where the scoring operation changes its emphasis when the represented input includes gazetteer information.

In the birth defect example, the writer reports a stillbirth in connection with Trisomy18 and mentions expecting a healthy baby. Without the gazetteers, the classifier gives some weight to the birth defect expression and emphasizes the first-person pronoun and familiar words connected with childbirth. The pregnancy complication receives little emphasis in that visualization. When the birth defect and pregnancy lists are supplied, the stillbirth mention receives more attention. The authors describe the resulting prediction as more certain. The comparison shows how a medically relevant expression can become more prominent when the classifier has a dedicated annotation for it.

That example also shows why the labels of the lists and the task need to be read separately. Stillbirth receives an annotation associated with pregnancy complications, which helps the classifier interpret the surrounding account. The label for the tweet still concerns the self-reported birth defect category. The co-occurrence of Trisomy18, the pregnancy expression, and personal wording is relevant to the whole decision. The presence of one well-marked term can influence the interpretation of the rest of the message through the layers that contextualize and connect its words.

For the adverse drug reaction example, the authors report that adding anatomy and drug gazetteers draws more attention to the medication and to the affected body parts. These are the positions where the supplied resources give the classifier explicit domain information. The observation is consistent with the intended use of the annotation vectors. It gives a concrete example of what a change in the input can look like by the time the classifier pools the tweet.

There is a difference between the importance a position receives in pooling and the effect of an input word on the entire prediction. A representation can already contain information from other positions after self-attention and the dependency operation. The attention weight says how strongly that representation is used relative to the others in the pool. The case studies show an interpretable change in emphasis for the displayed examples. The ablation scores supply the broader evidence that the resource bundle improves classification under the tested conditions.

### Limitations

#### Limits the authors identify

The authors emphasize that usefulness varies with lexical coverage and with the task. Curated terms help most when narrowing the topic requires distinctions among different expressions. They point to the flu vaccination task as a case where the central trigger vocabulary is very restricted. The experimental benefit of a gazetteer depends on what additional distinctions it can supply beyond the signals the system already has. Having a high-quality resource available is therefore only part of the problem. The selected categories and entries also need to match the decisions required by the labels.

The paper treats recall as an area for further error-driven adaptation. On the official tests for adverse reactions and birth defects, the strong combined settings improve F score and precision over the references reported in the table, with lower recall. The authors favor the emphasis on precision for health research. Their experiments establish that tradeoff under the reported scoring conditions, and they leave further work on retrieving missed cases outside their study of gazetteers and linguistic features. In practice the significance of the missed cases would depend on what researchers sought to do with the retrieved tweets.

The paper also states the data availability constraint behind the earlier tasks. SM18-2 and SM18-4 use holdouts and reproduced reference systems. These are meaningful comparisons on the chosen data, but the official competition test results for those tasks cannot be inferred from them. The evaluations for SM19-1 and SM20-5 use the official tests. Any account of performance across all four tasks needs to retain that difference in the source of the test sets.

The proposed adaptation relies on access to experts or resources that can supply appropriate terminology. Addition keeps the input width fixed, and the paper describes further training with a new annotation vector. The work therefore addresses a specific kind of adaptation cost, namely the need to redesign the input dimensions whenever a type is added. The authors’ proposal still assumes that a relevant list can be assembled and that the classifier can be further trained to make use of the information it supplies.

#### Limits of the evaluation design

The experiments establish results on labeled tweet benchmarks. A benchmark can tell whether decisions agree with its reference labels. It cannot verify that someone took a drug, received a vaccine, or experienced the event a post describes. Those outcomes would require a different kind of evidence. The appropriate object of the classifier is the report indicated by the text, including the benchmark’s judgments about unclear cases. The scope of the results follows from how the examples are collected and labeled.

The cross-task evidence shows the architecture working with several sets of labels and vocabulary choices. Each task has its own data, resources, and training settings. The design therefore tests whether the same architecture can be configured successfully for related problems. It leaves open how a trained configuration would fare if transferred directly to another social platform, another language, or a health topic with a different way of talking about experiences. The authors make a broader argument about adapting the architecture, while the measured evidence concerns the tasks for which they built and tested those configurations.

The paper motivates the gazetteers partly as a way to handle terms absent from the labeled training examples. The reported test comparisons pool all relevant cases. They do not give separate performance on terms seen during training and terms found only through the external lists. Gains could come from resolving a rare term, reinforcing a category for a familiar term, locating an expression for the dependency stage, or improvements associated with name and organization features. The method makes recognition of additional terminology possible, and the aggregate experiment measures the result of supplying the annotation bundle. The precise share due to generalization to previously unseen terms remains unmeasured.

The ablations also leave some interactions untested. The lexical bundle combines resources that operate on very different evidence. In the adverse reaction task, for instance, the full gazetteer set spans drugs, conditions, adverse reactions, anatomy, and relationships. The change in score when the bundle is added gives no direct estimate of what would happen if only the anatomy list were inserted or removed across the test set. Similarly, the attention examples demonstrate changes in particular messages without estimating how often similar changes occur or how strongly each contributes to correct classification.

The paper reports point scores. It supplies no uncertainty ranges that would indicate how stable the smaller differences are under repeated training or a different holdout. That matters when comparing rows with adjacent displayed scores or interpreting ties. The training table documents epochs and learning rates, but the results as presented cannot resolve whether a small advantage would persist under a different run. Larger patterns, such as the precision and recall tradeoff on the official tests, can be described directly from the reported metrics without assigning statistical significance to the differences.

The motivation also includes the computational cost of large pretrained systems. The experiments compare predictive performance across embedding choices and show what happens when lighter representations receive explicit resources. They do not report measured training time, inference time, or the end-to-end cost of obtaining all annotations and parsing each tweet. The parameter counts cited in the motivation characterize the scale of particular pretrained systems. The practical speed of the full pipeline, including its external linguistic processing, remains an open measurement.

Finally, the success of the graph and named entity features depends on the analyses supplied to the classifier. The paper gives examples that make the intended syntactic links and entity categories understandable, and the ablations measure the effect of those components as used. It does not separately evaluate their annotation accuracy on the tweets or sort classification errors by faulty parse, missed entity, or misleading dictionary match. A gain from the graph under the benchmark conditions shows that its outputs are useful in aggregate. It leaves the contribution of individual parsing decisions and their errors unresolved.

### What came after

No later work is documented here as building on the paper’s approach. The experiments leave open whether a classifier already trained for one health topic can be adapted successfully by adding a new terminology list and continuing training, how much that procedure depends on new labeled examples, and whether the observed precision gains persist in other settings. The paper evaluates the same architecture across several tasks with their own configurations, which establishes a basis for those questions.

## Cite

Cite as Parsa Bagherzadeh and Sabine Bergler. 2021. Leveraging knowledge sources for detecting self-reports of particular health issues on social media. Proceedings of the 12th International Workshop on Health Text Mining and Information Analysis.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{bagherzadeh2021leveraging,
  title = {{Leveraging knowledge sources for detecting self-reports of particular health issues on social media}},
  author = {Parsa Bagherzadeh and Sabine Bergler},
  booktitle = {Proceedings of the 12th International Workshop on Health Text Mining and Information Analysis},
  year = {2021},
  url = {https://aclanthology.org/2021.louhi-1.5/}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
