Artificial Intelligence

Natural Language Processing (NLP)

C-CAT

Natural Language Processing (NLP)

Definition

NLP is an AI method of communicating with intelligent systems using a natural human language (e.g., English, Hindi, French).

NLP is a sub-field of AI where computers can understand and process human language.

NLP relies mostly on Machine Learning and Deep Learning (Transformers).

NLP Objectives

  • Read — understand written text
  • Decipher — interpret meaning beyond literal words
  • Understand — comprehend context and intent
  • Make sense — extract actionable insights

Components of NLP

NLP System
├── NLU (Natural Language Understanding)
│   → Recognizes natural speech and UNDERSTANDS meaning (reading/interpreting)
└── NLG (Natural Language Generation)
    → PRODUCES a response in natural language (writing/generating)

NLU Examples: Reading comprehension, question answering, sentiment analysis NLG Examples: ChatGPT responses, news article generation, autocomplete

5 Steps in NLP Pipeline

StepDescriptionExample
1. Lexical AnalysisIdentify and analyze structure of words; divide text into sentences and words"The cat sat" → ["The", "cat", "sat"]
2. Syntactic AnalysisCheck grammar and word arrangement; reject grammatically wrong"The school goes to boy" → REJECTED
3. Semantic AnalysisDerive exact/dictionary meaning from text"Bank" near "river" vs "bank" for money
4. Discourse IntegrationMeaning of sentence depends on preceding/following sentences"It was delicious" — what was delicious?
5. Pragmatic AnalysisRe-interpret based on real-world knowledge; what was really meant"Can you pass the salt?" = a request, not a question about ability

Key NLP Techniques

TechniqueDescription
TokenizationSplit text into words/sentences/subwords
Stop Word RemovalRemove common words (the, is, a, at)
StemmingReduce words to root form: "running" → "run"
LemmatizationFind dictionary base form: "better" → "good"
POS TaggingLabel each word (noun, verb, adjective, etc.)
NER (Named Entity Recognition)Identify names, organizations, dates, locations
Sentiment AnalysisDetect positive/negative/neutral tone
Text ClassificationCategorize text into predefined classes

NLP Applications

ApplicationDescriptionExample
Virtual AssistantsVoice-driven interfacesAlexa, Siri
Social Media FilteringFilter terrorist/hate languageTwitter content moderation
HealthcareDisease recognition from patient speech / recordsClinical NLP
Sentiment AnalysisAnalyze opinions on social mediaBrand monitoring tools
Spam FilteringClassify emails as spam/hamGmail, Yahoo Mail
Fake News DetectionIdentify false news articlesNews verification tools
Talent RecruitmentSearch and select candidates from resumesLinkedIn, Naukri
Plagiarism CheckersDetect copied contentTurnitin, Grammarly
Machine TranslationConvert text between languagesGoogle Translate
Question AnsweringAnswer questions naturallyIBM Watson, ChatGPT

Transformer Architecture (Modern NLP)

The Transformer (2017, "Attention is All You Need", Google) revolutionized NLP:

Self-Attention:
  Every word attends to every other word in the sequence
  Captures long-range dependencies
  Parallel processing (unlike sequential RNN)

Key Transformer-based Models:

ModelDeveloperKey Feature
BERTGoogle (2018)Bidirectional; best for understanding
GPT-3/4OpenAIGenerative; best for text generation
T5GoogleText-to-text transfer transformer
LlamaMetaOpen-source, efficient
GeminiGoogleMultimodal (text+image+audio)

Continue learning

Related notes

Put this topic into timed practice

Open mock tests when you want full-exam pacing, or keep drilling in practice mode.