Elamur Research

BERT based natural language processing for triage of adverse drug reaction reports shows close to human-level performance

Paper · 2023 · Erik Bergman, Luise Dürlich, Veronica Arthurson et al.

Summary

When a suspected drug reaction is reported, the Swedish Medical Products Agency uses the report’s seriousness designation to help decide how soon an assessor should review it. A report can describe a case that meets the criteria for seriousness even if the reporter leaves it marked as non-serious. Bergman and colleagues ask whether the description itself can help catch these cases. They use natural language processing to classify reports from the account of the reaction and the reported adverse event terms. The intended use is to move potentially serious cases up the review queue.

The authors compare systems that count words, learn from word sequences, or draw on BERT already trained on Swedish text. They also give BERT further practice predicting words in historical drug reaction reports. This produces a version called Adverse Event Report BERT, or AER-BERT. The strongest classifier starts from that version and adjusts the whole network during training on seriousness labels. Both BERT approaches generally outperform the word-count and recurrent approaches. The extra practice on historical reports improves classification only slightly in the development comparisons, with a larger effect when BERT supplies fixed features to a separate classifier.

On a later test set of 3,443 reports, assembled after the classifiers were frozen and excluding reports related to Covid-19 vaccines, the leading classifier achieves an F1 score of 72.1%. Its precision for serious reports is 0.796 and its recall is 0.658. In a separate test of 200 reports, experienced assessors receive the same kinds of text as the automated systems. Against the recorded labels, AER-BERT achieves an F1 score of 0.739, compared with 0.766 and 0.775 for the assessors. It identifies a smaller share of the reports labeled serious than either assessor, even though its serious predictions agree with the recorded labels more often.

The recorded labels also complicate the comparison. The agency retains a reporter’s serious designation even when the assessor finds that the case falls short of the criteria. Reports initially marked non-serious can be upgraded. A disagreement with the database can therefore reflect a classification error or a difference between what the text supports and what the agency records. The study shows that text can help identify reports worth reviewing sooner. The assessment of each case, including any follow-up needed to establish its seriousness, still requires an assessor.

Deep dive: BERT based natural language processing for triage of adverse drug reaction reports shows close to human-level performance

Bergman and colleagues test how well Swedish BERT can identify serious adverse drug reaction reports from the text available at triage. · about 32 minutes to read

The problem and its context

Serious reports can enter the queue at ordinary priority

The evidence available when a medicine is authorized gives an initial picture of its safety. The trials that support authorization are better placed to observe reactions that occur often enough in the people they enroll. Rarer reactions are harder to characterize because trial size and eligibility restrict what can be observed. Safety monitoring after authorization adds evidence from use beyond those trials. The Swedish Medical Products Agency receives reports of suspected adverse drug reactions from healthcare professionals and from patients or other consumers, through both electronic and paper submissions.

A report describes an event suspected to be associated with a medicine. At intake, the agency needs to decide which reports to assess first. Seriousness has a specific meaning in that setting. The criteria include outcomes such as death, a threat to life, a congenital malformation, admission to hospital or a longer hospital stay, lasting disability or damage, and other medically important events. These criteria give assessors a basis for deciding which cases warrant priority. Much of the evidence for applying them can be expressed in ordinary narrative. An account of a hospital admission, for instance, may contain information relevant to seriousness whether or not the intake designation reflects it.

The problem arises because the person making the report supplies the initial designation. A potentially serious case can wait longer for review if that designation is non-serious. At high volumes, the agency has to find these cases among many submissions. Earlier assessment could help the agency recognize a possible safety issue sooner. Such recognition depends on what assessors find across cases, as well as on any extra information they need to obtain. The task in this study concerns the earlier decision about which individual report should receive attention.

The authors use text classification to make that decision tractable. Each report gets a prediction for the serious class from the description of the reaction and the adverse event terms. The system can use information about a medicine or a patient when that information appears in the text, but it receives no separate fields for those characteristics. The custom of using only the reaction text creates a clear test of what can be recovered from it. It also makes the output easier to interpret as a second reading of the information the reporter supplied about the event.

The target determines what counts as a useful predictor

Earlier studies had already applied automated classification to drug safety reports. The papers Bergman and colleagues discuss differ in the decisions they try to support. A system may estimate whether a case is likely to be useful in a pharmacovigilance review, meaning a review concerned with monitoring medicine safety. It may also identify submissions that warrant a particularly thorough clinical review. Those goals can overlap with seriousness, but they lead to different labels and different choices about what information to use.

Muñoz and colleagues predict the likelihood that a pharmacovigilance review will include a given individual case safety report. It uses report metadata together with features derived from the narrative, such as its length and the occurrence of selected expressions. Lieber and colleagues study the triage of Dutch reports for detailed clinical review. Their system combines decision trees and uses 175 features. These include case and patient information, drug names, the existing seriousness designation, narrative length, and indicators for words selected by experts. In that setting, seriousness can help predict the review decision. In the Swedish study, seriousness is itself the outcome to predict. Giving the classifier the recorded designation would undermine the purpose of checking what the narrative says independently of that field.

