Lecture 4 Information Extraction
Information Extraction: Extract exact structured information from unstructured natural language text.
IE is goal-oriented and task-specific.
Structured information:
- Identifying entities
- Relations between entities
- Events in a time span
Example in biomedical domain
"The patient had a tumor of the skin removed."
This mention is identified as Concept Unique Identifier C037286; Skin Neoplasm.
- Where does the entity start and end?
- Entity needs to be linked to a knowledge base
Q: Did I understand "entity linking" from the liteture correctly. So it's not about linking two entities together (that would be relation extraction then?), but about linking an entity to a knowledge base; or should we say that it's linking a mention to an entity in a knowledge base?
Swanson, D.R. (1990): Medical literature as a potential source of new knowledge.
Early/first example of text mining in the medical domain, as a method to find relations that were not intended and found yet.
www.chilibot.net : search PubMed database for relations between genes and proteins.
Named Entity Recognition - NER
Named entities are uniquely specified objects in the world: people, organizations, locations.
How many entities?
" The British protest against No-Deal Brexit in Berlin - September 7, 2019"
"The British" -> Persons
"The British protest" -> event
So the preprocessing where we decide between labeling "protest" as a verb or noun, makes a different in the later steps.
Enter sentence in corenlp.run .
The amount of entities also depends on the annotation scheme. Persons, events/misc, locations, dates: then 4. Without dates, 3.
In other words, there's also extended types beyond person, organization, location. Common extensions includes:
- Dates
- Times
- Monetary values
- Percentages
- Domain dependent types
These are not strictly speaking named entities.
XML tagging
Entities can be easily represented using XML tags; either inline XML or stand-off XML. In stand-off XML we label each word, and then make extra XML that defines the word spans for entities.
Advantage of this is that you can have multiple XML versions for the same text; you can work in parallel without mistakes being fixed in the text; working in parallel etc.
Inline can also be problematic with nested tags, because XML cannot cross boundaries. So you cannot encode overlapping spans.
BIO tagging
- B-X: first word of an entity type of type X
- I-X: non-initial word of an entity of type X
- O: word outside any entity.
If you encode Person - Person - Person, you cannot distinguish where one entity starts and the other ends. We can signal this with B.
Challenges in entity recognition
Just having a list of entities is not enough, because we have:
- Ambiguity
- Variability
- Variants are endless!
- Lists are limited (always incoming new names, new domains etc.)
which causes a many-to-many mapping between text and named dictionary.
NER evaluation
Precision and recall; confusion matrix.
Precision and recall are defined in relation to number of named entities, not the number of involved words! Example in slide could otherwise have been 0.5, but the answer was C. 067.
Choose the metric based on what you want your system to do.
In this case we care about precision: it's not absolutely necessary to e.g. find all dates, but it is important that the ones we do find are correct.
Entity linking
Link found entities to a knowledge base; taxonomy.
A knowledge base that is often used is Wikipedia.
We can call this the Wikification of a text.
Ambiguity and variability: example with Wikification of Philips.
Several approaches discussed in lecture; review there.
Another idea: collective entity ranking. Makes the assumption that on average we have "one meaning per document".
You can check babelfly which works in 250+ languages. Does entity recognition, disambiguation, and linking to a semantic network (inc. Wikipedia and Wordnet) called Babelnet.
The great French science fiction movie the Fiftt Element is now online.
Relation Extraction
To restrict scope, we focus on finding a relation between two entities.
Assumptions:
- Two entities, one relation
- Relation is verbalized in a single sentence
Two approaches:
- Relation extraction as binary classification problem
- Do they have a relation, yes or no?
- Once they do, think about which one (but this is no longer binary right...?)
- Missed this one.
We have pattern-based RE and RE as a machine learning classification task.
Machine learning can use
- Features of the mentions (term frequency, NER label)
- Words and POS between, before, or after the mention pair
- Distance between mention pair (simple word count; shortest path in syntactic parse tree)
- Syntactic relation between pair
We're talking about every possible pair in a sentence. So this is again computationally heavy.
Applications of Relation Extraction
- Populate knowledge base: can we add new knowledge?
- Information fusion: can we recognize multiple mentions of the same relation?
- Open IE: Can we find any type of relation?
But be extremely careful when trying to extract knowledge
- Beliefs do not express knowledge relations: "I believe I can fly"
- Negations are tricky: "Coconut milk does not taste the same as cow milk"
Semantic role labeling
... Will record video.
Tips from assignment:
- Reflect on your answer; provide reasoning.
- Make sure your answers are complete; answer subquestions in full sentences.