Unit 2
Unit 2
NATURAL LANGUAGE
PROCESSING
4/26/2023 1
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
NATURAL LANGUAGE
PROCESSING
UNIT-II
SYNTATIC ANALYSIS
SEMANTIC ANALYSIS
4/26/2023 2
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
I Syntactic Parsing:
1. Grammar formalisms.
2.Tree banks,
3. Efficient parsing for Context Free
grammars (CFG).
4.Statistical Context Free Grammars
5.Probabilistic Context Free Grammars
(PCFG)
6. Lexicalized PCFGs.
4/26/2023 3
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 4
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
5. Text classification 5
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
5. Text classification 6
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
5. Text classification 7
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 8
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
1. Introduction
2.Motivations
3.NLP?
4.Roadmap for NLP
5. NLP Components
6.NLP Issues
7. NLP Techniques
8.NLP Applications.
9. The role of Deep Learning in
Natural Language Processing
10. Backpropagations, recurrent
neural networks, Transformers.
.
4/26/2023 9
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
1. Introduction
2.Motivations
3.NLP?
4.Roadmap for NLP
5. NLP Components
6.NLP Issues
7. NLP Techniques
8.NLP Applications.
9. The role of Deep Learning in
Natural Language Processing
10. Backpropagations, recurrent
neural networks, Transformers.
.
4/26/2023 10
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
1. Introduction
2.Motivations
3.NLP?
4.Roadmap for NLP
5. NLP Components
6.NLP Issues
7. NLP Techniques
8.NLP Applications.
9. The role of Deep Learning in
Natural Language Processing
10. Backpropagations, recurrent
neural networks, Transformers.
.
4/26/2023 11
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 12
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 13
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 14
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 15
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 16
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 17
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 18
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 19
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
1. Introduction
2.Motivations
3.NLP?
4.Roadmap for NLP
5. NLP Components
6.NLP Issues
7. NLP Techniques
8.NLP Applications.
9. The role of Deep Learning in
Natural Language Processing
10. Backpropagations, recurrent
neural networks, Transformers.
.
4/26/2023 20
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 21
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 22
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 23
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 24
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 25
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Semantic role labeling is mostly used for machines to understand the roles of words within This Session
sentences. Learning Objectives
A better understanding of semantic role labeling could lead to advancements in a) . Syntactic Analysis
question answering, information extraction, 1 Grammars, Formalisms
automatic text summarization, text data mining, and speech recognition
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 26
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Different algorithms for different applications – different algorithms used for different a) . Syntactic Analysis
applications of NLP
1 Grammars, Formalisms
Word-sense discreteness ---Another difficulty in WSD is that words cannot be easily divided
into discrete sub meanings. 2. CFG,PCFG
b) .Semantic Analysis?
Inter-judge variance : it is often impossible for individuals to memorize all of the senses a 3. Lexical Semantic
word can take. 4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 27
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Logical Form in the sense : a machine-understandable representation of its meaning. This Session
Learning Objectives
Semantic parsing can thus be understood as extracting the precise meaning of an utterance.
The Applications of semantic parsing include a) . Syntactic Analysis
machine translation, 1 Grammars, Formalisms
question answering, 2. CFG,PCFG
ontology induction,[
automated reasoning, and b) .Semantic Analysis?
code generation. 3. Lexical Semantic
4.Word-Sense Disambuigity
The phrase was first used in the 1970s by Yorick Wilks as the basis for machine translation 5.Compositional semantics
programs working with only semantic representations. 6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 28
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 29
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Real time application using this Semantic Parsing Technique : This Session
Learning Objectives
Amazon Alexa spoken language understanding system.
a) . Syntactic Analysis
Ex: Shallow semantic parsers can parse utterances like
1 Grammars, Formalisms
"show me flights from Boston to Dallas" 2. CFG,PCFG
b) .Semantic Analysis?
-- by classifying the intent as "list flights", and filling slots "source" and "destination" 3. Lexical Semantic
with "Boston" and "Dallas",
4.Word-Sense Disambuigity
respectively
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 30
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 31
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
The most difficult problem of AI is to process the natural language by computers or in other This Session
words natural language processing is the most difficult problem of artificial intelligence. Learning Objectives
One of the major problems in NLP is discourse processing , which is one of the major a) . Syntactic Analysis
problems in NLP is discourse processing − building theories and models of how utterances 1 Grammars, Formalisms
stick together to form coherent discourse.
2. CFG,PCFG
The language always consists of collocated, structured and coherent groups of sentences rather b) .Semantic Analysis?
than isolated and unrelated sentences. 3. Lexical Semantic
4.Word-Sense Disambuigity
These coherent groups of sentences are referred to as discourse. 5.Compositional semantics
6.Semantic Role Labeling
Coherence and discourse structure are interconnected in many ways,
7.Semantic Parsing
.
4/26/2023 32
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
The coherent discourse must possess the following properties − This Session
Learning Objectives
• Coherence relation between utterances –meaningful connection between utterances
a) . Syntactic Analysis
• Relationship between entities -- there must be a certain kind of relationship with the entities 1 Grammars, Formalisms
2. CFG,PCFG
Discourse structure:
It Depends upon the segmentation we applied on discourse, b) .Semantic Analysis?
-- this may be defined as determining the types of structures for large discourse. 3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 33
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 34
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 35
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 36
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 37
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 38
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Interpretation of the sentences from any discourse is another important task and to achieve this This Session
we need to know who or what entity is being talked about. Learning Objectives
For Ex: “Ram, the manager of ABC bank, saw his friend Shyam at a shop. He went to meet him”, a) . Syntactic Analysis
the linguistic expressions like Ram, His, He are reference. 1 Grammars, Formalisms
Reference resolution may be defined as the task of determining what entities are referred to by 2. CFG,PCFG
which linguistic expression. b) .Semantic Analysis?
Terminology Used in Reference Resolution 3. Lexical Semantic
Referring expression − The natural language expression that is used to perform reference is 4.Word-Sense Disambuigity
called a referring expression. 5.Compositional semantics
Referent − It is the entity that is referred. Ex: in the last given example Ram is a referent.
6.Semantic Role Labeling
Corefer − used to refer to the same entity, they are called corefers. Ex: Ram and he are corefers.
Antecedent − The term has the license to use another term. Ex: Ram is the antecedent of the 7.Semantic Parsing
reference he. .
Anaphora & Anaphoric − The reference to an entity that has been previously introduced into
the sentence.
4/26/2023 39
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
4/26/2023 40
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
Coreference Resolution --- finding referring expressions in a text that refer to the same entity. This Session
A set of coreferring expressions are called coreference chain. Learning Objectives
For example - He, Chief Manager and His …..
a) . Syntactic Analysis
Constraint on Coreference Resolution- 1 Grammars, Formalisms
It can refer much like he and she
2. CFG,PCFG
The pronoun it also refers to the things that do not refer to specific things.
It’s raining. It is really good. b) .Semantic Analysis?
3. Lexical Semantic
Pronominal Anaphora Resolution:- 4.Word-Sense Disambuigity
pronominal anaphora resolution may be defined as the task of finding the antecedent for a single 5.Compositional semantics
pronoun.
6.Semantic Role Labeling
The pronoun is his and the task of pronominal anaphora resolution is to find the word Ram 7.Semantic Parsing
because Ram is the antecedent. .
4/26/2023 41
DEPARTMENT OF CSE-AIML (CSM) – III-II Sem
This Session
Learning Objectives
a) . Syntactic Analysis
1 Grammars, Formalisms
2. CFG,PCFG
b) .Semantic Analysis?
3. Lexical Semantic
4.Word-Sense Disambuigity
5.Compositional semantics
6.Semantic Role Labeling
7.Semantic Parsing
.
4/26/2023 42