Thursday, March 12, 2026

NLP 

 UNIT-1

1. Introduction to Natural Language


Definition

Natural Language is the language used by humans to communicate naturally in everyday life.

Examples:

  • English

  • Telugu

  • Hindi

  • Tamil

These languages evolve naturally through human interaction, unlike programming languages which are designed by humans.

Definition for Exams

Natural Language:
Natural language refers to any human language used for communication such as English, Telugu, or Hindi.


What is Natural Language Processing (NLP)?

Natural Language Processing (NLP) is a branch of Artificial Intelligence (AI) that enables computers to understand, interpret, and generate human language.

Example systems:

  • Chatbots

  • Voice assistants

  • Translation systems

Popular AI assistants like Amazon Alexa and Apple Siri use NLP.


Goals of NLP

  1. Enable computers to understand human language

  2. Allow machines to communicate with humans

  3. Process large amounts of text data automatically


Example

Sentence:

I am going to college.”

Human easily understands this sentence, but a computer must process it using NLP techniques such as:

  • Tokenization

  • Syntax analysis

  • Semantic analysis


2. The Study of Language

The scientific study of language is called Linguistics.

Linguistics helps computers understand how languages work.

Major Components of Language Study

1. Phonetics

Study of speech sounds.

Example:

  • Pronunciation of words like cat, bat, hat


2. Morphology

Study of word formation.

Example:

Unhappiness
= un + happy + ness

These small meaningful units are called morphemes.


3. Syntax

Study of sentence structure.

Example:

Correct sentence
She is reading a book.

Incorrect sentence
She reading is a book.


4. Semantics

Study of meaning of words and sentences.

Example:
Word bank may mean:

  • financial institution

  • river side


5. Pragmatics

Study of language in context.

Example:
Sentence:
It is cold here.”

Meaning depends on situation:

  • complaint

  • request to close the window


3. Applications of NLP


Natural Language Processing has many real-world applications.


1. Machine Translation

Automatically translating text from one language to another.

Example:

  • Google Translate

Example translation:

  • English → Telugu

  • Hindi → English


2. Speech Recognition

Converting spoken language into text.

Examples:

  • Voice typing

  • Voice assistants

Used in:

  • Amazon Alexa

  • Apple Siri


3. Chatbots

Programs that interact with users through natural language.

Examples:

  • Customer support bots

  • Banking chat assistants


4. Sentiment Analysis

Analyzing opinions from text.

Used in:

  • Social media analysis

  • Product reviews

Example:
I love this phone.” → Positive sentiment


5. Information Retrieval

Finding relevant information from large documents.

Example:
Search engines like Google Search.


6. Text Summarization

Automatically generating a short summary of long documents.

Used in:

  • News summarization

  • Research paper summaries


Short Exam Answer (5 Marks)

Natural Language Processing (NLP) is a field of Artificial Intelligence that enables computers to understand, interpret, and generate human language. It combines linguistics, computer science, and machine learning to process text and speech data.

Major applications of NLP include machine translation, speech recognition, chatbots, sentiment analysis, information retrieval, and text summarization.


If you want, I can also explain next topics from your syllabus like:

  • Evaluating Language Understanding Systems

  • Different Levels of Language Analysis

  • Organization of Natural Language Understanding Systems

(These are very important exam questions in NLP – Unit 1.)

Evaluating Language Understanding Systems,

Evaluating Language Understanding Systems (NLP)


1. Introduction

Evaluating Language Understanding Systems means measuring how well a computer system understands human language.

In Natural Language Processing (NLP), evaluation helps determine whether the system correctly interprets text or speech.

Examples of systems evaluated:

  • Chatbots

  • Machine translation systems

  • Question answering systems

  • Speech recognition systems

Evaluation ensures that the system is accurate, reliable, and useful.


2. Purpose of Evaluation

Evaluation is done to:

  1. Measure the performance of an NLP system

  2. Compare different NLP models or algorithms

  3. Improve system accuracy and efficiency

  4. Identify errors and limitations

Example:
A translation system must be evaluated to check whether the translated sentence has the correct meaning.


3. Types of Evaluation

1. Intrinsic Evaluation

