Q17Principles of Artificial Intelligence
Question
4 marks
Explain the steps involved in Natural Language processing.
Answer
An architectural breakdown of the Natural Language Processing (NLP) pipeline. Explains the strict sequential phases: Lexical, Syntactic, Semantic, and Pragmatic analysis required to mathematically translate chaotic human speech into machine-executable logic.
Human language is mathematically horrific. It is filled with ambiguity, sarcasm, and chaotic grammar. Natural Language Processing (NLP) is the absolute AI architecture designed to violently dissect human text and force it into rigid mathematical representations. It executes through a strict, multi-layered pipeline.
The Algorithmic Steps
- 1. Lexical / Morphological Analysis: The most basic layer. The AI violently chops the raw sentence into individual tokens (words). It strips suffixes using algorithms like Porter Stemming (e.g., mathematically reducing "running", "runs", and "ran" into the base token
run). - 2. Syntactic Analysis (Parsing): The AI aggressively enforces the rules of grammar. It utilizes Context-Free Grammars (CFG) to mathematically build a massive Parse Tree. If a user says "The fast dog jumped," the AI categorizes
The fast dogas a Noun Phrase andjumpedas a Verb Phrase. If the grammar is mathematically invalid, it fails here. - 3. Semantic Analysis: The AI attempts to extract actual mathematical meaning. It resolves dictionary definitions. If the sentence is "The rock ate the sky," the Syntactic Parse Tree says it is grammatically perfect, but the Semantic Analyzer violently rejects it because its mathematical ontology dictates that a
Rockcannot execute the verbEat. - 4. Discourse Integration: A single sentence is meaningless without context. The AI mathematically tracks pronouns across sentences. In "John hit the ball. He threw it.", the algorithm violently links the pronoun
Heback to the entityJohn, andittoball. - 5. Pragmatic Analysis: The absolute highest level of AI. It attempts to mathematically deduce the user's true intent. If a user says "Do you know the time?", the Semantic analyzer would output "Yes/No". The Pragmatic analyzer overrides this, recognizing it as a request, and forces the system to output the actual time.