












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Neural NLP uses neural networks to understand, process, and generate human language.
Traditional NLP often depends on manually designed features and statistical methods. Neural NLP learns useful patterns automatically from data.
Sentence:
โThe movie was very good.โ
A neural NLP model can learn that words such as good, excellent, amazing are often associated with positive sentiment.
Traditional NLP methods have some limitations:
โ They require manual feature engineering. โ They have difficulty understanding context. โ They may struggle with complex language. โ They do not represent word meaning very effectively. โ They have difficulty handling long-distance relationships between words.
Neural networks help by learning representations and patterns automatically.
Statistical NLP models such as traditional N-gram models have limitations.
An N-gram model considers only a fixed number of previous words.
Many possible word combinations may never appear in the training data.
Relationships between words that are far apart are difficult to capture.
Handling a very large vocabulary requires considerable storage and computation.
Traditional models mainly depend on word occurrence probabilities rather than deeper contextual representations.
A dense vector representation represents a word as a vector of numerical values.
Example:
"king" โ [0.25, -0.14, 0.72, 0.31, ...]
Words with related meanings tend to have similar vector representations.
King โ vector Queen โ vector Man โ vector Woman โ vector
These representations allow neural networks to work with the meaning and relationships between words mathematically.
โ Captures semantic relationships. โ Represents words numerically. โ Useful for machine learning. โ Helps neural networks process language.
Every word interacts with other words to create a better contextual representation.
This is the basic attention mechanism used in Transformers.
It uses three components:
โ Query (Q) โ Key (K) โ Value (V)
The formula is:
Attention(Q,K,V)=softmax\left(\frac{QK^T}{\sqrt{d_k}}\right)V
The division by \sqrt{d_k} prevents very large values from making the Softmax function unstable.
Attention provides several benefits:
โ Captures relationships between distant words. โ Focuses on important words. โ Handles context better. โ Allows parallel processing in Transformers. โ Reduces dependence on sequential processing.
An EncoderโDecoder model contains two main parts:
Converts the input sequence into a representation.
Uses that representation to generate the output sequence.
Input Sentence โ Encoder โ Representation โ Decoder โ Output Sentence
English "I love India." โ Encoder โ Decoder โ Hindi "เคฎเฅเคเฅ เคญเคพเคฐเคค เคชเคธเคเคฆ เคนเฅเฅค"
โ Machine translation โ Text summarization โ Question answering โ Chatbots
English sentence โ Hindi sentence
and uses these examples to predict translations.
It may produce unnatural translations and has difficulty with complex context.
NMT uses neural networks to translate text.
Modern NMT systems commonly use Transformer-based architectures.
โ Better contextual understanding. โ More fluent translations. โ Handles long-range relationships better than older approaches. โ Learns representations automatically.
Text summarization automatically creates a shorter version of a longer document while retaining important information.
A 10-page news article can be converted into a short paragraph containing the main points.
Extractive summarization
Selects important sentences from the original document.
Abstractive summarization
Generates new sentences that express the important information.
โ News summarization โ Research-paper summaries โ Legal document summarization โ Meeting summaries โ Email summarization
A Transformer is a neural network architecture based mainly on attention mechanisms rather than recurrent processing.
Main components include:
Input Tokens โ Token Embeddings โ Positional Information โ Multi-Head Attention โ Feedforward Network โ Output Representation
Multi-head attention uses multiple attention mechanisms, called heads , at the same time.
Each head can learn to focus on different relationships in the sentence.
A feedforward neural network is applied to the representations produced by the attention mechanism.
Its role is to further transform and learn useful patterns from the representations.
Simplified:
Attention Output โ Feedforward Network โ Improved Representation
Transformer RNN
Processes tokens in parallel Processes sequentially
Uses self-attention Uses recurrent connections
Handles long-range relationships effectively Can struggle with long dependencies
Faster training can be achieved through parallelization
Training is more sequential
Highly scalable Sequential nature limits parallelization
A contextual embedding represents a word according to the context in which it appears.
โI deposited money at the bank.โ
and
โWe sat near the river bank.โ
The word bank has different meanings in the two sentences.
Contextual embeddings can produce different representations based on the surrounding words.
BERT = Bidirectional Encoder Representations from Transformers
BERT is a Transformer-based language model designed to understand language using context from both directions.
BERT considers information from both:
โ Left side of a word โ Right side of a word
This helps it understand the context more effectively.
Simplified:
A pre-trained model such as BERT can be adapted for specific tasks.
Input:
Question: Where is the college?
Passage: The college is located in Pune.
Output:
Pune
Input:
โThe service was excellent.โ
Output:
Positive
Other applications include:
โ Sentiment analysis โ Named Entity Recognition โ Document classification โ Question answering
A chatbot communicates with users using natural language.
Student:
โWhen is my exam?โ
Chatbot:
โYour NLP exam is scheduled according to the college timetable.โ
Applications:
โ Customer support โ Education โ Banking โ Healthcare information systems
B. Sentiment Analysis
Modern neural models can identify the sentiment of text.
"I loved the movie." โ Neural NLP Model โ Positive
C. Document Classification
Documents are automatically assigned to categories.
Example:
Customer document โ NLP Model โ Billing / Technical / Account / Other
Applications:
โ Email classification โ News classification โ Legal document classification โ Customer-support routing
Students have many questions about:
โ Syllabus โ Timetable โ Exams โ Assignments โ Attendance โ College rules
Develop an AI-powered academic chatbot.
Student โ Chatbot Interface โ Question Processing โ Knowledge Base / RAG โ Language Model โ Answer โ Student
Student:
โWhat are the topics in Unit V of NLP?โ
The chatbot retrieves the relevant syllabus information and provides the answer.
โ Available anytime. โ Quick responses. โ Reduces repetitive questions. โ Helps students access academic information.
A normal language model may not have access to an organizationโs private documents.
Use RAG.
Question โ Document Search โ Relevant Documents โ Context โ Language Model โ Answer
A university uploads:
โ Student handbook โ Examination rules โ Academic calendar โ Department regulations
A student asks:
โWhat is the procedure for applying for an exam?โ
Important: A generated legal summary should be treated as an aid to reading, not as a substitute for professional legal review.
Many users are more comfortable communicating in their regional language.
Create a voice assistant that supports regional languages.
User Speaks โ Speech Recognition / ASR โ Regional Language Text โ NLP Model โ Answer Generation โ Text-to-Speech โ Spoken Answer
A user asks a question in Marathi.
Marathi Speech โ ASR โ Marathi Text โ NLP Model
Answer โ Marathi Speech
โ Education โ Government information services โ Agriculture information โ Customer support โ Voice-based learning systems