Hierachical Name Entity Recognition

Similar documents
Information Extraction from Text

CLRG Biocreative V

Lecture 13: Discriminative Sequence Models (MEMM and Struct. Perceptron)

Statistical NLP for the Web Log Linear Models, MEMM, Conditional Random Fields

Lecture 13: Structured Prediction

Probabilistic Graphical Models

Conditional Random Fields and beyond DANIEL KHASHABI CS 546 UIUC, 2013

ToxiCat: Hybrid Named Entity Recognition services to support curation of the Comparative Toxicogenomic Database

Generalization Error on Pruning Decision Trees

CSCI-567: Machine Learning (Spring 2019)

Statistical Machine Learning Theory. From Multi-class Classification to Structured Output Prediction. Hisashi Kashima.

Graphical models for part of speech tagging

Statistical Methods for NLP

Intelligent Systems (AI-2)

Statistical Machine Learning Theory. From Multi-class Classification to Structured Output Prediction. Hisashi Kashima.

Sequence Modelling with Features: Linear-Chain Conditional Random Fields. COMP-599 Oct 6, 2015

Part of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch. COMP-599 Oct 1, 2015

Learning theory. Ensemble methods. Boosting. Boosting: history

Supervised Learning. George Konidaris

Machine Learning for natural language processing

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2013

A Decision Stump. Decision Trees, cont. Boosting. Machine Learning 10701/15781 Carlos Guestrin Carnegie Mellon University. October 1 st, 2007

Intelligent Systems (AI-2)

Natural Language Processing Prof. Pawan Goyal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

A brief introduction to Conditional Random Fields

Class 4: Classification. Quaid Morris February 11 th, 2011 ML4Bio

Week 5: Logistic Regression & Neural Networks

Symbolic methods in TC: Decision Trees

Undirected Graphical Models

From Binary to Multiclass Classification. CS 6961: Structured Prediction Spring 2018

Support Vector Machine & Its Applications

Randomized Decision Trees

CS 446 Machine Learning Fall 2016 Nov 01, Bayesian Learning

Click Prediction and Preference Ranking of RSS Feeds

Maxent Models and Discriminative Estimation

Qualifying Exam in Machine Learning

Introduction to Machine Learning Midterm, Tues April 8

CS145: INTRODUCTION TO DATA MINING

Sequences and Information

Learning Decision Trees

Learning Decision Trees

Naïve Bayes, Maxent and Neural Models

Log-Linear Models, MEMMs, and CRFs

Discovering molecular pathways from protein interaction and ge

Decision trees. Special Course in Computer and Information Science II. Adam Gyenge Helsinki University of Technology

Probabilistic Graphical Models: MRFs and CRFs. CSE628: Natural Language Processing Guest Lecturer: Veselin Stoyanov

Text Mining. March 3, March 3, / 49

Learning Decision Trees

Boosting: Foundations and Algorithms. Rob Schapire

The Perceptron. Volker Tresp Summer 2014

Bayesian Hierarchical Classification. Seminar on Predicting Structured Data Jukka Kohonen

Structure Learning in Sequential Data

Lecture 6: Backpropagation

10-701/ Machine Learning, Fall

Machine Learning for NLP

Notes on Noise Contrastive Estimation (NCE)

Deep Feedforward Networks. Han Shao, Hou Pong Chan, and Hongyi Zhang

Input-Output Hidden Markov Models for Trees

word2vec Parameter Learning Explained

The Perceptron. Volker Tresp Summer 2016

lecture 6: modeling sequences (final part)

Nonlinear Classification

STA 414/2104: Machine Learning

6.047 / Computational Biology: Genomes, Networks, Evolution Fall 2008

Probabilistic Graphical Models

CS229 Supplemental Lecture notes

CSE 250a. Assignment Noisy-OR model. Out: Tue Oct 26 Due: Tue Nov 2

Stochastic Gradient Descent

Active learning in sequence labeling

Biological Networks: Comparison, Conservation, and Evolution via Relative Description Length By: Tamir Tuller & Benny Chor

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2014

CHAPTER-17. Decision Tree Induction

Data Compression Techniques

MACHINE LEARNING FOR NATURAL LANGUAGE PROCESSING

Lecture 4: Training a Classifier

Lecture 5 Neural models for NLP

Decision Trees. Tirgul 5

Real Estate Price Prediction with Regression and Classification CS 229 Autumn 2016 Project Final Report

Symbolic methods in TC: Decision Trees