Intrinsic evaluation measures the system performance directly using predefined datasets.

Example tasks:

  • Part-of-speech tagging accuracy

  • Parsing accuracy

  • Word sense disambiguation

Example:
Checking whether the system correctly identifies noun, verb, adjective.


2. Extrinsic Evaluation

Extrinsic evaluation measures the impact of NLP components on a real application.

Example:

  • Machine translation quality in a translation system

  • Information retrieval effectiveness in search engines

Here, the system is evaluated based on task performance.


4. Evaluation Metrics

1. Accuracy

Accuracy measures the percentage of correct predictions made by the system.

Formula:

Accuracy =
Correct Predictions / Total Predictions

Example:
If a system correctly interprets 80 out of 100 sentences

Accuracy = 80%


2. Precision

Precision measures how many predicted results are actually correct.

Formula:

Precision =
True Positives / (True Positives + False Positives)

Example:
Out of 50 predicted positive results, 40 are correct.

Precision = 40 / 50 = 0.8


3. Recall

Recall measures how many actual relevant results were identified.

Formula:

Recall =
True Positives / (True Positives + False Negatives)


4. F1 Score

F1 score is the harmonic mean of precision and recall.

Formula:

F1 Score =
2 × (Precision × Recall) / (Precision + Recall)

This metric balances precision and recall.


5. Evaluation Methods

1. Human Evaluation

Humans judge the system output.

Example:

  • Checking translation quality

  • Evaluating chatbot responses

Advantages:

  • More accurate interpretation

Disadvantages:

  • Time-consuming and expensive


2. Automatic Evaluation

Evaluation using automated metrics and algorithms.

Examples:

  • Accuracy

  • Precision

  • Recall

  • BLEU score (for translation)

Advantages:

  • Fast

  • Scalable


6. Challenges in Evaluation

Evaluating NLP systems is difficult because:

  1. Language is ambiguous

  2. Sentences may have multiple meanings

  3. Context affects interpretation

  4. Different correct answers may exist

Example:

Sentence:
I saw the man with a telescope.”

Possible meanings:

  • I used a telescope

  • The man had a telescope


7. Conclusion

Evaluation is an important step in Natural Language Processing systems because it measures system performance and ensures that the system understands human language accurately. It helps researchers improve NLP models and compare different language understanding techniques.


Short Exam Answer (5 Marks)

Evaluating language understanding systems refers to measuring the performance of Natural Language Processing systems to determine how accurately they interpret human language. Evaluation can be intrinsic or extrinsic and uses metrics such as accuracy, precision, recall, and F1 score. Both human and automatic evaluation methods are used to assess the quality and effectiveness of language understanding systems.


If you want, I can also explain the next Unit-1 topics (very important for exams):

  • Different Levels of Language Analysis

  • Representations and Understanding

  • Organization of Natural Language Understanding Systems

  • Outline of English Syntax.

Different Levels of Language Analysis,

Different Levels of Language Analysis (in NLP)

https://www.raymondhickey.com/LevelsOfLanguage-Graph.gifhttps://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Major_levels_of_linguistic_structure.svg/960px-Major_levels_of_linguistic_structure.svg.png

1. Introduction

In Natural Language Processing (NLP), language understanding is performed at different levels of analysis.
Each level focuses on a particular aspect of language such as sound, word structure, sentence structure, meaning, and context.

These levels help computers interpret and process human language accurately.


1. Phonological Analysis

Definition

Phonological analysis studies the sound patterns of language.

It focuses on:

  • Pronunciation

  • Speech sounds

  • Phonemes

Example

Words:

  • cat

  • bat

Both words differ by one sound /c/ and /b/.

In NLP

Used in:

  • Speech recognition systems

  • Voice assistants


2. Morphological Analysis

Definition

Morphological analysis studies the structure of words and their smallest meaningful units, called morphemes.

Example

Word:
Unhappiness

Breakdown:

un + happy + ness

Meaning:

  • unprefix (not)

  • happyroot word

  • nesssuffix

In NLP

Morphological analysis helps:

  • Identify root words

  • Understand word formation

Example:

  • running → run


3. Lexical Analysis

Definition