The closest earlier task in the paper is the study by Routray and colleagues. It uses the narrative, adverse event information, and preferred terms from MedDRA, the terminology referred to in the paper for standardizing such terms. Its recurrent systems use GloVe representations pretrained on PubMed material. The work addresses binary seriousness and also considers specific seriousness categories and the text that supports them. The Swedish study concentrates on the binary decision. It asks whether a report should be flagged as potentially serious, leaving the interpretation of the evidence and the category assignment to the assessment process.

French studies supply another comparison. Létinier and colleagues test several approaches to identifying adverse reactions and classifying their seriousness in texts from a single pharmacovigilance center. Gradient boosting gives promising results for identifying reactions, while seriousness classification is harder across the approaches they try. The Swedish authors report that limited training data was a possible explanation for the weaker results. The French study also cites the lack of a French BERT pretrained on biomedical text as one reason for leaving that option untested.

Martin and colleagues extend that work with a larger set of annotated French reports. They compare gradient boosting with approaches using general-purpose transformers. In the authors’ account, the tree-based approach to finding reactions uses structured information and TF-IDF, which gives words different weights based on their frequency in a text and across the collection. For seriousness, the comparison includes boosting with FastText representations trained on French medical material and a system that draws on CamemBERT. The authors describe the French comparison as a balance between access to specialized features or representations and the expressive capacity of a general transformer. The French national health authorities use the less computationally demanding approaches described in that work.

Swedish pretraining and sensitive records shape the choice of system

The study sits within a change in how language tasks were approached. Earlier designs often combined features chosen for a particular task with a classifier built to use them. BERT offered a way to start with a general training stage and then adapt the same underlying network to different tasks. In this case, fine-tuning means adjusting a pretrained network using examples of reports with recorded seriousness labels. The language training gives the classifier a starting point for representing the text before it encounters examples of the triage decision.

The authors also discuss an alternative in which a generative system performs a task from a prompt with few or no examples, as in the work on GPT-3. They cite ScandEval in explaining why they chose to study Swedish BERT. Their account of that benchmark is that several Swedish and Norwegian BERT systems compare favorably with generative systems on Swedish tasks, while large Swedish BERT variants and GPT systems feature among strong classifiers on tasks such as sentiment and linguistic acceptability. Those tasks informed the choice of architecture. Triage of suspected reactions still required its own evaluation. GPT-4 Technical Report

The agency’s records also constrained the comparison. The authors could not send the reports to external servers, and larger generative systems were demanding to run locally. They chose Swedish BERT as the largest architecture to evaluate and compared it with simpler systems that could use the same intake text. The design therefore reflects the language of the reports, the resources available for processing them, and the restrictions on where processing could occur.

Biomedical work in English gave the authors a reason to test a second stage of pretraining. Some systems were trained from scratch on specialist material. PubMedBERT, for example, started with PubMed abstracts. Others extended an existing BERT with additional material. BioBERT used abstracts and full-text biomedical articles, while BlueBERT used abstracts and de-identified clinical text. ClinicalBERT extended BioBERT with clinical text, and SciBERT drew from publications in biomedical and computer science fields. PharmBERT focused on drug labels. The paper describes benefits from domain specialization on tasks including named entity recognition, relation extraction, question answering, and document classification. PubMedBERT · BioBERT · BlueBERT · SciBERT

The authors had no existing Swedish biomedical BERT available to them. Their starting checkpoint nevertheless had some exposure to medicine-related writing through FASS, a Swedish source of information about authorized medicinal products that includes lists of adverse reactions. That left a narrower question about specialization. The authors could test whether further exposure to the language of actual Swedish reaction reports would help a system that already knew general Swedish and had seen Swedish medicinal product information.

The method, step by step

Give the historical and current records different jobs

The agency held reports in a historical format and a current format. The historical record typically takes the form of an assessor’s summary that includes material from the incoming report. It does not clearly separate the reporter’s own words from the assessment. That is a problem for a system that is supposed to work from intake text before full assessment. If a training example contains the assessor’s conclusion, it can teach the classifier to use wording that will often be absent when a new report arrives. The authors therefore use historical reports only for additional language training.

The current format preserves the original free-text fields, including the reaction description, together with the terms for individual reported events. The authors note that occasional assessor notes also appear in these fields. For seriousness classification, they select the description of the reaction and the adverse event terms. Structured information about the medicinal product and patient stays outside the classifier. The authors choose this restriction to reduce dependence on product and patient characteristics. They remove all digits from the free text to strip out numbers that might identify a person directly or indirectly. Because this operation applies to every digit, it can also remove numerical material that has a different role in the narrative.