SUPERVISED LEARNING: INTRODUCTION TO CLASSIFICATION

Natural Language Processing with Deep Learning CS224N/Ling284

More on HMMs and other sequence models. Intro to NLP - ETHZ - 18/03/2013

Decision Trees. None Some Full > No Yes. No Yes. No Yes. No Yes. No Yes. No Yes. No Yes. Patrons? WaitEstimate? Hungry? Alternate?

Introduction: MLE, MAP, Bayesian reasoning (28/8/13)

Lecture 6: Graphical Models

Linear Regression. Robot Image Credit: Viktoriya Sukhanova 123RF.com

BACKPROPAGATION. Neural network training optimization problem. Deriving backpropagation

CLUe Training An Introduction to Machine Learning in R with an example from handwritten digit recognition

Conditional probabilities and graphical models

Kernel Methods & Support Vector Machines

Learning Multiple Tasks with a Sparse Matrix-Normal Penalty

Linear Classification and SVM. Dr. Xin Zhang

From perceptrons to word embeddings. Simon Šuster University of Groningen

10 : HMM and CRF. 1 Case Study: Supervised Part-of-Speech Tagging

Generative Clustering, Topic Modeling, & Bayesian Inference

Logistic Regression. COMP 527 Danushka Bollegala

Hidden Markov Models

Classification. The goal: map from input X to a label Y. Y has a discrete set of possible values. We focused on binary Y (values 0 or 1).

Data Mining Classification: Basic Concepts and Techniques. Lecture Notes for Chapter 3. Introduction to Data Mining, 2nd Edition

Predictive Modeling: Classification. KSE 521 Topic 6 Mun Yi

Transcription:

Hierachical Name Entity Recognition Dakan Wang, Yu Wu Mentor: David Mcclosky, Mihai Surdeanu March 10, 2011 1 Introduction In this project, we investigte the hierarchical name entity recognition problem implement three modesl to empirically verify that it is probable to utilize the hierarchical relationship between entity types to improve the tranditional NER task. Specifically, our three models are all non-trivial extensions of the classical MEMM classifier. We believe some of the ideas can be conveniently adapted to sequence classifiers such as conditional random fields. 2 MEMM and Hierachical NER 2.1 Definition Assuming that we have a bunch of entities X = {x (i) } Nx i=1, and a collection of entity types C = {c i } Nc i=1. An name-entity recognition task is to identify entities in the text and map them to their belonged classes. One commonly used model to do this is the Maximum Entropy Markov Model, which can be specified as follows, exp( j P λ (c x, c ) = λ jf j (x, c, c)) c C exp( j λ jf j (x, c, c )) In the above formulation, c is the class for the previous word of x. In training, this information is available for training the MEMM. However, in testing, such information is hidden and a verterbi decoding algorithm is usually used to get the most probable sequence of entity classes. MEMM is a very useful technique used in various applications concerning sequence-based classification. Though there are some more principled sequence model such as conditional random fields, in practice, MEMM is comparable with those advanced sequenced models. In traditional NER, each word is assumed to be belonged to one entity class and entity classes are always by default assumed to be independent. However, in real world applications, even entity classes can be dependent. One such dependence is called nested entity relationship[2], in which one entity class is allowed to include several other classes. For instance, in the word sequence Bank Of America, bank and America are both 1 (1)

Figure 1: Ontology Tree Figure 2: Tree Normalization 2

