---
title: "Syntactic, semantic, pragmatic analysis"
subject: "Artificial Intelligence"
chapter: 7
key: "semester_6/artificial_intelligence:nlp-syntactic-semantic-pragmatic"
source: https://www.bctengineer.com/q/semester_6/artificial_intelligence/nlp-syntactic-semantic-pragmatic
site: BCT Engineering
---

# Syntactic, semantic, pragmatic analysis

Artificial Intelligence · Chapter 7: Application of AI

- Asked in: 2071 Magh, 2+2+2+2 marks
- Video: [Lexical, Syntactic, Semantic, & Pragmatic Analysis in NLP Explained](https://www.youtube.com/watch?v=WaXOcZb9OhU) — SH AI Academy
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/artificial_intelligence/nlp-syntactic-semantic-pragmatic
- Whole chapter: https://www.bctengineer.com/md/semester_6/artificial_intelligence/chapter-7

## Question

What is Natural Language Processing (NLP)? Explain the syntactic, semantic and pragmatic analysis of NLP.

## Short answer

NLP enables computers to understand and generate human language. Syntactic analysis checks grammar and builds a parse tree (e.g., rejecting “Boy the rice eats”). Semantic analysis extracts literal meaning (e.g., eat(boy, rice)) and rejects nonsensical sentences. Pragmatic analysis interprets the intended meaning using context (e.g., “Do you know the time?” as a request).

## Answer

**Natural language processing (NLP)** is the branch of AI that makes computers understand, interpret and generate human language such as English or Nepali, in written or spoken form.

#### Syntactic analysis (parsing)
It checks whether a sentence follows the grammar of the language and builds a **parse tree** showing the structure. It uses a lexicon and grammar rules such as S → NP VP, NP → Det N, VP → V NP.
```text
 "The boy eats rice"
          S
        /   \
      NP     VP
     /  \   /  \
   Det   N  V    NP
   The  boy eats  rice
```
"The boy eats rice" is accepted; "Boy the rice eats" is rejected. Techniques: top-down and bottom-up parsing, transition networks, chart parsing.

#### Semantic analysis
It finds the meaning of the sentence from the parse tree and word meanings, mapping it to a representation such as logic or a frame, and checks that it makes sense. "The boy eats rice" becomes eat(boy, rice). "Colourless green ideas sleep furiously" is syntactically valid but semantically meaningless. It also resolves word senses ("bank").

#### Pragmatic analysis
It interprets the sentence using context, speaker intention and world knowledge to get the real meaning. "Do you know the time?" means "Please tell me the time", not a question about knowledge. It also resolves references across sentences ("He took it").

Sequence: syntactic (structure) -> semantic (literal meaning) -> pragmatic (intended meaning in context).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does syntactic analysis produce?
   A. A parse tree showing the grammatical structure, using rules like S -> NP VP
   B. A logical meaning such as eat(boy, rice)
   C. The speaker's hidden intention
   D. A list of word senses
   Answer: A. Parsing checks grammar and builds a parse tree using a lexicon and grammar rules. (Key point: Purpose of syntactic analysis)

2. 'Colourless green ideas sleep furiously' is best described as
   A. Syntactically invalid and semantically valid
   B. Syntactically valid but semantically meaningless
   C. Valid at both levels
   D. Invalid at both levels
   Answer: B. Its structure follows grammar, but semantic analysis finds the meaning nonsensical. (Key point: Semantic analysis)

3. 'Do you know the time?' means 'Please tell me the time.' Which analysis finds this?
   A. Syntactic analysis
   B. Semantic analysis
   C. Pragmatic analysis
   D. Morphological analysis
   Answer: C. Pragmatic analysis uses context and speaker intention to get the real meaning beyond the literal question. (Key point: Pragmatic analysis)

4. What is the correct sequence among the three analyses?
   A. Pragmatic, semantic, syntactic
   B. Semantic, syntactic, pragmatic
   C. Syntactic (structure), semantic (literal meaning), pragmatic (intended meaning)
   D. Syntactic, pragmatic, semantic
   Answer: C. Structure is found first, then literal meaning, and finally the intended meaning in context. (Key point: Order of analyses)

## Related in Artificial Intelligence

- [Pragmatic vs phonetic analysis](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Apragmatic-vs-phonetic-analysis) — Artificial Intelligence, chapter 7
- [NLP and its steps](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Anlp-steps) — Artificial Intelligence, chapter 7, asked 6×
- [NLP issues with example](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Anlp-issues) — Artificial Intelligence, chapter 7
- [NLU and NLG; NLP steps](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Anlu-nlg-nlp-steps) — Artificial Intelligence, chapter 7

## Related in other subjects

- [High level languages and natural language](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ahll-similar-natural-language) — Computer Programming, chapter 1
- [Natural and forced convection compared](https://www.bctengineer.com/question.md?key=semester_5%2Fheat_transfer%3Afree-versus-forced-convection) — Heat Transfer, chapter 3
- [Orthogonality of modes and modal analysis](https://www.bctengineer.com/question.md?key=semester_7%2Ftheory_of_mechanism_and_machine_ii%3Aorthogonality-modal-analysis-forced-response) — Theory of Mechanism and Machine II, chapter 8
