Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 3 — Information Extraction

Lesson 30 of 39 in the free Natural Language Processing notes on Siksha Sarovar, written by Rohit Jangra.

Information Extraction (IE)

Information Extraction (IE) is the task of automatically pulling structured information (entities, relationships, facts) out of unstructured text. It builds directly on POS tagging, syntactic parsing, and NER from Unit 2.

Unstructured: "Riya joined Google as a Software Engineer on 5 August 2026."

Structured:
{
  "person": "Riya",
  "organization": "Google",
  "role": "Software Engineer",
  "start_date": "2026-08-05"
}

Core Sub-tasks of Information Extraction

Sub-taskGoalExample
Named Entity RecognitionFind entities (covered in Unit 2)"Riya" = PERSON, "Google" = ORG
Relation ExtractionFind relationships between entities(Riya, works_for, Google)
Event ExtractionIdentify events and their participants/timeEvent: "joining", Agent: Riya, Org: Google, Date: 5 Aug 2026
Template FillingPopulate a predefined structured templateResume parser filling {name, skills, experience}

Relation Extraction — Rule-Based (Pattern Matching)

import re

text = "Riya works at Google. Aman is employed by Microsoft."
pattern = r'(\w+) (?:works at|is employed by) (\w+)'
matches = re.findall(pattern, text)
print(matches)
# [('Riya', 'Google'), ('Aman', 'Microsoft')]

Relation Extraction Using Dependency Parsing (Recall Unit 2)

Dependency parses expose grammatical relations (subject, object) that can be turned into (entity, relation, entity) triples.

import spacy

nlp = spacy.load("en_core_web_sm")
doc = nlp("Riya founded a startup in 2024.")

for token in doc:
    if token.dep_ == "nsubj":
        subject = token.text
    if token.dep_ == "dobj":
        obj = token.text
    if token.pos_ == "VERB":
        verb = token.text

print(f"({subject}, {verb}, {obj})")
# (Riya, founded, startup)

Combining NER + Pattern Matching for Structured Extraction

import spacy
import re

nlp = spacy.load("en_core_web_sm")
text = "Riya joined Google as a Software Engineer on 5 August 2026."
doc = nlp(text)

person = [ent.text for ent in doc.ents if ent.label_ == "PERSON"]
org = [ent.text for ent in doc.ents if ent.label_ == "ORG"]
date = [ent.text for ent in doc.ents if ent.label_ == "DATE"]

role_match = re.search(r'as an? ([\w\s]+?) on', text)
role = role_match.group(1) if role_match else None

record = {
    "person": person[0] if person else None,
    "organization": org[0] if org else None,
    "role": role,
    "date": date[0] if date else None
}
print(record)
# {'person': 'Riya', 'organization': 'Google', 'role': 'Software Engineer', 'date': '5 August 2026'}

Real-World Applications of Information Extraction

ApplicationWhat is extracted
Resume/CV parsingSkills, education, work experience, contact info
Legal contract analysisParties, obligations, dates, monetary clauses
Financial news monitoringCompany mentions, deal values, M&A relationships
Medical recordsSymptoms, diagnoses, medications, dosages
Building a Knowledge GraphEntity-relation-entity triples, queryable via graph databases

Information Extraction is often the final structured output of an entire NLP pipeline — feeding chatbots, search engines, and analytics dashboards with clean, queryable facts pulled from free text.