assumed to belong to some entity classes, and the whole world Bank of America also belongs to some entity class. Such implicit relationships about entity classes are very interesting and may help improve the performance of the NER tasks. In this report, we consider another entity class relaitonship and propose large scale hierachical NER. Unlike traditional NER which only involve 3 or 4 entity classes, we considerthe domain which includes many entity classes. Biomedicine is just one such domain which has more than ten entity types. These entities form the leaves of a hierarchical tree structure and the dependency distance of two entity types can be measured by their distance in the tree. One typical example of this is shown in Figure 1. It will be interesting to see if the given tree structure can help the traditional NER taks which ignore the tree structure and take the leaves in the tree to be independent of each other. Formally, suppose that we have a hierarchical tree structure T, and each node in the tree has a label indicating the node s corresponding class. The labels of the leaves of T forms a set C = {c i } Nc i=1, which is just consisted of the entity classes in our NER task. For a node u in the tree. we use A(u) to denote the set of u s ancestors in the tree. Also, let A(c) denote the ancestor nodes of node u whose label is c. Furthermore, we use D(T, d) to denote all the nodes at depth d in the tree, and the root of the tree is considered to be at depth 0. The concept of tree normalization refers to converting the tree such that all leaves in the tree are at the same depth. For instance, if in the original tree, one leaf u 1 is at depth 2 and the other one u 2 is at depth 5, then tree normalization attaches a path of length 2 to leaf u 1. We show an example of tree normalization in Figure 2. With these concepts and notations, we now describe our three proposed models. 2.2 model 0 Model 0 is our baseline model, which does not exploit any tree stucture and only takes the labels of the leaves in the tree to be entity types and does a traditional NER task. 2.3 model 1 The first model is the simplest model but also the most intuitive one. The basic idea is just to use the information in the hierarchical tree to enrich features and expect to improve the model performance. We modify the MEMM formulation a bit as follows. exp( j P λ (c x, c ) = λ jf j (x, A(c ), c)) c C exp( j λ jf j (x, A(c ), c )) Notice that here instead of only being only a function of the label of the previous label c, the feature function is now a function of a path from the leaf with label c to the root. We take the tree in to be an example of this idea. Suppose that we have now an word whose previous word belongs to entity class DNA. In traditional NER, when we extract features, we will on do the following, features.add( PREVLABEL-DNA ) However, in our model1, we will instead do the following (2) 3

Figure 3: Weight Construction for model 2 features.add( PREVLABEL-DNA ) features.add( PREVLABEL-Nulceid Acid ) features.add( PREVLABEL- Is Entity ) In prediction, the viterbi decoding algorithm is a dynamic programming on the paths from root to leaves since we need all ancesters of a leaf to make the prediction. 2.4 Model 2 In this model, the basic idea is to train a classifier at each depth and combine all classifier s prediction result to make the final prediction. Suppose the tree T is already normalized, and at the d-th level, the set of entity classes is C d and the model parameters are λ d, the prediction of the d-th level can be written to be P λ d(c d x, c d exp( j ) = λ jf j (x, c d, c d )) c d C exp( d j λ jf j (x, c d (3), c d )) An illustration for the weight vector for each node is shown in Figure 3. Since we want to combine the prediction from classifier s result, we proposed two approaches. The first approach is a heuristic which is shown not to very useful in the experiments. But as an approach we have tried in our experiments, we also report it here. 2.5 Model 2.1 The idea here is to ignore the sequence and let the classifier vote for the entity type for a word. Since the label of the previous word is one of the features for the classifier, the probability of a word s label is conditional on the previous label. Therefore when calculating the type of a word, we need to eliminate the conditional variable and do something like belief prorogation, that is P (c x t,.., x 0 ) = P (c x t, c )P (c x t 1,.., x 0 ) (4) c C 4

The above equation can be easily calculate by going through all words in the sequence. Recall that we are in the hierarchical setting, and for each depth d, we can calculate P (c d x t,.., x 0 ). Then for each label path from the root to a leaf p = (c 1,.., c d,..), we calculate i c P (c i x t,.., x 0 ). Then we take path with the largest probability and the leaf of the path to be the entity of x t. 2.6 Model 2.2 In model 2.2, we extend the viterbi algorithm as follows. Suppose that V t 1,p is the maximum probability of sequence in which the (t-1)-th word in the sentence corresponds to path p. Here p is a path from the root to a leaf, and we say a word corresponds to a path p when the word s label was the leaf corresponding to the path. V t,p = max{p (p x t, p )V t 1,p } (5) In the above function, x t is the word at position t, p is the possible label path for the previous word and P (p x t, p ) = u p P (u x t, u ) (6) Here u is a node on the path, and P (u x t, u ) can be calculated from each independently trained classifier. We give an example on the extended Viterbi algorithm, suppose that in the tree in Figure 2, we want to calculate the maximum probability of the sequence in which x t belongs to label RNA. The label path corresponding to the label rna is is p = (is entity,nucleic acid compound, rna). To calculate the maximum probability, we need to enumerate all the label paths of the previous word, P = {(O, O, O), (is entity, protein, protein) (is entity, nucleic acid compound, rna), (is entity, nucleic acid compound, dna)} (7) For p = (is entity, nucleic acid compound, rna), P (p x t, p ) = P (is entity x t, is entity) P (nucleic acid compound x t, nucleic acid compound) P (rna x t, dna) (8) And here P (is entity x t, is entity), P (nucleic acid compound x t, nucleic acid compound), and P (rna x t, dna) are calculated from classifiers for nodes in depth 2, depth 3, and depth 4 respectively. 2.7 Model 3 All the above mentioned models rely on some sort of heuristics. We finally describe a model which can principally exploits the tree structure. The trick here is that we 5