Lexical analysis identifies individual words (tokens) and their dictionary meanings.

It also determines the part of speech (POS).

Examples of POS:

  • Noun

  • Verb

  • Adjective

  • Adverb

Example

Sentence:

She reads a book.

Lexical analysis:

She → Pronoun
reads → Verb
book → Noun


4. Syntactic Analysis (Parsing)

Definition

Syntactic analysis studies the grammatical structure of sentences.

It checks whether a sentence follows the rules of grammar.

Example

Correct sentence
She is reading a book.

Incorrect sentence
She reading is book a.

In NLP

Used in:

  • Parsing algorithms

  • Sentence structure analysis


5. Semantic Analysis

Definition

Semantic analysis determines the meaning of words and sentences.

It helps the system understand what the sentence actually means.

Example

Word:
bank

Possible meanings:

  • Financial institution

  • River bank

Semantic analysis selects the correct meaning based on context.


6. Pragmatic Analysis

Definition

Pragmatic analysis studies language in context.

It considers:

  • Speaker intention

  • Situation

  • Real-world knowledge

Example

Sentence:

It is hot here.”

Possible meanings:

  • Statement about temperature

  • Request to turn on a fan

Understanding depends on context.


Summary Table

LevelFocusExample
PhonologySound patternscat vs bat
MorphologyWord structureunhappiness
LexicalWord meaning & POSnoun, verb
SyntaxSentence grammarsentence structure
SemanticsSentence meaningword sense
PragmaticsContext meaningspeaker intention

Short Exam Answer (5 Marks)

Different levels of language analysis in NLP help computers understand human language step by step. These levels include phonological analysis (study of sounds), morphological analysis (word structure), lexical analysis (word identification and parts of speech), syntactic analysis (sentence structure), semantic analysis (meaning of sentences), and pragmatic analysis (context-based meaning). Together, these levels enable machines to interpret natural language effectively.


If you want, I can also explain the next very important Unit-1 topics:

  • Representations and Understanding

  • Organization of Natural Language Understanding Systems

  • Linguistic Background: Outline of English Syntax

These are frequently asked in NLP exams.

Representations and Understanding

Representations and Understanding (in Natural Language Processing)

https://developer.ibm.com/developer/default/articles/a-beginners-guide-to-natural-language-processing/images/Figure1.png
4

1. Introduction

In Natural Language Processing (NLP), a computer must represent the meaning of language in a structured form so that it can understand and process it.

Representation refers to how information from natural language is stored inside a computer system.

Understanding refers to the process by which a system interprets the meaning of a sentence or text.

Thus, representation and understanding are essential for building systems that can interpret human language.


2. Representation in NLP

Definition

Representation is the process of converting natural language sentences into structured formats that computers can process.

These representations help the system to:

  • Store knowledge

  • Interpret meaning

  • Perform reasoning

Example

Sentence:

Ram eats an apple.”

Possible representation:

Subject → Ram
Action → eats
Object → apple

This structured representation helps the computer understand the sentence meaning.


3. Types of Language Representations

1. Logical Representation

Logical representation uses formal logic expressions to represent sentence meaning.

Example:

Sentence:
Ram loves Sita.”

Logical form:

Love (Ram, Sita)

This representation helps the system perform logical reasoning.


2. Semantic Networks

A semantic network represents knowledge using nodes and relationships.

Example:

Ram → is a → Person
Ram → eats → Apple

It represents the meaning of words through connections between concepts.


3. Frames

Frames are data structures used to represent stereotypical situations.

Example:

Frame: Restaurant

Attributes:

  • Customer

  • Waiter

  • Menu

  • Food

  • Payment

Frames help systems understand common situations in real life.


4. Conceptual Dependency

Conceptual dependency represents meaning using primitive actions and relationships.

Example:

Sentence:

Ram gave a book to Sita.”

Representation:

Actor → Ram
Object → Book
Recipient → Sita
Action → Transfer

This method focuses on the conceptual meaning of actions.


4. Understanding in NLP

Understanding means interpreting the actual meaning of sentences.

It involves several steps:

  1. Lexical analysisidentify words

  2. Syntactic analysischeck grammar structure

  3. Semantic analysisdetermine meaning

  4. Pragmatic analysisunderstand context