The supervised stage uses a current-format development set, meaning the set from which the authors train classifiers and compare development performance. They first define a fixed split with 80% of the set for training and 20% for validation. Validation checks predictions on reports outside the portion used to fit the system. They later repeat the division many times to examine how that choice affects the measured performance. A separate chronological test uses more recent cases acquired after the systems were frozen. A human benchmark uses another reserved set and asks experienced assessors to make a decision independently from the same kinds of text.

From Swedish drug safety reports to seriousness predictions

The steps in order.

From Swedish drug safety reports to seriousness predictionsStep 1: Separate historical summaries from current report records1. Separate historical summaries from current report recordsStep 2: Mask words in historical summaries2. Mask words in historical summariesStep 3: Continue Swedish BERT pretraining on historical text3. Continue Swedish BERT pretraining on historical textStep 4: Select reaction narratives and reported event terms4. Select reaction narratives and reported event termsStep 5: Fit seriousness classifiers on labeled current reports5. Fit seriousness classifiers on labeled current reportsStep 6: Evaluate frozen classifiers on later reports6. Evaluate frozen classifiers on later reportsStep 7: Compare automated and blinded human classifications7. Compare automated and blinded human classifications

The historical stage in this sequence applies to AER-BERT. The other classification routes start with the original Swedish BERT or learn their own representations from current reports. All routes end in the same distinction between serious and non-serious reports. Their common input and outcome make it possible to compare how much they gain from different ways of representing the text.

Teach BERT about report language before teaching it seriousness

The starting system is the large Swedish BERT from AI Nordics, with 340M parameters. Parameters are the adjustable quantities learned during training. BERT uses a transformer, which can use other parts of the input when building a representation of each piece of text. That makes it possible for the representation of a term to depend on how it is used in a particular report. A word-count system assigns the same count to that term each time it occurs, regardless of its surrounding words.

The authors continue Swedish BERT’s training on the historical reports by asking it to predict masked text. Masking hides information that would otherwise be visible. The network has to use the remaining context to recover the hidden material. This gives it practice with the language of drug reaction reports without requiring an assessor to identify which phrases express seriousness. The agency’s seriousness labels play no role in this stage. The training target is the original language that the masking procedure has hidden.

The authors concatenate the historical reports and apply subword tokenization. This splits text into units that can include pieces of words, allowing the vocabulary to represent longer forms by combining pieces. The token stream is divided into 98,040 chunks, each containing 128 tokens. These chunks are units for language training. They do not define the length of a report in the classification task, and the concatenation means that a chunk need not correspond to a single report. The authors allocate 90% of the chunks to training and 10% to validation.

The authors mask 10% of words. They choose whole words as the units to hide because their corpus contains complex biomedical terms that BERT can split into many pieces. A masked fragment can sometimes be guessed from the portions of the same word that remain visible. Hiding the word as a whole gives the surrounding context more work to do. The authors choose a rate below the commonly used 15% because they are adapting a broadly trained system on a comparatively limited historical corpus and want to preserve its general language abilities.

During this stage, the authors monitor perplexity on the historical validation chunks. Perplexity expresses the cross-entropy loss on a different scale. In this setting, cross-entropy measures how much probability the system assigns to the correct hidden text, penalizing predictions that give it little probability. The relationship specified in the paper can be written as follows.

P = exp(L)

P denotes perplexity. L denotes the cross-entropy loss for the masked-language predictions being evaluated. The equals sign states that P is obtained by applying exp, the exponential function, to L. The parentheses identify the argument of that function. Lower loss gives lower perplexity, so falling validation perplexity indicates better prediction of the hidden language on those chunks. It gives no direct measure of the accuracy of seriousness classifications.

Additional pretraining starts with a learning rate of 2e-5. The learning rate governs how large the parameter updates can be during training. The authors stop after six epochs, where an epoch is a pass through the training data. They give the same preservation rationale for stopping as they do for the lower masking rate. Their aim is to learn from report language while retaining the capabilities of the starting Swedish BERT. They call the resulting checkpoint Adverse Event Report BERT, shortened to AER-BERT. The two BERT-based routes can each use either the original checkpoint or AER-BERT, which makes it possible to compare the effect of the extra language training within each route.

Count words and fit a tree classifier

The simplest baseline is CV + XGB. Here CV means count vectorizer. It turns each document into a vector whose entries record the occurrences of words from a retained vocabulary. The authors implement this using scikit-learn’s CountVectorizer. They remove Swedish stop words, which are common words selected for exclusion, and restrict the vocabulary to 10,000 features. Each retained feature records the count of a word in the report. Reports in which the same retained words occur the same number of times receive the same representation.

This is known as a bag-of-words representation because it discards word order. It can give the classifier direct access to words associated with a seriousness label. The classifier can also learn that combinations of counts are informative. The representation has a clear boundary: a term used to describe something that happened can receive the same count as a term used to describe an outcome that was ruled out. Any distinction between the two would have to come from other retained counts. The vector has no entry that identifies the grammatical relationship on its own.