Figure 4: Weight Construction for Model 3 construct the weight vector using the tree structure. For convenience of defining the model, we use a different formalization of MEMM: the logistic regression model. In LR model, we denote f(x) to be the feature vector for instance x, and W c to be the weight vector for class c. And the probability of x belonging to class c can be written to be P (c x) = exp(w c x) c exp(w c x) It is easy to see the equivalence of the above formulation and the MEMM formulation. Recall that in the Hierarchical NER setting, each entity class should belong to a leaf in the entity type tree. We now construct the weight vectors {W c } from the taxonomy. Assume that every node u in the tree is associated with a local weight vector w u, and the global weight vector W u is defined to be W root = w root W u = w u + W pa(u) Here pa(u) means the parent of node u. Writing the above definition in another way, we have W u = w u + w v (10) v A(u) Recall that A(u) is the ancesters of node u. An illustration of this weight vector construction is shown in Figure 4. Intuitively, the global weight of u is the sum of the local weights on the path from the root to the node u. Thus if we come back to the hierarchical NER problem in which each entity type corresponds to a leaf, we can rewrite the logistic regression formulation to be (9) P (c x) = exp( u A(c) wu x) c exp( u A(c ) wu x) (11) Our task here is to estimate all the local weights w c in the entity type tree. 6

We give some analysis of how the above formulation utilizes the tree structure. The basic intuition comes from the observation that if two leaves u 1 and u 2 (correponding to two entity types) has a shares common ancester v, then their global weight vectors W u 1 and W u 2 share a local weight vector w v. The closer u 1 and u 2 are in the tree, the more local weight vectors they share. In our example tree, the global weight vectors of rna and dna have a common part which is W u where u is the node corresponding to nucleic acid compound in our example tree. In the learning process, whenever the model receives instances belonging to either dna or ran, it will update all the local weight vectors from the root to the node corresponding to nucleic acid compound. This can be seen more clearly if we calculate the derivative with respect to w u when the model receives a set of instances {(x (i), c (i) )} N i=1. Notice that the error function for logistic regression can be written to be E = = N log(p (c (i) x i )) i=1 N log exp( u A(c (i) ) wu x (i) ) i=1 c exp( u A(c ) wu x (i) ) Let C v be the set of leaves of the subtree rooted at node v, the derivative of E with respect to a node v in the entity type tree can be written as follows E c w v = x (i) C v x(i) exp u A(c ) wu x (i) c (i) C v c exp( u A(c ) wu x (i) ) c = x (i) x (i) C v exp u A(c ) wu c (i) C v c exp( u A(c ) wu x (i) ) = x (i) (1 p(c x i )) c (i) Cv c C v The above formula can be interpreted as follows: The derivative of w v will be large only if the classifier cannot classify the instance to the leaves of the tree rooted in v. On the other hand, if the current classifier can classifier the instance into any of the leaves of the subtree rooted at v, then that instance will not contribute to the gradient of w v. This observation is also consistent with our intention of constructing the weight vectors: w v can be seen to be a sub-classifier which helps determine whether an instance should be classified into the subtree rooted at v. Since all instances with labels corresponding to leaves of that subtree can be seen to belong to entity type v, we should not differenetiate between these instances when we are leaning w v. To elabroate the above model, we further propose two extensions, 7

