Introduction to Semantics



Introduction to Semantics

Semantics is the branch of Linguistics that deals with the meaning of words, phrases, and sentences.

Introduction to Semantics
Introduction to Semantics

Introduction to Semantics

In Natural Language Processing, semantic analysis focuses on understanding the meaning of text rather than only grammar.

Example: Sentence: “Ravi opened the bank account.”

Semantic interpretation:

  • Person → Ravi
  • Action → Open
  • Object → Bank Account
  • Meaning → Financial activity

Another example: Sentence: “The bank of the river is beautiful.”

Here bank = river side, not a financial institution.

Thus semantics helps computers identify the correct meaning depending on context.

Types of Semantic Analysis

TypeDescriptionExample
Lexical SemanticsMeaning of individual words“car” and “vehicle”
Compositional SemanticsMeaning derived from sentence structure“Ram eats mango”
Word Sense DisambiguationIdentifying correct word meaningbank (river / finance)
Semantic Role LabelingIdentifying roles in sentencewho did what

Semantic Relationships

Understanding meaning often requires identifying relationships between words.

RelationshipMeaningExample
SynonymWords with similar meaningbig – large
AntonymOpposite meaninghot – cold
HypernymGeneral categoryanimal → dog
HyponymSpecific instancedog → animal
HomonymSame spelling but different meaningbank

These relationships help NLP systems understand context and meaning.

Knowledge Representation (KR)

Introduction to Semantics
Introduction to Semantics

Introduction to Semantics

Knowledge Representation is a technique used in Artificial Intelligence to store information about the world in a structured format so that computers can reason and understand language.

In NLP, knowledge representation helps computers interpret text meaning logically.

Objectives of Knowledge Representation

  1. Represent real-world knowledge
  2. Enable reasoning and inference
  3. Help machines understand human language
  4. Support intelligent decision making

Techniques of Knowledge Representation

1. Semantic Network

A graph structure that shows relationships between concepts.

Example:

Dog → is-a → Animal
Animal → needs → Food
Dog → has → Tail
ComponentMeaning
NodeObject or concept
LinkRelationship

2. Frames

Frames represent structured knowledge about objects or situations.

Example: Restaurant Frame

SlotValue
PlaceRestaurant
ActivityEating
ParticipantsCustomer, Waiter
ObjectFood

Frames help machines understand typical real-world situations.

3. Logical Representation

Uses mathematical logic to represent knowledge.

Example: Sentence: “All humans are mortal.”

Logical representation: Human(x) → Mortal(x)

Example: Human(Socrates)

Therefore → Mortal(Socrates)

4. Conceptual Dependency

Represents actions in sentences independent of language.

Example: Sentence: “Ram gave Sita a book.”

Representation:

Actor → Ram
Action → Give
Object → Book
Receiver → Sita

Applications of Semantics and Knowledge Representation

1. Machine Translation

Introduction to Semantics
Introduction to Semantics

Introduction to Semantics
Introduction to Semantics

Machine Translation is the automatic translation of text from one language to another using computers.

Example systemGoogle Translate

Example -  English sentence: “She is reading a book.”

Hindi translation: “वह एक किताब पढ़ रही है।”

The system must understand:

ComponentMeaning
SubjectShe
VerbReading
ObjectBook

Thus semantics ensures correct meaning before translation.

Steps in Machine Translation

StepFunction
Source Language AnalysisAnalyze input sentence
Semantic RepresentationExtract meaning
TransferConvert meaning to target language
Target Language GenerationGenerate translated sentence

Natural Language Database Interface


Introduction to Semantics
Introduction to Semantics

Introduction to Semantics
Introduction to Semantics

Introduction to Semantics

A Natural Language Interface to Database (NLIDB) allows users to query a database using natural language instead of SQL commands.

Example question: “Show all students who scored more than 80 marks.”

System converts it to SQL:

SELECT *
FROM students
WHERE marks > 80;

Advantages

AdvantageExplanation
Easy to useNo need for SQL knowledge
User-friendlyNormal language queries
Faster information retrievalQuick data access

Example Process

User Question

Language Analysis

Semantic Interpretation

SQL Query Generation

Database Result

Difference Between Syntax and Semantics

FeatureSyntaxSemantics
MeaningStructure of sentenceMeaning of sentence
FocusGrammar rulesInterpretation
Example“She eats apple” structureWhat the sentence means

Key Points for Exams

TopicImportant Idea
SemanticsStudy of meaning in language
Knowledge RepresentationStructured storage of knowledge
Semantic NetworksGraph relationships
FramesStructured situation representation
Machine TranslationAutomatic language translation
Database InterfaceNatural language query system

Short  Definition

Semantics is the study of meaning in language and is an important component of Natural Language Processing. Knowledge Representation is the method of storing information in structured formats such as semantic networks, frames, and logical representations so that computers can understand, reason, and process natural language. These concepts are widely used in applications such as machine translation and natural language database interfaces.