SlowGuess/ACL_2020_OCR huggingface dataset:
Mujeen Sung Hwisang Jeon Jinhyuk Lee† Jaewoo Kang† Korea University
{mujeensung, jhs, jinhyuk_lee, kangj}@korea.ac.kr
Biomedical named entities often play important roles in many biomedical text mining tools. However, due to the incompleteness of provided synonyms and numerous variations in their surface forms, normalization of biomedical entities is very challenging. In this paper, we focus on learning representations of biomedical entities solely based on the synonyms of entities. To learn from the incomplete synonyms, we use a model-based candidate selection and maximize the marginal likelihood of the synonyms present in top candidates. Our model-based candidates are iteratively updated to contain more difficult negative samples as our model evolves. In this way, we avoid the explicit pre-selection of negative samples from more than 400K candidates. On four biomedical entity normalization datasets having three different entity types (disease, chemical, adverse reaction), our model BIOSYN consistently outperforms previous state-of-the-art models almost reaching the upper bound on each dataset.
Biomedical named entities are frequently used as key features in biomedical text mining. From biomedical relation extraction (Xu et al., 2016; Li et al., 2017a) to literature search engines (Lee et al., 2016), many studies are utilizing biomedical named entities as a basic building block of their methodologies. While the extraction of the biomedical named entities is studied extensively (Sahu and Anand, 2016; Habibi et al., 2017), the normalization of extracted named entities is also crucial for improving the precision of downstream tasks (Leaman et al., 2013; Wei et al., 2015).
Unlike named entities from general domain text, typical biomedical entities have several different surface forms, making the normalization of biomedical entities very challenging. For instance, while two chemical entities 'motrin' and 'ibuprofen' belong to the same concept ID (MeSH:D007052), they have completely different surface forms. On the other hand, mentions having similar surface forms could also have different meanings (e.g. 'dystrophinopathy' (MeSH:D009136) and 'bestrophinopathy' (MeSH:C567518)). These examples show a strong need for building latent representations of biomedical entities that capture semantic information of the mentions.
In this paper, we propose a novel framework for learning biomedical entity representations based on the synonyms of entities. Previous works on entity normalization mostly train binary classifiers that decide whether the two input entities are the same (positive) or different (negative) (Leaman et al., 2013; Li et al., 2017b; Fakhraei et al., 2019; Phan et al., 2019). Our framework called BIOSYN uses the synonym marginalization technique, which maximizes the probability of all synonym representations in top candidates. We represent each biomedical entity using both sparse and dense representations to capture morphological and semantic information, respectively. The candidates are iteratively updated based on our model's representations removing the need for an explicit negative sampling from a large number of candidates. Also, the model-based candidates help our model learn from more difficult negative samples. Through extensive experiments on four biomedical entity normalization datasets, we show that BIOSYN achieves new state-of-the-art performance on all datasets, outperforming previous models by  $0.8\% \sim 2.6\%$  top1 accuracy. Further analysis shows that our model's performance has almost reached the performance upper bound of each dataset.
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3641-3650 July 5 - 10, 2020. ©2020 Association for Computational Linguistics
The contributions of our paper are as follows: First, we introduce BIOSYN for biomedical entity representation learning, which uses synonym marginalization dispensing with the explicit needs of negative training pairs. Second, we show that the iterative candidate selection based on our model's representations is crucial for improving the performance together with synonym marginalization. Finally, our model outperforms strong state-of-the-art models up to  $2.6\%$  on four biomedical normalization datasets. $^{1}$
Biomedical entity representations have largely relied on biomedical word representations. Right after the introduction of Word2vec (Mikolov et al., 2013), Pyysalo et al. (2013) trained Word2Vec on biomedical corpora such as PubMed. Their biomedical version of Word2Vec has been widely used for various biomedical natural language processing tasks (Habibi et al., 2017; Wang et al., 2018; Giorgi and Bader, 2018; Li et al., 2017a) including the biomedical normalization task (Mondal et al., 2019). Most recently, BioBERT (Lee et al., 2019) has been introduced for contextualized biomedical word representations. BioBERT is pre-trained on biomedical corpora using BERT (Devlin et al., 2019) and numerous studies are utilizing BioBERT for building state-of-the-art biomedical NLP models (Lin et al., 2019; Jin et al., 2019; Alsentzer et al., 2019; Sousa et al., 2019). Our model also uses pre-trained BioBERT for learning biomedical entity representations.
The intrinsic evaluation of the quality of biomedical entity representations is often verified by the biomedical entity normalization task (Leaman et al., 2013; Phan et al., 2019). The goal of the biomedical entity normalization task is to map an input mention from a biomedical text to its associated CUI (Concept Unique ID) in a dictionary. The task is also referred to as the entity linking or the entity grounding (D'Souza and Ng, 2015; Leaman and Lu, 2016). However, the normalization of biomedical entities is more challenging than the normalization of general domain entities due to a large number of synonyms. Also, the variations of synonyms depend on their entity types, which makes building type-agnostic normalization model difficult (Leaman et al., 2013; Li et al., 2017b; Mon
dal et al., 2019). Our work is generally applicable to any type of entity and evaluated on four datasets having three different biomedical entity types.
While traditional biomedical entity normalization models are based on hand-crafted rules (D'Souza and Ng, 2015; Leaman et al., 2015), recent approaches for the biomedical entity normalization have been significantly improved with various machine learning techniques. DNorm (Leaman et al., 2013) is one of the first machine learning-based entity normalization models, which learns pair-wise similarity using tfidf vectors. Another machine learning-based study is CNN-based ranking method (Li et al., 2017b), which learns entity representations using a convolutional neural network. The most similar works to ours are NSEEN (Fakhraei et al., 2019) and BNE (Phan et al., 2019), which map mentions and concept names in dictionaries to a latent space using LSTM models and refines the embedding using the negative sampling technique. However, most previous works adopt a pair-wise training procedure that explicitly requires making negative pairs. Our work is based on marginalizing positive samples (i.e., synonyms) from iteratively updated candidates and avoids the problem of choosing a single negative sample.
In our framework, we represent each entity with sparse and dense vectors which is largely motivated by techniques used in information retrieval. Models in information retrieval often utilize both sparse and dense representations (Ramos et al., 2003; Palangi et al., 2016; Mitra et al., 2017) to retrieve relevant documents given a query. Similarly, we can think of the biomedical entity normalization task as retrieving relevant concepts given a mention (Li et al., 2017b; Mondal et al., 2019). In our work, we use maximum inner product search (MIPS) for retrieving the concepts represented as sparse and dense vectors, whereas previous models could suffer from error propagation of the pipeline approach.
We define an input mention  $m$  as an entity string in a biomedical corpus. Each input mention has its own CUI  $c$  and each CUI has one or more synonyms defined in the dictionary. The set of synonyms for a CUI is also called as a synset. We denote the union of all synonyms in a dictionary as  $N = [n_{1}, n_{2}, \ldots]$  where  $n \in N$  is a single syn-
$^{1}$ Code available at https://github.com/dmis-lab/BioSyn.
Figure 1: The overview of BIOSYN. An input mention and all synonyms in a dictionary are embedded by a shared encoder and the nearest synonym is retrieved by the inner-product. Top candidates used for training are iteratively updated as we train our encoders.
onym string. Our goal is to predict the gold CUI  $c^*$  of the input mention  $m$  as follows:
$$
c ^ {*} = \operatorname {C U I} (\operatorname {a r g m a x} _ {n \in N} P (n | m; \theta)) \quad (1)
$$
where  $\mathsf{CUI}(\cdot)$  returns the CUI of the synonym  $n$  and  $\theta$  denotes a trainable parameter of our model.
3.2 Model Description
The overview of our framework is illustrated in Figure 1. We first represent each input mention  $m$  and each synonym  $n$  in a dictionary using sparse and dense representations. We treat  $m$  and  $n$  equally and use a shared encoder for both strings. During training, we iteratively update top candidates and calculate the marginal probability of the synonyms based on their representations. At inference time, we find the nearest synonym by performing MIPS over all synonym representations.
Sparse Entity Representation We use tfidf to obtain a sparse representation of  $m$  and  $n$ . We denote each sparse representation as  $e_m^s$  and  $e_n^s$  for the input mention and the synonym, respectively. tfidf is calculated based on the character-level n-grams statistics computed over all synonyms  $n \in N$ . We define the sparse scoring function of a mention-synonym pair  $(m, n)$  as follows:
$$
S _ {\text {s p a r s e}} (m, n) = f \left(e _ {m} ^ {s}, e _ {n} ^ {s}\right) \in \mathbb {R} \tag {2}
$$
where  $f$  denotes a similarity function. We use the inner product between two vectors as  $f$ .
Dense Entity Representation While the sparse representation encodes the morphological information of given strings, the dense representation encodes the semantic information. Learning effective dense representations is the key challenge in the biomedical entity normalization task (Li et al., 2017b; Mondal et al., 2019; Phan et al., 2019; Fakhraei et al., 2019). We use pre-trained BioBERT (Lee et al., 2019) to encode dense representations and fine-tune BioBERT with our synonym marginalization algorithm. We share the same BioBERT model for encoding mention and synonym representations. We compute the dense representation of the mention  $m$  as follows:
$$
e _ {m} ^ {d} = \operatorname {B i o B E R T} (\bar {m}) [ \mathrm {C L S} ] \in \mathbb {R} ^ {h} \tag {3}
$$
where  $\overline{m} = \{\overline{m}_1,\dots,\overline{m}_l\}$  is a sequence of subtokens of the mention  $m$  segmented by the Word-Piece tokenizer (Wu et al., 2016) and  $h$  denotes the hidden dimension of BioBERT (i.e.,  $h = 768$ ). [CLS] denotes the special token that BERT-style models use to compute a single representative vector of an input. The synonym representation  $e_n^d\in \mathbb{R}^h$  is computed similarly. We denote the dense scoring function of a mention-synonym pair  $(m,n)$  using the dense representations as follows:
$$
S _ {\text {d e n s e}} (m, n) = f \left(e _ {m} ^ {d}, e _ {n} ^ {d}\right) \in \mathbb {R} \tag {4}
$$
where we again used the inner product for  $f$ .
2We used BioBERT v1.1 (+ PubMed) in our work.
Similarity Function Based on the two similarity functions  $S_{\text{sparse}}(m, n)$  and  $S_{\text{dense}}(m, n)$ , we now define the final similarity function  $S(m, n)$  indicating the similarity between an input mention  $m$  and a synonym  $n$ :
$$
S (m, n) = S _ {\text {d e n s e}} (m, n) + \lambda S _ {\text {s p a r s e}} (m, n) \in \mathbb {R} \tag {5}
$$
where  $\lambda$  is a trainable scalar weight for the sparse score. Using  $\lambda$ , our model learns to balance the importance between the sparse similarity and the dense similarity.
The most common way to train the entity representation model is to build a pair-wise training dataset. While it is relatively convenient to sample positive pairs using synonyms, sampling negative pairs are trickier than sampling positive pairs as there are a vast number of negative candidates. For instance, the mention 'alpha conotoxin' (MeSH:D020916) has 6 positive synonyms while its dictionary has 407,247 synonyms each of which can be a negative sampling candidate. Models trained on these pair-wise datasets often rely on the quality of the negative sampling (Leaman et al., 2013; Li et al., 2017b; Phan et al., 2019; Fakhraei et al., 2019). On the other hand, we use a model-based candidate retrieval and maximize the marginal probability of positive synonyms in the candidates.
Iterative Candidate Retrieval Due to a large number of candidates present in the dictionary, we need to retrieve a smaller number of candidates for training. In our framework, we use our entity encoder to update the top candidates iteratively. Let  $k$  be the number of top candidates to be retrieved for training and  $\alpha$  ( $0 \leq \alpha \leq 1$ ) be the ratio of candidates retrieved from  $S_{\text{dense}}$ . We call  $\alpha$  as the dense ratio and  $\alpha = 1$  means consisting the candidates with  $S_{\text{dense}}$  only. First, we compute the sparse scores  $S_{\text{sparse}}$  and the dense scores  $S_{\text{dense}}$  for all  $n \in N$ . Then we retrieve the  $k - \lfloor \alpha k \rfloor$  highest candidates using  $S_{\text{sparse}}$ , which we call as sparse candidates. Likewise, we retrieve the  $\lfloor \alpha k \rfloor$  highest candidates using  $S_{\text{dense}}$ , which we call as dense candidates. Whenever the dense and sparse candidates overlap, we add more dense candidates to match the number of candidates as  $k$ . While the sparse candidates for a mention will always be the same as they are based on the static tfidf representation, the dense candidates change every epoch as our model learns better dense representations.
Our iterative candidate retrieval method has the following benefits. First, it makes top candidates to have more difficult negative samples as our model is trained, hence helping our model represent a more accurate dense representation of each entity. Also, it increases the chances of retrieving previously unseen positive samples in the top candidates. As we will see, comprising the candidates purely with sparse candidates have a strict upper bound while ours with dense candidates can maximize the upper bound.
Synonym Marginalization Given the top candidates from iterative candidate retrieval, we maximize the marginal probability of positive synonyms, which we call as synonym marginalization. Given the top candidates  $N_{1:k}$  computed from our model, the probability of each synonym is obtained as:
$$
P (n \mid m; \theta) = \frac {\exp (S (n , m))}{\sum_ {n ^ {\prime} \in N _ {1 : k}} \exp (S \left(n ^ {\prime} , m\right))} \tag {6}
$$
where the summation in the denominator is over the top candidates  $N_{1:k}$ . Then, the marginal probability of the positive synonyms of a mention  $m$  is defined as follows:
$$
P ^ {\prime} (m, N _ {1: k}) = \sum_ { \begin{array}{c} n \in N _ {1: k} \\ \text {E Q U A L} (m, n) = 1 \end{array} } P (n | m; \theta) \quad (7)
$$
where  $\mathrm{EQUAL}(m,n)$  is 1 when  $\mathrm{CUI}(m)$  is equivalent to  $\mathrm{CUI}(n)$  and 0 otherwise. Finally, we minimize the negative marginal log-likelihood of synonyms. We define the loss function of our model as follows:
$$
\mathcal {L} = - \frac {1}{M} \sum_ {i = 1} ^ {M} \log P ^ {\prime} \left(m _ {i}, N _ {1: k}\right) \tag {8}
$$
where  $M$  is the number of training mentions in our dataset. We use mini-batch for the training and use Adam optimizer (Kingma and Ba, 2015) to minimize the loss.
At inference time, we retrieve the nearest synonym of a mention representation using MIPS. We compute the similarity score  $S(m,n)$  between the input mention  $m$  and all synonyms  $n \in N$  using the inner product and return the CUI of the nearest candidate. Note that it is computationally cheap to find the nearest neighbors once we pre-compute the dense and sparse representations of all synonyms.
We perform basic pre-processings such as lower-casing all characters and removing the punctuation for both mentions and synonyms. To resolve the typo issues in mentions from NCBI disease, we apply the spelling check algorithm following the previous work (D'Souza and Ng, 2015). Abbreviations of entities are widely used in biomedical entities for an efficient notation which makes the normalization task more challenging. Therefore, we use the abbreviation resolution module called  $\mathrm{Ab3P^3}$  to detect the local abbreviations and expand it to its definition from the context (Sohn et al., 2008). We also split composite mentions (e.g. 'breast and ovarian cancer') into separate mentions (e.g. 'breast cancer' and 'ovarian cancer') using heuristic rules described in the previous work (D'Souza and Ng, 2015). We also merge mentions in the training set to the dictionary to increase the coverage following the previous work (D'Souza and Ng, 2015).
For sparse representations, we use character-level uni-, bi-grams for tfidf. The maximum sequence length of BioBERT is set to  $25^4$  and any string over the maximum length is truncated to 25. The number of top candidates  $k$  is 20 and the dense ratio  $\alpha$  for the candidate retrieval is set to 0.5. We set the learning rate to 1e-5, weight decay to 1e-2, and the mini-batch size to 16. We found that the trainable scalar  $\lambda$  converges to different values between 2 to 4 on each dataset. We train BIOSYN for 10 epochs for NCBI Disease, BC5CDR Disease, and TAC2017 ADR and 5 epochs for BC5CDR Chemical due to its large dictionary size. Except the number of epochs, we use the same hyperparameters for all datasets and experiments.
We use the top  $k$  accuracy as an evaluation metric following the previous works in biomedical entity normalization tasks (D'Souza and Ng, 2015; Li et al., 2017b; Wright, 2019; Phan et al., 2019; Ji et al., 2019; Mondal et al., 2019). We define Acc@k as 1 if a correct CUI is included in the top  $k$  predictions, otherwise 0. We evaluate our models using Acc@1 and Acc@5. Note that we treat predictions for composite entities as correct if every prediction for each separate mention is correct.
Dataset	Documents	Mentions
Train	Dev	Test	Train	Dev	Test
NCBI Disease	592	100	100	5,134	787	960
BC5CDR Disease	500	500	500	4,182	4,244	4,424
BC5CDR Chemical	500	500	500	5,203	5,347	5,385
TAC2017ADR	101	-	99	7,038	-	6,343
Table 1: Data statistics of four biomedical entity normalization datasets. See Section 4.2 for more details.
We use four biomedical entity normalization datasets having three different biomedical entity types (disease, chemical, adverse reaction). The statistics of each dataset is described in Table 1.
NCBI Disease Corpus NCBI Disease Corpus (Doogan et al., 2014) provides manually annotated disease mentions in each document with each CUI mapped into the MEDIC dictionary (Davis et al., 2012). In this work, we use the July 6, 2012 version of MEDIC containing 11,915 CUIs and 71,923 synonyms included in MeSH and/or OMIM ontologies.
Biocreative V CDR BioCreative V CDR (Li et al., 2016) is a challenge for the tasks of chemical-induced disease (CID) relation extraction. It provides disease and chemical type entities. The annotated disease mentions in the dataset are mapped into the MEDIC dictionary like the NCBI disease corpus. The annotated chemical mentions in the dataset are mapped into the Comparative Toxicogenomics Database (CTD) (Davis et al., 2018) chemical dictionary. In this work, we use the November 4, 2019 version of the CTD chemical dictionary containing 171,203 CUIs and 407,247 synonyms included in MeSH ontologies. Following the previous work (Phan et al., 2019), we filter out mentions whose CUIs do not exist in the dictionary.
TAC2017ADR TAC2017ADR (Roberts et al., 2017)<sup>7</sup> is a challenge whose purpose of the task is to extract information on adverse reactions found in structured product labels. It provides manually annotated mentions of adverse reactions that are mapped into the MedDRA dictionary (Brown et al., 1999). In this work, we use MedDRA v18.1 which contains 23,668 CUIs and 76,817 synonyms.
<sup>5</sup>https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE
$^{6}$ https://biocreative.bioinformatics.udel.edu/tasks/biocreative-v/track-3-cdr
7https://bionlp.nlm.nih.gov/tac2017adversereactions
<sup>3</sup>https://github.com/ncbi-nlp/Ab3P
This covers  $99.9\%$  of strings in all datasets.
Models	NCBI Disease	BC5CDR Disease	BC5CDR Chemical	TAC2017ADR
Acc@1	Acc@5	Acc@1	Acc@5	Acc@1	Acc@5	Acc@1	Acc@5
Sieve-Based (D'Souza and Ng, 2015)	84.7	-	84.1	-	90.7†	-	84.3†	-
Taggerone (Leaman and Lu, 2016)	87.7	-	88.9	-	94.1	-	-	-
CNN Ranking (Li et al., 2017b)	86.1	-	-	-	-	-	-	-
NormCo (Wright, 2019)	87.8	-	88.0	-	-	-	-	-
BNE (Phan et al., 2019)	87.7	-	90.6	-	95.8	-	-	-
BERT Ranking (Ji et al., 2019)	89.1	-	-	-	-	-	93.2	-
TripletNet (Mondal et al., 2019)	90.0	-	-	-	-	-	-	-
BIOSYN (S-SCORE)	87.6	90.5	92.4	95.7	95.9	96.8	91.4	94.5
BIOSYN (D-SCORE)	90.7	93.5	92.9	96.5	96.6	97.2	95.5	97.5
BIOSYN (α = 0.0)	89.9	93.3	92.2	94.9	96.3	97.2	95.3	97.6
BIOSYN (α = 1.0)	90.5	94.5	92.8	96.0	96.4	97.3	95.8	97.9
BIOSYN (Ours)	91.1	93.9	93.2	96.0	96.6	97.2	95.6	97.5
† We used the author's provided implementation to evaluate the model on these datasets.
Table 2: Experimental results on four biomedical entity normalization datasets
(a) NCBI Disease
(b) BC5CDR Disease
Figure 2: Effect of iterative candidate retrieval on the development sets of NCBI Disease, BC5CDR Disease, and BC5CDR Chemical. We show the recall of top candidates of each model.
(c) BC5CDR Chemical
We use five different versions of our model to see the effect of each module in our framework. First, BIOSYN denotes our proposed model with default hyperparameters described in Section 4.1. BIOSYN (S-SCORE) and BIOSYN (D-SCORE) use only sparse scores or dense scores for the predictions at inference time, respectively. To see the effect of different dense ratios, BIOSYN  $(\alpha = 0.0)$  uses only sparse candidates and BIOSYN  $(\alpha = 1.0)$  uses only dense candidates during training.
Table 2 shows our main results on the four datasets. Our model outperforms all previous models on the four datasets and achieves new state-of-the-art performance. The Acc@1 improvement on NCBI Disease, BC5CDR Disease, BC5CDR Chemical and TAC2017ADR are  $1.1\%$ ,  $2.6\%$ ,  $0.8\%$  and  $2.4\%$ , respectively. Training with only dense candidates  $(\alpha = 1.0)$  often achieves higher Acc@5 than BIOSYN showing the effectiveness of dense candidates.
5.2 Effect of Iterative Candidate Retrieval
In Figure 2, we show the effect of the iterative candidate retrieval method. We plot the recall of top candidates used in each model on the development sets. The recall is 1 if any top candidate has the gold CUI. BIOSYN  $(\alpha = 1)$  uses only dense candidates while BIOSYN  $(\alpha = 0)$  uses sparse candidates. BIOSYN utilizes both dense and sparse candidates. Compared to the fixed recall of BIOSYN  $(\alpha = 0)$ , we observe a consistent improvement in BIOSYN  $(\alpha = 1)$  and BIOSYN. This proves that our proposed model can increase the upper bound of candidate retrieval using dense representations.
5.3 Effect of the Number of Candidates
We perform experiments by varying the number of top candidates used for training. Figure 3 shows that a model with 20 candidates performs reasonably well in terms of both Acc@1 and Acc@5. It shows that more candidates do not guarantee higher performance, and considering the training complexity, we choose  $k = 20$  for all experiments.
Figure 3: Performance of BIOSYN on the development set of NCBI Disease with different numbers of candidates
5.4 Effect of Synonym Marginalization