The authors fit XGBoost to these document vectors. XGBoost uses boosted decision trees. A tree makes a series of splits on input features, and boosting combines trees so that successive contributions can improve the overall prediction. Here the splits concern word counts. The system learns their relationship to the recorded labels from the development training reports. The authors place the XGBoost settings in a supporting table. The word-count baseline provides a test of how far vocabulary associations can take the task with the same reaction fields available to the other systems.

Learn a sequence classifier from the labeled examples

The recurrent baseline is an LSTM, short for Long Short-Term Memory. It processes the words in sequence and carries information from earlier steps into later ones. The authors use a bidirectional layer so that the network has a pass in each direction. A word can therefore contribute in light of material that precedes or follows it. This provides a way to distinguish documents that contain the same words in different orders.

The vocabulary includes the 20,000 most frequent words after Swedish stop-word removal. A further 1,000 buckets are available for words outside that vocabulary. These buckets give the network a way to encode forms for which it has no individual vocabulary entry. A static lookup table maps the incoming words to the appropriate identifiers. The embedding layer then represents the identifiers with learned numerical vectors. These word embeddings are trained for the seriousness task from the available labeled data. The network begins with randomly initialized weights.

A bidirectional LSTM of size 128 is used with embeddings that have 128 dimensions. A dense layer of size 128 follows, using a rectified linear unit, or ReLU. The final layer has size 1 and uses a sigmoid, which turns its input into a score between the endpoints for the two classes. Training uses binary cross-entropy, a loss that penalizes the system for giving low probability to the recorded class. The authors implement this route with Keras, TensorFlow, and TensorFlow Text. They use the Adam optimizer with a learning rate of 5e-5 and train for three epochs.

The LSTM comparison asks whether learning to process a sequence from the current labeled reports is enough to improve on a vocabulary-based baseline. It also gives the authors a point of comparison for the pretrained systems. The difference between the LSTM and BERT includes how each processes sequences and how much learning took place before seriousness training. Their performance therefore compares complete approaches to the task.

Use BERT either to make features or to learn the decision

In the first BERT route, the authors still use XGBoost to make the final classification. They replace the count vector with a representation built by SentenceTransformer. BERT first produces a vector for each token, taking into account the rest of the input. The authors then use mean pooling, which averages those token vectors into a single vector for the sequence. With the large Swedish BERT, that vector has 1024 dimensions. XGBoost learns to predict seriousness from the resulting features.

This route has a boundary between language processing and classification. The selected BERT checkpoint produces the report vectors, and those vectors become inputs to the trees. Training the trees leaves BERT’s parameters fixed. Changing from the original checkpoint to AER-BERT can change how a report is represented, even though the classifier that consumes the representation follows the same design. The paper calls these variants BERT + XGB and AER-BERT + XGB.

Averaging the token vectors gives the tree classifier a representation of fixed size. Each token vector can already incorporate context because BERT computed it within the sequence. The average, however, gives the trees access to the pooled features only. The trees receive no separate vector for a particular phrase they might need to inspect. This distinguishes the setup from the final route, in which the network that processes the text is itself trained to make the report-level prediction.

The second BERT route places a classification layer on the pretrained network and trains the combined system on the seriousness labels. The authors use the CrossEncoder component of the sentence-transformers library to feed it a single sequence per example. The classification objective updates both the final layer and the underlying BERT parameters. As a result, the same examples that teach the final decision also have an opportunity to change the representations on which that decision relies. The two versions start from original Swedish BERT and AER-BERT, respectively, and appear as BERT clf and AER-BERT clf.

The authors train the sequence classifier for 1 epoch. They use AdamW with an initial learning rate of 2e-5 and devote ten percent of the training data to warm-up, the initial portion of training during which the update schedule ramps up. A later check considers 2 epochs. The main design choice is how much of the system the labeled reports can change. When BERT is a fixed feature generator, the labels teach XGBoost how to use the existing representation. When the whole network is fine-tuned, the labels can also teach BERT to represent the input differently for the seriousness decision.

Experiments and results

The evaluations answer different questions

The historical pretraining set covers 2000-01-03–2017-12-29 and contains 89,712 reports. Its role is to supply language examples for AER-BERT. The current-format development set covers 2017-01-12–2020-12-31. It contains 14,985 reports, of which 5,557 are recorded as serious and 9,428 as non-serious. These are the reports used for supervised fitting and validation. The distinction between historical and current records comes from how the reports were stored and which fields can be used, so the calendar ranges of the two sets overlap.

The authors set the development cutoff at 2020-12-31 in response to the rapid rise in reports concerning Covid-19 vaccinations from Q1 2021. The incoming reports and the priority given to assessing serious cases led to pronounced imbalances during that period. Once the classifiers were frozen, the authors assembled a prospective test set from 2021-01-01–2021-06-30, excluding reports related to Covid-19 vaccines. The resulting set has 3,443 reports, including 1,170 serious and 2,273 non-serious cases. Putting later reports aside until the systems were fixed tests whether the fitted decision transfers to a later stream of reports within those inclusion rules.

