Natural Language Processing · TEE · papers

Q7a · Information extraction, chunking and NER

2022-11-22 · final · recovered AI paper

Previous examination · complete worked answers

Question. Explain information-extraction architecture with a diagram. Explain chunking and named-entity recognition with examples. [10 marks]

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

LevelWhat it identifiesExample
Entity extraction / NERA span and its entity typeAsha → person; Orbit Labs → organisation
Relation extractionA labelled connection between entitiesworks-for(Asha, Orbit Labs)
Event extractionAn occurrence with roles and attributesJoining: 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.

Raw text
Sentence/token processing
Entity spans + types
Reference resolution
Relations and event roles
Normalize and store records

An extraction pipeline explained

StepOperationReason
Specify schemaChoose fields and allowed relations/events.A system needs to know what records it is building.
PreprocessSegment sentences and tokenize without losing useful structure.Locate expressions and boundaries.
Recognise entitiesFind spans and assign types.Names can contain several words.
Resolve referencesLink pronouns/descriptions to the right entities.Two mentions may denote one participant.
Extract links/eventsUse patterns, syntax or learned models.Co-occurrence alone does not identify a relationship.
Handle qualifiersPreserve negation, time and uncertainty.Not hired differs from hired.
NormalizeStandardize dates, names or quantities where justified.Equivalent forms should be comparable.
Store/evaluateSave 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

SpanType
AshaPerson
Orbit LabsOrganisation
MumbaiLocation
3 May 2025Date

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

FieldValue
eventjoining
personAsha
organisationOrbit Labs
locationMumbai
date2025-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.

Answer. A joining record for Asha and Orbit Labs at the stated location/date, with complete entity spans preserved.

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

RoleEntity
Buyer/acquirerNova
Acquired organisationLuma

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

FieldValue
eventacquisition
buyerNova
acquired_organisationLuma
amountINR 50 crore
year2025
sellerNot 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.

Answer. Acquisition(buyer=Nova, acquired organisation=Luma, amount=INR 50 crore, year=2025). Seller remains unspecified.

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

MentionReferent
He in sentence 2Ravi
the companyVega
He in sentence 3Ravi

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

EventPersonOrganisationDatePolarity
joiningRaviVega2021Affirmed
leavingRaviVega2024Affirmed
joiningRaviOrionNot statedNegated

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.

Answer. Three qualified event statements, including a negated Orion joining. No current employer can be established from this text.

Approaches and their trade-offs

ApproachMechanismAdvantageLimitation
Dictionary/rule basedMatch 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 statisticalLearn entity/relation/event labels from annotated examples and features.Combines several cues consistently.Requires representative labels and careful feature design.
Neural/contextualUse 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.

The/DT small/JJ cat/NN sat/VBD on/IN the/DT mat/NN
NP: [The small cat]
Outside: sat on
NP: [the mat]

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.

OperationInputOutput
POS taggingThe small catThe/DT small/JJ cat/NN
NP chunkingTagged tokens[NP The small cat]
ChinkingA broad candidate chunkRemove verbs/prepositions, keep noun-phrase segments
Full parsingSentence + grammarA 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].

Final answer. [NP The quick brown fox] jumps over [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.

Final answer. Chunks are [NP bright stars] and [NP a moon]. With ordinary Penn tagging, stars is usually NNS; broaden the noun pattern to include NNS when that tag is used.

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].

Final answer. Two chunks remain: The cat; 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.

Text: Mary joined Google in New York on Monday.
Mary → PERSON
Google → ORGANIZATION
New York → LOCATION
Monday → DATE

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.

TaskQuestion it answersExample
POSWhat grammatical role does this token have?Google/NNP
ChunkingWhich adjacent words form a phrase?[NP a skilled developer]
NERWhich span names an entity, and of what type?[Google] ORGANIZATION
Entity linkingWhich 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.