2.8 Model 3.1 We formulate the error function as follows N E = log(p (c (i) x i )) + λ d w u 2 (12) i=1 0<d depth(t ) u D(T,d) Recall that we have stated in the definition part that D(T,d) is set of all nodes at depth d of the tree T. Here λ d1 λ d2 for d 1 d 2. We briefly explain the intuition behind this. Basically, a node at a larger depth in the tree will have less training instances and will be more likely have the problem of overfitting. Therefore it is necessary to add a larger regularization term to weight vectors correponding to nodes at a larger depth to avoid overfitting. Another interesting way of thinking about the learned weight vectors can be expected to be consistent over the tree. Here consistency means that for two nodes u 1 and u 2 at depth d in the tree, if W u 1 f(x) > W u 2 f(x), then for any two nodes v 1 and v 2, where v 1 and v 2 are respectively the nodes in the subtrees rooted at u 1 and u 2, it satisfies W v 1 f(x) > W v 2 f(x). This can be roughly obtained (but no exact math proof!) as follows. Let p(u 1, v 1 ) be the path from one of u 1 s child to v 1, then we can write W v 1 f(x) = W u 1 f(x)+ u p(u 1,v 1 ) wu f(x). Since u is at a deeper position in the tree than u, we can think that (again, it s just high level, not maths proof!) w u W u 1. Thus it can be expected that W u 1 f(x) W u 2 f(x) > u p(u 1,v 1 ) wu f(x)+ u p(u 2,v 2 ) wu f(x), indicating the consistency. 2.9 Model 3.2 We do not implement this model, but it should be an interesting extension. We write error function to be N E = log(p (c (i) x i )) + λ d w u 1 (13) i=1 0<d depth(t ) u D(T,d) Here λ d1 λ d2 for d 1 d 2.. Notice that we only change the l 2 regularization to l 1 regularization. Our intention of proposing the above function is to enable to model to do feature selection. We would like to select the entity classes shared features and also their own specific features. Since the regularization term at a shallower node has a larger regularization term, we can expect the learned feature vector will be sparser, and will select those common features in the subtree rooted at the corresponding node. And the leaf nodes will be the least sparse, and it will enable the model to discover entity class specific features. 2.10 Features Used By the Model We extracted several categories of features, which we summarize below current word 8

previous word next word previous word+current word current word+next word previous word shape current word shape next word shape if the word contains a non-letter character(such as hyphen) if the word contains a capital letter substring of a word. The range of the substring length is [2,6] For wordshape feature, we just replace all letter characters with x, all digit characters with d, and all other weird characters with?. All the other feature templates are quite clear. Also notice that the features for model 1 should further include all the ancesters of the previous word s label. 3 Experimental Results The dataset we use is the genia corpus, which is an xml file. NER on this dataset has also been studied by [1]. In this dataset, each word can be associated with an entity, which can be mapped to a leaf in the ontology tree as in Figure 1. To simplify the task and have a quick result of whether hierarchical NER can improve the performance, we simpliy the originla ontology tree and use a very simple tree structure as defined in Figure 2. There are three entity types, DNA, protein, and RNA. The models used are model0, model1, model2.2, and model3.1. We have also implemented and evaluated model 2.1, but it does not work very well on the dataset, and it is even worse than the baseline. Thus we do not report its results here. From the table, we can see that the hierarchical structure always helps improve the performance. Model 1 and Model 2.2 is comparable with each other. Our last model 3.1 achieves the best performance and is consistently better than all the other model in the F1-performance. We have also compared the overall accuracy of the four models in Figure 5. From the figure we can also see that model3.1 achieves the best accuracy. 4 Conclusion and future work Ww in this report have built four models which can exploit the hierarchical entity type structure. Out of the four models, three of them have already been empirically proven 9

precision recall FB1 overall 67.73% 69.54% 68.62% DNA 51.26% 49.93% 50.58% protein 73.18% 76.62% 74.86% RNA 43.98% 39.85% 41.81% Table 1: baseline precision recall FB1 overall 72.40% 68.89% 70.60% DNA 59.74% 48.89% 53.77% protein 76.18% 76.24% 76.21% RNA 48.68% 34.59% 40.44% Table 2: model1 precision recall FB1 overall 72.12% 69.21% 70.64% DNA 58.47% 48.96% 53.30% protein 76.28% 76.60% 76.44% RNA 47.52% 36.09% 41.03% Table 3: model2.2 precision recall FB1 overall 72.25% 70.07% 71.14% DNA 59.38% 50.11% 54.35% protein 76.07% 77.29% 76.68% RNA 52.24% 39.47% 44.97% Table 4: model3.1 to be useful in improving the performance. Further work includes implmenting model 3.2 to see whehter the model can do automatic feature selection. It is also interesting to investigate whether the proposed ideas in this work can be adapted to more advanced sequence classifiers such as CRF. 5 Acknowledgement The authors would like to thank David and Mihai for insightful discussions. 10

Figure 5: Accuracy Comparison References [1] Jenny Finkel, Shipra Dingare, Christopher D. Manning, Malvina Nissim, Beatrice Alex, and Claire Grover. Exploring the boundaries: Gene and protein identification in biomedical text. In In Proceedings of the BioCreative Workshop, 2004. [2] Jenny Rose Finkel and Christopher D. Manning. Nested named entity recognition. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing: Volume 1 - Volume 1, EMNLP 09, pages 141 150, Stroudsburg, PA, USA, 2009. Association for Computational Linguistics. 11