The human benchmark covers reports dated 2017-01-12–2021-11-09 and contains 200 held-out cases. Two experienced assessors classify the reports independently in a blinded secondary assessment based on the reaction narrative and the event terms. That test asks how human and automated readers agree with the database when they receive the same kinds of textual evidence. The prospective test serves a different purpose. It estimates performance of the frozen systems on a later sample without requiring a parallel human reading of the entire sample.

The comparison uses seriousness as the positive class. Precision is the share of predicted serious reports whose reference label is serious. Recall is the share of reference serious reports that the system flags. Specificity is the share of reference non-serious reports classified as non-serious. Accuracy is the share of all reports classified in agreement with the reference. F1 combines precision and recall through their harmonic mean, which keeps a system from receiving a high F1 score by doing well on only one of them. These measures give different views of a triage decision. Recall relates to how many recorded serious reports are found, while precision relates to how often a flag agrees with the recorded seriousness designation.

Repeated validation favors the fine-tuned classifier

After using the fixed development split, the authors examine how the results vary across different partitions of the same dataset. In their Monte Carlo cross-validation, they create 100 random divisions, with 80% of the reports for training and 20% for validation each time. A classifier is fitted and evaluated for every division. This yields a distribution of scores for each configuration and an empirical view of how much the choice of partition matters. Reports can appear in multiple runs, so the exercise concerns variability within the development dataset. The chronological test provides the separate check on later cases.

Mean F1 for seriousness classification on repeated development splits

Fine-tuning AER-BERT gives the highest mean F1, followed closely by fine-tuning the original Swedish BERT.

Mean F1 for seriousness classification on repeated development splitsCV + XGB: 0.649CV + XGB0.649LSTM: 0.658LSTM0.658BERT + XGB: 0.713BERT + XGB0.713AER-BERT + XGB: 0.719AER-BERT + XGB0.719BERT clf: 0.751BERT clf0.751AER-BERT clf (this paper): 0.755AER-BERT clf (this paper)0.755
The numbers
System or settingF1
CV + XGB0.649
LSTM0.658
BERT + XGB0.713
AER-BERT + XGB0.719
BERT clf0.751
AER-BERT clf (this paper)0.755

Across the development partitions, AER-BERT clf has a mean accuracy of 0.833, mean precision of 0.828, mean recall of 0.695, and mean specificity of 0.915. The original BERT classifier follows closely, with 0.831 mean accuracy, 0.827 mean precision, 0.688 mean recall, and 0.915 mean specificity. The mean F1 comparison thus comes with similar precision and specificity, plus somewhat greater recall for the classifier starting from the historical report training.

The word-count baseline reaches a mean specificity of 0.916 on the same validation runs. Its mean recall is 0.550. It agrees with the database on many of the non-serious cases and identifies a smaller share of the serious ones. The LSTM reaches a mean recall of 0.602 and mean specificity of 0.869. Their ordering changes with the measure because they make different tradeoffs between the two classes. For an agency using these predictions to decide which reports to review sooner, the distinction between finding serious cases and limiting extra flags matters more than a comparison of overall accuracy alone can show.

The repeated splits also show variation within each approach. The standard deviation of validation F1 is 0.0105 for AER-BERT clf and 0.0268 for the LSTM. The LSTM’s recall has a standard deviation of 0.0706, compared with 0.0226 for AER-BERT clf. These figures describe variability across the partitions of the development reports used in the study. They do not measure variability across agencies, different languages, or different periods of reporting.

The prospective ranking is similar

The leading classifier on the development splits also has the highest F1 on the later reports. It is followed by the classifier using fixed AER-BERT features, then the LSTM and the word-count baseline. The prospective results are reported for the final versions of the four architecture types. The original BERT variants in the development comparison do not have separate rows in the prospective results.

F1 for seriousness classification on the prospective test set

The fine-tuned AER-BERT classifier leads the comparison on the later reports.

F1 for seriousness classification on the prospective test setCV + XGB: 0.632CV + XGB0.632LSTM: 0.650LSTM0.650AER-BERT + XGB: 0.695AER-BERT + XGB0.695AER-BERT clf (this paper): 0.721AER-BERT clf (this paper)0.721
The numbers
System or settingF1
CV + XGB0.632
LSTM0.650
AER-BERT + XGB0.695
AER-BERT clf (this paper)0.721

On the prospective set, AER-BERT clf has an accuracy of 0.827, precision of 0.796, recall of 0.658, and specificity of 0.913. AER-BERT + XGB has an accuracy of 0.814, precision of 0.786, recall of 0.622, and specificity of 0.913. The comparison shows an advantage for the fine-tuned system on precision and recall at the reported decision rule, with both systems giving the same reported specificity. The LSTM has prospective recall of 0.578 and specificity of 0.897. The word-count baseline has prospective recall of 0.542 and specificity of 0.912. The count baseline’s success at identifying reference non-serious reports again coexists with lower coverage of reference serious reports.