Example:

Sentence:

The boy opened the door.”

Understanding involves identifying:

Agent → boy
Action → opened
Object → door


5. Importance of Representation and Understanding

These concepts are important because they allow computers to:

  • Interpret human language

  • Answer questions

  • Translate languages

  • Perform reasoning

  • Communicate with humans

Applications include:

  • Chatbots

  • Machine translation

  • Question-answering systems

  • Voice assistants


6. Conclusion

Representation and understanding are fundamental concepts in NLP. Representation converts natural language into structured forms that computers can process, while understanding interprets the meaning of language using linguistic and contextual analysis. Together, they enable machines to interact effectively with human language.


Short Exam Answer (5 Marks)

Representation in NLP refers to converting natural language sentences into structured forms such as logical expressions, semantic networks, frames, or conceptual dependencies. These representations allow computers to store and process language information. Understanding refers to the process of interpreting the meaning of sentences using lexical, syntactic, semantic, and pragmatic analysis. Representation and understanding together enable machines to interpret human language effectively.


If you want, I can also explain the next Unit-1 topics (important for exams):

  • Organization of Natural Language Understanding Systems

  • Linguistic Background: Outline of English Syntax.

Organization of Natural language Understanding Systems

Organization of Natural Language Understanding Systems (NLU)

4

1. Introduction

A Natural Language Understanding (NLU) system is designed to enable computers to interpret and understand human language.

The organization of an NLU system refers to the structure or arrangement of different components that work together to process and understand natural language.

These components process language step by step, converting raw text into meaningful information.


2. Basic Structure of an NLU System

A typical Natural Language Understanding system consists of the following main components:

  1. Input Processing

  2. Lexical Analysis

  3. Syntactic Analysis

  4. Semantic Analysis

  5. Discourse Integration

  6. Pragmatic Analysis

  7. Knowledge Representation

Each component performs a specific function in understanding language.


3. Components of NLU Systems

1. Input Processing

The system receives text or speech input from the user.

Example input:

What is the weather today?”

Speech input may first be converted to text using speech recognition.


2. Lexical Analysis

Lexical analysis breaks the input sentence into words or tokens.

Example:

Sentence:

The boy is playing.”

Tokens:

  • The

  • boy

  • is

  • playing

It also identifies part-of-speech (POS) like noun, verb, adjective.


3. Syntactic Analysis (Parsing)

Syntactic analysis determines the grammatical structure of a sentence.

Example:

Sentence:

The boy plays cricket.”

Structure:

  • Subject → boy

  • Verb → plays

  • Object → cricket

Parsing checks whether the sentence follows grammar rules.


4. Semantic Analysis

Semantic analysis determines the meaning of words and sentences.

Example:

Sentence:

The bank is closed.”

Meaning depends on context:

  • Financial bank

  • River bank

Semantic analysis selects the correct meaning.


5. Discourse Integration

Discourse integration considers relationships between multiple sentences.

Example:

Sentence 1:

Ram bought a car.

Sentence 2:

He drives it every day.

The system must understand that He” refers to Ram.


6. Pragmatic Analysis

Pragmatic analysis interprets language based on context and real-world knowledge.

Example:

Sentence:

Can you open the window?”

Literal meaning → question about ability
Actual meaning → request to open the window


7. Knowledge Representation

Finally, the system stores the interpreted meaning in a structured format.

Example representation:

Action → open
Object → window
Agent → user

This structured knowledge allows the system to perform reasoning and respond correctly.


4. Flow of Natural Language Understanding

Typical NLU processing flow:

Input Sentence

Lexical Analysis

Syntactic Analysis

Semantic Analysis

Discourse Processing

Pragmatic Interpretation

Knowledge Representation


5. Importance of NLU System Organization

The organized structure helps systems:

  • Understand human language accurately

  • Process large amounts of text efficiently

  • Support AI applications

Applications include:

  • Chatbots

  • Question answering systems

  • Machine translation

  • Voice assistants


Short Exam Answer (5 Marks)

