Natural Language Processing · TEE · papers
Q7a · Information extraction, chunking and NER
2022-11-22 · final · recovered AI paper
Previous examination · complete worked answers
Answer
Information extraction (IE) converts unstructured language into structured information such as named entities, relations and events. A structured output has explicit fields or records that can be stored, searched or analysed. IE is broader than NER: finding two names does not yet determine how those entities are related.
The three levels of extracted information
| Level | What it identifies | Example |
|---|---|---|
| Entity extraction / NER | A span and its entity type | Asha → person; Orbit Labs → organisation |
| Relation extraction | A labelled connection between entities | works-for(Asha, Orbit Labs) |
| Event extraction | An occurrence with roles and attributes | Joining: employee=Asha, employer=Orbit Labs, date=2025 |
An entity is a participant such as a person or organisation. A relation links participants. An event describes something that happened, may happen or did not happen. An event role names a participant's function: buyer, seller, employee, employer, location or time. These labels must follow the chosen extraction schema.
An extraction pipeline explained
| Step | Operation | Reason |
|---|---|---|
| Specify schema | Choose fields and allowed relations/events. | A system needs to know what records it is building. |
| Preprocess | Segment sentences and tokenize without losing useful structure. | Locate expressions and boundaries. |
| Recognise entities | Find spans and assign types. | Names can contain several words. |
| Resolve references | Link pronouns/descriptions to the right entities. | Two mentions may denote one participant. |
| Extract links/events | Use patterns, syntax or learned models. | Co-occurrence alone does not identify a relationship. |
| Handle qualifiers | Preserve negation, time and uncertainty. | Not hired differs from hired. |
| Normalize | Standardize dates, names or quantities where justified. | Equivalent forms should be comparable. |
| Store/evaluate | Save records and compare them with annotated answers. | Wrong links matter even if entity names are correct. |
Worked application 1 · turn a sentence into a record
Question. Extract entities and a joining event from “Asha joined Orbit Labs in Mumbai on 3 May 2025.” Use fields person, organisation, location, event and date.
Given
One affirmative sentence; Orbit Labs is an organisation and Mumbai is a location.
To find
Entity spans/types and one structured joining record.
Method and why it applies
Find the complete entity spans, then assign their roles using the verb joined and its grammatical context.
Solution
Step 1. Mark entity spans
| Span | Type |
|---|---|
| Asha | Person |
| Orbit Labs | Organisation |
| Mumbai | Location |
| 3 May 2025 | Date |
Step 2. Identify the event trigger
Joined signals a joining event. The subject Asha is the joining person; Orbit Labs is the joined organisation.
Step 3. Attach contextual fields
In Mumbai supplies a location associated with the stated joining event. On 3 May 2025 supplies its date. Do not infer the company's permanent headquarters from this sentence alone.
Step 4. Normalize the date
The unambiguous date can be stored as 2025-05-03 while preserving its original text.
Step 5. Build the record
| Field | Value |
|---|---|
| event | joining |
| person | Asha |
| organisation | Orbit Labs |
| location | Mumbai |
| date | 2025-05-03 |
Step 6. State the information limit
The sentence supports a joining event on that date. By itself it does not prove that Asha still works there indefinitely.
Worked application 2 · direction of a relation matters
Question. From “Nova acquired Luma for ₹50 crore in 2025”, extract an acquisition event with buyer, acquired organisation, amount and year.
Given
Nova and Luma are organisation names. The active verb is acquired; no seller is named.
To find
A correctly directed acquisition record.
Method and why it applies
Use grammatical roles to identify buyer and acquired organisation. Merely returning the unordered pair {Nova,Luma} loses the event direction.
Solution
Step 1. Recognise participant entities
Nova is the subject organisation; Luma is the object organisation.
Step 2. Locate the trigger
Acquired identifies an acquisition event.
Step 3. Assign roles
| Role | Entity |
|---|---|
| Buyer/acquirer | Nova |
| Acquired organisation | Luma |
Step 4. Extract amount and time
Amount text=₹50 crore; year=2025. Currency and magnitude belong together; do not drop crore or replace it by lakh.
Step 5. Create the record
| Field | Value |
|---|---|
| event | acquisition |
| buyer | Nova |
| acquired_organisation | Luma |
| amount | INR 50 crore |
| year | 2025 |
| seller | Not stated |
Step 6. Reject an unsupported inference
The sentence does not name the former owner/seller. Luma is the acquired organisation, not automatically the seller.
Worked application 3 · reference, negation and time
Question. Extract employment-related events from “Ravi joined Vega in 2021. He left the company in 2024. He did not join Orion.” Keep event type, person, organisation, date and polarity.
Given
He refers to Ravi; the company refers to Vega. The last sentence explicitly negates joining Orion.
To find
A structured event list without claiming an unsupported current employer.
Method and why it applies
Resolve references, identify each event separately and preserve whether it is affirmed or negated.
Solution
Step 1. Resolve the repeated mentions
| Mention | Referent |
|---|---|
| He in sentence 2 | Ravi |
| the company | Vega |
| He in sentence 3 | Ravi |
Step 2. Extract the first event
Joining; person=Ravi; organisation=Vega; date=2021; polarity=affirmed.
Step 3. Extract the second event
Leaving; person=Ravi; organisation=Vega; date=2024; polarity=affirmed.
Step 4. Extract the third statement
Joining; person=Ravi; organisation=Orion; date=not stated; polarity=negated. This must not create an affirmative employment relation with Orion.
Step 5. Write the event table
| Event | Person | Organisation | Date | Polarity |
|---|---|---|---|---|
| joining | Ravi | Vega | 2021 | Affirmed |
| leaving | Ravi | Vega | 2024 | Affirmed |
| joining | Ravi | Orion | Not stated | Negated |
Step 6. Interpret current status cautiously
The text says that Ravi left Vega and did not join Orion. It supplies no other current employer. Do not fill that field by guessing.
Approaches and their trade-offs
| Approach | Mechanism | Advantage | Limitation |
|---|---|---|---|
| Dictionary/rule based | Match known names, trigger words and patterns such as person joined organisation. | Transparent and useful in a narrow domain. | New names, paraphrases and complex syntax can escape patterns. |
| Supervised statistical | Learn entity/relation/event labels from annotated examples and features. | Combines several cues consistently. | Requires representative labels and careful feature design. |
| Neural/contextual | Use contextual representations to classify spans and links or generate a structured record. | Can capture paraphrases and broader context. | May still invent or misassign fields; schema and factual checks remain necessary. |
Applications include extracting company events from news, conditions/treatments from clinical text, skills from resumes and attributes from product descriptions. Extraction quality is measured against annotated records: an entity match can require the correct span and type; a relation match additionally requires the correct participants and direction. Precision measures how many extracted records are correct; recall measures how many gold records were found.
For a 10-mark answer, begin with the definition and structured output, distinguish NER/relation/event extraction, draw and explain the pipeline, work through a record with roles and qualifiers, compare approaches, then state evaluation and limitations. “Extract keywords” alone is too narrow: keywords do not necessarily represent a factual relation.
Yaad rakho: NER naam pakadta hai; relation kaun-kisse jodta hai; event kya hua batata hai. Negation aur date mat girao.
Chunking, also called shallow parsing, groups adjacent tagged words into meaningful non-overlapping units, commonly noun phrases. It usually identifies local phrase boundaries without producing the complete hierarchical structure of a sentence. Chinking removes specified tokens from an existing candidate chunk, splitting or trimming it.
A POS tagger labels individual words. A chunker groups words into phrases. A full parser shows how phrases relate recursively to form the entire sentence. These are related tasks with different outputs.
| Operation | Input | Output |
|---|---|---|
| POS tagging | The small cat | The/DT small/JJ cat/NN |
| NP chunking | Tagged tokens | [NP The small cat] |
| Chinking | A broad candidate chunk | Remove verbs/prepositions, keep noun-phrase segments |
| Full parsing | Sentence + grammar | A nested tree with sentence, noun phrase and verb phrase nodes |
Rule-based chunking uses tag patterns. Statistical or learned chunkers infer boundaries from labeled examples. A useful NP rule is an optional determiner, followed by zero or more adjectives, followed by a noun. In NLTK-style notation: NP: {<DT>?<JJ>*<NN>}. Here ? means zero or one occurrence; * means zero or more; + means one or more when used. The braces mean “form a chunk around the matched sequence”.
Question. Apply the NP rule optional DT, zero or more JJ, then one NN to “The/DT quick/JJ brown/JJ fox/NN jumps/VBZ over/IN the/DT lazy/JJ dog/NN”.
Given
Tagged input is supplied. Rule: DT? JJ* NN.
To find
All noun-phrase chunks.
Formula and why it applies
NP → DT? JJ* NN
The rule groups a noun with its preceding determiner and adjectives; a verb or preposition does not match this NP pattern.
Solution
Step 1. Start at The
The matches optional DT; quick and brown both match JJ*; fox matches NN.
Step 2. Form the first NP
[NP The quick brown fox]
Step 3. Skip nonmatching tokens
jumps/VBZ and over/IN do not satisfy the NP pattern.
Step 4. Match the second NP
the is DT, lazy is JJ, dog is NN: [NP the lazy dog].
Question. Using NP → DT? JJ* NN, identify the chunks in “bright/JJ stars/NN shine/VBP and/CC a/DT moon/NN glows/VBZ”. Use the supplied tags exactly.
Given
Input tags label stars as NN for this exercise. Rule requires optional DT, zero or more JJ, then NN.
To find
The matched NP spans.
Formula and why it applies
NP → DT? JJ* NN
The optional determiner may be absent and the adjective repetition may be empty.
Solution
Step 1. Match bright stars
No determiner is present, which DT? permits. bright matches JJ; stars matches NN.
Step 2. Inspect shine and and
VBP and CC fall outside the NP rule.
Step 3. Match a moon
a matches DT; no adjective is present; moon matches NN.
Question. Begin with one candidate chunk containing “The/DT cat/NN sat/VBD on/IN the/DT mat/NN”. Chink out verbs and prepositions. Show the remaining chunks.
Given
Initial candidate: [The cat sat on the mat]. Remove tags VBD and IN.
To find
The chunk segments after exclusion.
Formula and why it applies
Chinking removes matched tokens from the existing chunk.
Removing the middle verb/preposition region divides the original candidate into two remaining contiguous spans.
Solution
Step 1. Locate the tokens to remove
sat is VBD and on is IN.
Step 2. Remove those tokens from chunk membership
The remaining token groups are “The cat” and “the mat”. sat and on still exist in the sentence; they are simply outside these chunks.
Step 3. Write the final chunked sentence
[The cat] sat on [the mat].
Yaad rakho: Chunking = andar group karo; chinking = unwanted tokens ko group se bahar karo.
Named Entity Recognition (NER) identifies text spans referring to entities and assigns their types, such as PERSON, ORGANIZATION and LOCATION. Many practical schemas also include DATE, TIME, MONEY or domain-specific types. The exact allowed labels depend on the application's annotation scheme.
NER has two parts: boundary detection finds where the entity starts and ends; classification assigns the appropriate type. A multiword name should normally be one entity span: “New York” is a location span, not two unrelated location decisions.
Not every noun is a named entity. In “a developer works at Google”, developer is an ordinary job description while Google is a named organization. A specialized HR system may define a JOB_TITLE category, but it must state that schema explicitly. NER identifies mentions; entity linking is the separate task of connecting a mention to a unique database identity.
| Task | Question it answers | Example |
|---|---|---|
| POS | What grammatical role does this token have? | Google/NNP |
| Chunking | Which adjacent words form a phrase? | [NP a skilled developer] |
| NER | Which span names an entity, and of what type? | [Google] ORGANIZATION |
| Entity linking | Which real entity does this mention denote? | Connect Paris to the intended city or person record |
Applications. NER structures search results and documents, extracts organizations/people from news, routes support tickets by product or organization, supports recommendation, and extracts specialized entities from healthcare or legal text. Context is essential: “Apple released a laptop” names an organization, while “she ate an apple” describes fruit.
Yaad rakho: NER mein do kaam: naam kahan se kahan tak, aur kis category ka.