The authors also plot performance across decision thresholds. A threshold determines how high the score must be for the report to be called serious. Changing it changes which reports are flagged. The receiver operating characteristic curve tracks the rate of correctly identified serious reports against the false positive rate as the threshold varies. The precision-recall curve tracks how often a serious prediction is correct against how much of the serious class is found. The leading classifier’s prospective area under the receiver operating characteristic curve is 0.88, and its area under the precision-recall curve is 0.83. These values summarize the ordering of cases over thresholds. The precision and recall at the reported decision rule describe the behavior of a particular classification.

The later evaluation preserves the development finding that the two BERT approaches perform best on F1. The exact scores depend on the evaluation set. The leading classifier’s mean development F1 is 0.755, while its prospective F1 is 0.721. These results come from different experiments: one averages over repeated development partitions and the other uses a fixed classifier on later reports. Their agreement in ordering supports the use of the development experiment to compare architectures under the study conditions.

The human comparison depends on the metric

The human benchmark compares all predictions with the existing database annotation. Both assessors obtain a higher F1 than AER-BERT clf. Accuracy gives a slightly different ordering. One assessor has an accuracy of 0.800, the classifier has 0.785, and the other assessor has 0.780. The classifier lies between the assessors on that measure. The difference from F1 is informative because accuracy counts correct decisions on both classes, whereas F1 concentrates on precision and recall for the serious class.

F1 for human and automated classification on the human test set

The leading automated classifier comes closest to the assessors, who both have higher F1.

F1 for human and automated classification on the human test setCV + XGB: 0.646CV + XGB0.646LSTM: 0.667LSTM0.667AER-BERT + XGB: 0.688AER-BERT + XGB0.688AER-BERT clf (this paper): 0.739AER-BERT clf (this paper)0.739Human 1: 0.766Human 10.766Human 2: 0.775Human 20.775
The numbers
System or settingF1
CV + XGB0.646
LSTM0.667
AER-BERT + XGB0.688
AER-BERT clf (this paper)0.739
Human 10.766
Human 20.775

AER-BERT clf has recall of 0.656 on the human benchmark. The assessors have recall of 0.774 and 0.742. The classifier therefore retrieves a smaller share of the reports recorded as serious. Its precision of 0.847 is higher than the assessors’ precision of 0.758 and 0.812. Its specificity is 0.897, while theirs is 0.785 and 0.850. The metric profile is consistent with a classifier that makes fewer serious calls that conflict with non-serious database labels but misses more reports with serious labels.

The fixed-feature AER-BERT and LSTM systems show why high precision alone does not determine which classifier is preferable. Their precision on the human benchmark is 0.869 and 0.850, respectively, both above the fine-tuned system’s 0.847. Their recall is 0.570 and 0.548, respectively. The fine-tuned system has the stronger F1 because it combines its precision with better coverage of serious reports. The practical comparison concerns the number and kinds of cases a triage system brings forward, as well as the proportion of useful flags.

The phrase “close to human-level performance” refers to this constrained comparison: experienced assessors and automated classifiers read the same kinds of report text, and their predictions are scored against the same recorded annotations. The evidence is strongest for proximity on aggregate scores. A case that both assessors independently identify as serious can still be missed by the classifier. Similarly, the different recall and precision results show that similar aggregate performance can arise from different patterns of agreement with the database.

What the ablations show

Historical language training changes F1 only slightly

The cleanest controlled comparison starts with the same Swedish BERT and asks what happens when the authors continue its pretraining on historical report text. They make the comparison within each BERT-based approach. For XGBoost, they change the checkpoint that generates the features while keeping the route from vectors to the final classification. For the fine-tuned classifier, they change the starting checkpoint before supervised training. Both comparisons use the repeated development splits, giving the authors results from the same sets of reports for the variants being compared.

On the historical validation chunks, perplexity falls from 3.01 for the original checkpoint to 1.19 after six epochs of additional training. AER-BERT is better at predicting masked language in this material. The classification gains on the development reports are much smaller. Within the direct classification route, mean F1 is 0.751 with original BERT and 0.755 with AER-BERT. With XGBoost, mean F1 is 0.713 with original BERT features and 0.719 with AER-BERT features. The difference between language prediction and downstream classification is important here. Much of what a system learns about recurring report phrasing can improve its ability to predict hidden text without changing the evidence it uses for a binary seriousness decision.

The paper’s comparison of the paired F1 distributions shows a somewhat larger effect from additional pretraining for the fixed-feature approach. The authors explain this through the point at which BERT can learn about the domain. Once XGBoost receives the vectors, the text encoder has no further opportunity to adjust. Its earlier exposure to historical reports can therefore contribute something that training the trees cannot supply. In the direct classifier, the labeled current reports update the encoder itself. Some adaptation to report language can take place at that stage, which could leave less for the historical step to add.

