1 of 19

Natural Language Processing

By

S.V.V.D.Jagadeesh

Sr. Assistant Professor

Dept of Artificial Intelligence & Data Science

LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING

2 of 19

  • Previously Discussed Topics
  • Session Outcomes
  • Models in NLP
  • Four Eras of NLP
  • Early Explorations-1940-1959
  • NLP in 1960’s
  • History of NLP
  • Challenges in NLP

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Previously Discussed Topics

LBRCE

NLP

3 of 19

At the end of this session, Student will be able to:

  • Understand the languages and Grammars of NLP(Understand-L2)

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Session Outcomes

LBRCE

NLP

4 of 19

  • Language is the medium of communication between humans and machines.
  • NLP aims to model both the structure (syntax) and meaning (semantics) of language for computational use.
  • A system must handle words, phrases, clauses, and sentences while preserving meaning.

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Role of Languages in NLP

LBRCE

NLP

5 of 19

  • Grammar defines the rules and structure of a language. In NLP, grammar is essential for:

Parsing: Analyzing sentence structure.

Machine Translation: Ensuring syntactic correctness.

Question Answering: Understanding sentence intent.

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Grammar in NLP

LBRCE

NLP

6 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Language and Grammar

  • Automatic processing of language requires the rules and exceptions of a lang. to be explained to the computer.
  • Grammar defines a Language.
  • It consists of a set of rules that allows us to parse and generate sentences in a language.
  • Transformational grammar, Phrase structure grammar (Chomsky 1957)
  • Lexical functional grammar(1982)

LBRCE

NLP

7 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Language and Grammar

  • Dependency grammar, Paninian grammar, tree adjoining grammar(Joshi1985)
  • Phrase structure grammar focuses on derivation
  • Dependency grammar, Paninian grammar, Lexical functional grammar focuses on relationships.
  • Noam Chomsky proposed a hierarchy of formal grammars based on the level of complexity.
  • The generative grammar refers to general frame work introduced by Chomsky

LBRCE

NLP

8 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Grammar Formalisms

  • 1Phrase Structure Grammar (PSG) -Represents sentences as hierarchical structures.

Example: Sentence (S) → Noun Phrase (NP) + Verb Phrase (VP).

  • Dependency Grammar - Represents grammatical relationships as dependencies between words.

Example: In “She eats apples”, eats → head verb, she → subject, apples → object.

  • Context-Free Grammar (CFG) - Uses rules like S → NP VP to generate valid sentences.
  • Transformational Grammar (Chomsky) - Describes how deep structures can be transformed into surface forms.

LBRCE

NLP

9 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Generative and Transformational Grammar

  • Generative grammar refers to any grammar that uses a set of rules to specify or generate all and only grammatical(well-formed) sentences in a language.
  • Chomsky proposed Syntactic structures that each sentence in a language has two levels of representation
  • Deep structure
  • Surface structure
  • The mapping from deep structure to surface structure is carried out by transformations.

LBRCE

NLP

10 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Generative and Transformational Grammar

  • Deep structure can be transformed into many different level surface level representations.
  • Sentences with different surface level representations have the same meaning
  • Example: Pooja plays veena • Veena is played by Pooja have the same meaning
  • Transformational grammar has three components

1. Phrase structure Grammar

2. Transformational Rules

3.Morphophonemics rules

LBRCE

NLP

11 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Example Trees

LBRCE

NLP

12 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Phrase Structure and Transformational Grammar

  • Phrase structure grammar consists of rules that generate natural language sentences.
  • Example:

S-> NP+VP

VP -> V+ NP

NP -> Det + Noun

V -> Aux + Verb

Det -> the, a, an,--

Verb -> catch, eat, write, --

Noun -> Police, teacher, ---

Aux -> will, can, is, ---

LBRCE

NLP

13 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Phrase Structure and Transformational Grammar

  • Transformational grammar is a set of Transformation rules , which transform one phrase maker(underlying) into another phrase-maker (derived) These rules are applied on the terminal string generated by phrase structure rules.
  • These rules are used to transform one surface representation into another.

LBRCE

NLP

14 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Example

  • Example: An active sentence into Passive sentence The rule relating active and passive sentences are given by Chomsky is

NP1-Aux-V-NP2 -> NP2-Aux+be+en-V-by-NP1

This rule says that NP1-Aux-V-NP2 is replaced by NP2-Aux+be+en-V-by-NP1

  • Consider the active sentence “Police will catch the snatcher”
  • The passive transformation rule will convert the sentence into:

The + culprit+ will + be+ en + catch + by+ police

LBRCE

NLP

15 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Example Tree

LBRCE

NLP

16 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Other Types of Grammar

  • Morphology -Study of word formation and structure.

Example: play → plays, playing, played.

  • Syntax - Study of sentence structure (rules for arranging words).

Example:

Correct: The cat sat on the mat.

Incorrect: Cat mat sat the on.

  • Semantics - Deals with meaning of words and sentences.

Example: John kicked the ball vs. The ball kicked John (different meanings).

  • (d) Pragmatics - Study of contextual meaning (depends on situation).

Example: “Can you pass the salt?” → a request, not a question about ability.

LBRCE

NLP

17 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Other Types of Grammar

  • Discourse - Concerned with multiple sentences together.

Example: She went to the market. She bought apples. → pronoun she refers to same person.

  • Phonology (Speech-based NLP) - Study of sound systems in language.

LBRCE

NLP

18 of 19

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Challenges in Using Grammar for NLP

  • Ambiguity: - “I saw the man with a telescope” → who has the telescope?
  • Ellipsis: Missing words in sentences.
  • Idioms: Non-literal expressions (“kick the bucket” ≠ kick + bucket).
  • Cross-linguistic variation: Different languages follow different grammar rules.

LBRCE

NLP

19 of 19

  • Previously Discussed Topics
  • Session Outcomes
  • Role of Languages in NLP
  • Grammar in NLP
  • Languages and Grammars
  • Grammar Formalisms
  • Generating and Transformational Grammars- Examples, Tree
  • Phrase Structure and Transformational Grammars- Examples, Tree
  • Other Types of Grammar
  • Challenges in using Grammar for NLP

S.V.V.D.Jagadeesh

Wednesday, December 17, 2025

Summary

LBRCE

NLP