The organization of a Natural Language Understanding system refers to the structure of components that process and interpret human language. The major components include input processing, lexical analysis, syntactic analysis, semantic analysis, discourse integration, pragmatic analysis, and knowledge representation. These components work together to convert natural language input into meaningful information that computers can understand and process.


If you want, I can also explain the last topic of Unit-1:

Linguistic Background: An Outline of English Syntax”

This is very important in NLP exams and usually asked as a 10-mark question.

Linguistic Background: An outline of English Syntax.

Linguistic Background: An Outline of English Syntax

https://image.slidesharecdn.com/syntaxtreediagrams-170503201705/75/Syntax-tree-diagrams-17-2048.jpg
4

1. Introduction

Syntax is the branch of linguistics that studies the structure and arrangement of words in a sentence.

In Natural Language Processing (NLP), syntax helps computers understand how words combine to form grammatically correct sentences.

English syntax mainly focuses on:

  • Sentence structure

  • Word order

  • Phrase structure

  • Grammatical rules

English generally follows the Subject–Verb–Object (SVO) order.

Example:

Ram eats an apple.

Subject → Ram
Verb → eats
Object → apple


2. Parts of Speech (POS)

English syntax is based on different parts of speech, which classify words according to their grammatical function.

Main POS categories:

Part of SpeechExample
Nounboy, car, teacher
Verbrun, eat, read
Adjectivebig, small, happy
Adverbquickly, slowly
Pronounhe, she, they
Prepositionin, on, under
Conjunctionand, but
Determinera, an, the

Example sentence:

The smart boy runs quickly.

The → determiner
smart → adjective
boy → noun
runs → verb
quickly → adverb


3. Phrase Structure

Sentences are made of phrases, which are groups of words functioning together.

Common phrase types:

1. Noun Phrase (NP)

A phrase that contains a noun and its modifiers.

Example:
The tall boy

Structure:

Determiner + Adjective + Noun


2. Verb Phrase (VP)

A phrase containing a verb and its objects.

Example:
is reading a book

Structure:

Verb + Object


3. Prepositional Phrase (PP)

A phrase beginning with a preposition.

Example:
in the room

Structure:

Preposition + Noun Phrase


4. Sentence Structure

A typical English sentence structure is:

Sentence → Noun Phrase + Verb Phrase

Example:

Sentence:
The boy plays cricket

NP → The boy
VP → plays cricket


5. Phrase Structure Grammar

In syntax, sentences are represented using phrase structure rules.

Examples of rules:

S → NP + VP
NP → Det + N
VP → V + NP

Example:

Sentence:

The boy eats an apple

S
NP + VP

NP
Det + N
The boy

VP
V + NP
eats an apple


6. Importance of English Syntax in NLP

Understanding English syntax helps NLP systems:

  • Analyze sentence structure

  • Perform syntactic parsing

  • Identify relationships between words

  • Improve machine translation

  • Support question answering systems

Example application:

  • Grammar checking tools

  • Chatbots

  • Text analysis systems


7. Example Analysis

Sentence:

The girl reads a book

Structure:

S → NP + VP

NP → The girl
VP → reads a book

This structure helps the system identify:

Subject → girl
Action → reads
Object → book


Short Exam Answer (5 Marks)

English syntax refers to the study of sentence structure and the rules governing how words combine to form grammatically correct sentences. English generally follows the Subject–Verb–Object order. Sentences are composed of phrases such as noun phrases, verb phrases, and prepositional phrases. Phrase structure rules like S → NP + VP help represent sentence structures. Understanding syntax is important in Natural Language Processing for parsing sentences and analyzing grammatical relationships.


You have now completed all Unit-1 topics:

  1. Introduction to Natural Language

  2. Study of Language

  3. Applications of NLP

  4. Evaluating Language Understanding Systems

  5. Different Levels of Language Analysis

  6. Representations and Understanding

  7. Organization of NLU Systems

  8. Outline of English Syntax

If you want, I can also give Unit-1 important exam questions (very useful for JNTUK / M.Tech exams).

No comments:

Post a Comment

 NLP UNIT-2 Grammars and Parsing – Top- Down and Bottom- Up Parsers 4 1. Grammars in Natural Language Processing Definition A grammar is a ...