The experiment supports that explanation as an interpretation of the pattern. It does not directly measure changes in the representation of specific medical terms or identify which reports benefit. The original BERT also had exposure to FASS. The measured gain is the value of adding historical summaries to that particular starting point, with the authors’ masking and training choices. It cannot establish what the same procedure would contribute to a Swedish network with no previous exposure to medicinal product text.

Changing the classifier also changes how the text can be used

The paper compares the fine-tuned classifier and XGBoost route with the original checkpoint and again after historical pretraining. Fine-tuning gives higher mean development F1 in either case. With AER-BERT, the result carries through to the prospective and human tests. This pattern suggests that allowing the network to adapt to the seriousness labels is valuable in the study. The result applies to the full design, which combines training the encoder and using the network’s own classification layer.

The comparison does not isolate the contribution of any one of those choices. The fixed-feature setup also uses mean pooling and a tree classifier, whereas the direct route makes its decision within the network. A change in performance could involve both the representation and how the classifier uses it. Likewise, the comparison between BERT and the LSTM changes the architecture, the prior language training, and the representation. The authors attribute the BERT systems’ advantage in part to the broad training and self-attention they bring to relatively limited labeled data. The experiments establish the advantage of the evaluated systems under that data setup. They do not assign a separate effect to each architectural feature.

The authors carry out a smaller check on the length of classification training. Their post-hoc experiment finds no notable development improvement when training BERT for 2 epochs rather than 1. That supports the training duration they use for the classification experiment. The check concerns supervised classification training. The six epochs used for masked-language pretraining are a different choice with a different training objective.

The confidence and disagreement plots expose different kinds of error

The development probability plot shows that the BERT systems make more polarized predictions. Their scores are more often near the ends of the serious-versus-non-serious scale, including some cases where the prediction disagrees with the reference. The LSTM gives a more evenly spread set of scores, and the word-count baseline is the clearest example of that pattern. Higher F1 therefore accompanies a tendency for some errors to receive more extreme scores. The plot describes concentration in the predictions. It does not establish that predicted probabilities match observed frequencies at particular score levels.

The human test provides a second view of disagreement. The paper displays the judgments case by case, grouped by whether the database label is serious or non-serious. In some cases, human and automated readings agree with each other while differing from the database. The authors regard the agency’s rule for keeping a reported serious label as a likely reason for some of these disagreements. If the text gives the secondary readers no basis for judging the case serious, they may all disagree with an annotation that the workflow has retained.

These comparisons show why it matters to know how a label was produced. Agreement among independent readers indicates that some discrepancies merit attention, but the study does not separately adjudicate those reports to determine whether the recorded label or the text-based decision better reflects the case. The display describes where disagreement occurs. The agency’s recording practice gives a plausible mechanism for part of it.

Limitations

Limits the authors identify

The authors emphasize the asymmetry in the reference labels. When a reporter identifies a case as serious, the agency retains that status even if an assessor considers the criteria unmet. The workflow did not record that disagreement separately. When an incoming report is marked non-serious and the assessment finds a seriousness criterion, the report can be upgraded. The resulting database field can therefore reflect either evidence found in assessment or the agency’s obligation to retain the reporter’s designation.

This affects the training target and the reported metrics. A classifier can receive a serious training label for an account that contains no clear textual evidence of seriousness. A secondary reader can make a reasonable decision from the text and still count as wrong against the database. The authors suggest that improvements in how the agency captures its assessments could improve both training and evaluation. With the current records, the reported numbers describe agreement with the operational annotation. Assessing agreement with a separately adjudicated clinical judgment would require a different reference.

The authors also describe triage as one step in a longer process. An assessor can interpret the report, correct a mistaken classification, annotate the case, and seek additional facts when the description is incomplete. The automated system predicts seriousness from the available wording. It cannot supply information that the reporter omitted. The agency could use that prediction to direct staff attention toward reports likely to be upgraded, while continuing to have people assess individual cases and record the information required for later training.

The paper discusses larger generative systems as a possible avenue for future work. It also explains the practical obstacles. The authors describe the full-size GPT-3 configuration with 175B parameters as requiring highly specialized hardware to run locally, while access through an outside provider raises the problem of sending restricted report data elsewhere. Their discussion of Scandinavian benchmarks also leaves open whether a larger generative system would improve Swedish classification. The study provides no comparative result for GPT on these reports.

Access to the underlying data is restricted under Swedish rules on public access and secrecy. The authors say a data request may require a data protection agreement with the agency. That limits direct reproduction with the same cases and makes it harder for an outside reader to examine disagreements in individual records. The restrictions are also part of the reason the original system choices matter. The authors are evaluating a task whose input is sensitive even after their preprocessing removes digits.

Limits that follow from the evaluation

The prospective design tests a later period in the same agency under specific inclusion rules. Reports related to Covid-19 vaccines are excluded. That makes the results informative about the included reports after development, while leaving performance during the excluded surge unmeasured. The paper gives reasons to expect both reporting patterns and class proportions to change during such a surge. A classifier whose precision was measured on the included set may encounter a different mix of reports when those conditions change. The same study also does not provide a separate evaluation at another agency or in another language.

The reported aggregate metrics do not give the precise yield of the intended intervention. In practice, the proposed use centers on reports that arrive marked non-serious and could be promoted for earlier review. The prospective metrics are for the full included test set, using the recorded labels. A separate evaluation of initially non-serious reports, scored against which cases were upgraded, would answer how frequently the system identifies the particular queueing errors that motivate the paper. Overall F1 on recorded seriousness cannot substitute for that subgroup result because it also includes cases already marked serious at intake.

For similar reasons, the study does not measure changes in review time or the time needed to recognize a safety signal. Those outcomes depend on how the predictions would be used, how many reports get flagged, and what happens after an assessor reviews them. The precision-recall curve shows the range of tradeoffs available by changing the decision threshold. The paper does not report a threshold selected against review capacity or an observed change in assessor workload. Improved identification of serious cases at the evaluated threshold provides evidence about the classifier, while a change in queue performance would require observing the workflow.

The human test has a deliberately narrow scope. It uses 200 reports and judgments from two experienced assessors. Restricting those judgments to the narrative and event terms makes the task comparable to the automated one. It also leaves out parts of normal assessment, such as collecting additional facts. The result can establish proximity to the scores of these readers on this task. It does not establish how the system would compare with a broader range of assessors, how another group would resolve ambiguous cases, or how often the classifier’s final judgment would agree with one reached after follow-up.

The authors select textual fields to reduce dependence on patient and product information. Those fields can still mention characteristics of the patient or identify the suspected medicine. Removing digits helps strip identifying numbers from the input, but it applies equally to potentially relevant numerical details. The study gives no comparison showing what the classifiers would do with those details retained, or how their removal affects particular seriousness judgments. It also does not report subgroup performance by patient or product characteristics. The input restriction describes what the designers supplied as fields. It cannot on its own establish that those characteristics have no influence on predictions.

The presence of occasional assessor notes in the current format creates a further distinction between the fields used for evaluation and what would always be available at the instant of submission. Freezing the systems before acquiring the later test prevents the authors from fitting to that later set. It cannot establish that every phrase in every current-format field originated with the reporter or was available before any assessment. The paper does not quantify the notes or give separate performance for records with and without them. The measured result therefore belongs to the selected fields of the agency’s records as used in the experiment.

Finally, the training comparisons leave several choices linked together. The historical adaptation uses an existing Swedish checkpoint, a particular historical corpus, whole-word masking, and a limited training schedule. The paper evaluates that combination. It does not separately estimate the effects of masking strategy, historical corpus size, or source composition. The observed drop in perplexity demonstrates improved prediction on historical chunks. The smaller F1 change demonstrates that this gain transfers only modestly to the evaluated classification. Neither tells the reader which kinds of text would produce the greatest improvement if the agency collected more training material.

What came after

The later work that cites Bergman and colleagues is Natural Language Processing for Electronic Health Records in Scandinavian Languages: Norwegian, Swedish, and Danish (2025). Its subject is language processing for electronic health records across Norwegian, Swedish, and Danish. Bergman and colleagues study a narrower setting: reports of suspected drug reactions written in Swedish and processed for regulatory triage. The citation connects that case study to a broader discussion of language processing for Scandinavian health texts.

The documented connection is the citation. It does not establish that the later work reused AER-BERT, evaluated the same seriousness decision, or tested the Swedish system on electronic health records. The distinction matters because the original result depends on the wording of incoming reaction reports, the agency’s criteria for seriousness, and the way its workflow records those judgments. The later work’s scope gives the study a wider context for understanding health-related text processing in Scandinavian languages. The evidence for the triage classifier remains the development, prospective, and human evaluations that Bergman and colleagues conducted on the agency’s reports.

Cite

Cite as Erik Bergman, Luise Dürlich, Veronica Arthurson, Anders Sundström, Maria Larsson, Shamima Bhuiyan, Andreas Jakobsson and Gabriel Westman. 2023. BERT based natural language processing for triage of adverse drug reaction reports shows close to human-level performance. PLOS Digital Health.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1371/journal.pdig.0000409

@inproceedings{bergman2023bert,
  title = {{BERT based natural language processing for triage of adverse drug reaction reports shows close to human-level performance}},
  author = {Erik Bergman, Luise Dürlich, Veronica Arthurson, Anders Sundström, Maria Larsson, Shamima Bhuiyan, Andreas Jakobsson and Gabriel Westman},
  booktitle = {PLOS Digital Health},
  year = {2023},
  doi = {10.1371/journal.pdig.0000409},
  url = {https://doi.org/10.1371/journal.pdig.0000409}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bergman-2023-bert-based-natural-language-processing/