SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
Module
13
Natural Language
Processing
Version 2 CSE IIT, Kharagpur
Lesson
41
Parsing
Version 2 CSE IIT, Kharagpur
13.3 Natural Language Generation
The steps in natural language generation are as follows.
Meaning representation
Utterance Planning
Meaning representations for sentences
Sentence Planning and Lexical Choice
Syntactic structures of sentences with lexical choices
Sentence Generation
Morphologically analyzed words
Morphological Generation
Words
13.4 Steps in Language Understanding and Generation
13.4.1 Morphological Analysis
• Analyzing words into their linguistic components (morphemes).
• Morphemes are the smallest meaningful units of language.
cars car+PLU
giving give+PROG
geliyordum gel+PROG+PAST+1SG - I was coming
• Ambiguity: More than one alternatives
flies flyVERB+PROG
flyNOUN+PLU
adam adam+ACC - the man (accusative)
adam+P1SG - my man
ada+P1SG+ACC - my island (accusative)
Version 2 CSE IIT, Kharagpur
13.4.2 Parts-of-Speech (POS) Tagging
• Each word has a part-of-speech tag to describe its category.
• Part-of-speech tag of a word is one of major word groups
(or its subgroups).
– open classes -- noun, verb, adjective, adverb
– closed classes -- prepositions, determiners, conjuctions, pronouns,
particples
• POS Taggers try to find POS tags for the words.
• duck is a verb or noun? (morphological analyzer cannot make decision).
• A POS tagger may make that decision by looking the surrounding words.
– Duck! (verb)
– Duck is delicious for dinner. (noun)
13.4.3 Lexical Processing
• The purpose of lexical processing is to determine meanings of individual words.
• Basic methods is to lookup in a database of meanings – lexicon
• We should also identify non-words such as punctuation marks.
• Word-level ambiguity -- words may have several meanings, and the correct one
cannot be chosen based solely on the word itself.
– bank in English
• Solution -- resolve the ambiguity on the spot by POS tagging (if possible) or pass-
on the ambiguity to the other levels.
13.4.4 Syntactic Processing
• Parsing -- converting a flat input sentence into a hierarchical structure that
corresponds to the units of meaning in the sentence.
• There are different parsing formalisms and algorithms.
• Most formalisms have two main components:
– grammar -- a declarative representation describing the syntactic structure
of sentences in the language.
– parser -- an algorithm that analyzes the input and outputs its structural
representation (its parse) consistent with the grammar specification.
Version 2 CSE IIT, Kharagpur
• CFGs are in the center of many of the parsing mechanisms. But they are
complemented by some additional features that make the formalism more suitable
to handle natural languages.
13.4.5 Semantic Analysis
• Assigning meanings to the structures created by syntactic analysis.
• Mapping words and structures to particular domain objects in way consistent with
our knowledge of the world.
• Semantic can play an import role in selecting among competing syntactic analyses
and discarding illogical analyses.
– I robbed the bank -- bank is a river bank or a financial institution
• We have to decide the formalisms which will be used in the meaning
representation.
13.5 Knowledge Representation for NLP
• Which knowledge representation will be used depends on the application --
Machine Translation, Database Query System.
• Requires the choice of representational framework, as well as the specific
meaning vocabulary (what are concepts and relationship between these concepts
-- ontology)
• Must be computationally effective.
• Common representational formalisms:
– first order predicate logic
– conceptual dependency graphs
– semantic networks
– Frame-based representations
13.6 Discourse
• Discourses are collection of coherent sentences (not arbitrary set of sentences)
• Discourses have also hierarchical structures (similar to sentences)
• anaphora resolution -- to resolve referring expression
– Mary bought a book for Kelly. She didn’t like it.
• She refers to Mary or Kelly. -- possibly Kelly
• It refers to what -- book.
– Mary had to lie for Kelly. She didn’t like it.
Version 2 CSE IIT, Kharagpur
• Discourse structure may depend on application.
– Monologue
– Dialogue
– Human-Computer Interaction
13.7 Applications of Natural Language Processing
• Machine Translation – Translation between two natural languages.
– See the Babel Fish translations system on Alta Vista.
• Information Retrieval – Web search (uni-lingual or multi-lingual).
• Query Answering/Dialogue – Natural language interface with a database system,
or a dialogue system.
• Report Generation – Generation of reports such as weather reports.
• Some Small Applications –
– Grammar Checking, Spell Checking, Spell Corrector
13.8 Machine Translation
• Machine Translation refers to converting a text in language A into the
corresponding text in language B (or speech).
• Different Machine Translation architectures are:
– interlingua based systems
– transfer based systems
• Challenges are to acquire the required knowledge resources such as mapping rules
and bi-lingual dictionary? By hand or acquire them automatically from corpora.
• Example Based Machine Translation acquires the required knowledge (some of it
or all of it) from corpora.
Version 2 CSE IIT, Kharagpur
Questions
1. Consider the following short story:
John went to the diner to eat lunch. He ordered a hamburger. But John wasn't very
hungry so he didn't _nish it. John told the waiter that he wanted a doggy bag. John gave
the waiter a tip. John then went to the hardware store and home.
Each inference below is based on a plausible interpretation of the story. For each
inference, briefly explain whether that inference was primarily based on syntactic,
semantic, pragmatic, discourse, or world knowledge. (Do not answer world knowledge
unless none of the other categories are appropriate.)
(a) John is the person who ordered a hamburger.
(b) John wasn't just stating a fact that he desired a doggy bag, but was requesting that the
waiter bring him a doggy bag.
(c) John went to the hardware store and then went to his house. (As opposed to going to
a hardware store and a hardware home.)
(d) John gave the waiter some money as a gratuity. (As opposed to giving him a
suggestion or hint.)
(e) John was wearing clothes.
2. Identify the thematic role associated with each noun phrase in the sentence below:
Mary went from Utah to Colorado with John by bicycle.
Solutions
1.a. Discourse knowledge. The inference comes from coreference resolution between
John” and “He” in the first and second sentences.
1.b. Pragmatics. Most people would assume that John was making a request of the waiter
and not merely stating a fact, which is a pragmatic issue because it reects the purpose of
John's statement.
1.c. Syntactic knowledge. This inference reflects one syntactic parse: ((hardware store)
and (home)), as opposed to an alternative parse: (hardware (store and home)).
1.d Semantic knowledge. Most people would assume that “tip” means gratuity, as
opposed to other meanings of the word “tip”, such as suggestion or hint.
Version 2 CSE IIT, Kharagpur
1.e. World Knowledge. There is nothing stated in the story that mentions clothes, but in
our culture people virtually always wear clothes when they leave their house. So we
make this assumption.
2. The roles are
agent = Mary
source (from-loc) = Utah
destination (to-loc) = Colorado
co-agent = John
instrument = bicycle
Version 2 CSE IIT, Kharagpur

Contenu connexe

Similaire à NLP Module Explains Key Steps and Applications

Natural Language Processing Course in AI
Natural Language Processing Course in AINatural Language Processing Course in AI
Natural Language Processing Course in AISATHYANARAYANAKB
 
CNN for NLP using text analysis by using deep learning
CNN for NLP using text analysis by using deep learningCNN for NLP using text analysis by using deep learning
CNN for NLP using text analysis by using deep learningKv Sagar
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)Kuppusamy P
 
Lec12 semantic processing
Lec12 semantic processingLec12 semantic processing
Lec12 semantic processingManju Rajput
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4DigiGurukul
 
Natural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxNatural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxSHIBDASDUTTA
 
Using construction grammar in conversational systems
Using construction grammar in conversational systemsUsing construction grammar in conversational systems
Using construction grammar in conversational systemsCJ Jenkins
 
Processing Written English
Processing Written EnglishProcessing Written English
Processing Written EnglishRuel Montefolka
 
Presentation generative-transformational grammar
Presentation generative-transformational grammar Presentation generative-transformational grammar
Presentation generative-transformational grammar Nailun Naja
 
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffffnlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffffSushantVyas1
 
Maintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed LanguagesMaintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed LanguagesAmin Bandeali
 
Shallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliteratorShallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliteratorShashank Shisodia
 
Natural Language Processing, Techniques, Current Trends and Applications in I...
Natural Language Processing, Techniques, Current Trends and Applications in I...Natural Language Processing, Techniques, Current Trends and Applications in I...
Natural Language Processing, Techniques, Current Trends and Applications in I...RajkiranVeluri
 
How To "Speak Developer"
How To "Speak Developer"How To "Speak Developer"
How To "Speak Developer"Nick Malcolm
 

Similaire à NLP Module Explains Key Steps and Applications (20)

Natural Language Processing Course in AI
Natural Language Processing Course in AINatural Language Processing Course in AI
Natural Language Processing Course in AI
 
intro.ppt
intro.pptintro.ppt
intro.ppt
 
CNN for NLP using text analysis by using deep learning
CNN for NLP using text analysis by using deep learningCNN for NLP using text analysis by using deep learning
CNN for NLP using text analysis by using deep learning
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
 
Lec12 semantic processing
Lec12 semantic processingLec12 semantic processing
Lec12 semantic processing
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
 
Nlp
NlpNlp
Nlp
 
Natural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxNatural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptx
 
Using construction grammar in conversational systems
Using construction grammar in conversational systemsUsing construction grammar in conversational systems
Using construction grammar in conversational systems
 
Processing Written English
Processing Written EnglishProcessing Written English
Processing Written English
 
Presentation generative-transformational grammar
Presentation generative-transformational grammar Presentation generative-transformational grammar
Presentation generative-transformational grammar
 
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffffnlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
nlp-01.pptxvvvffffffvvvvvfeddeeddffffffffff
 
nlp (1).pptx
nlp (1).pptxnlp (1).pptx
nlp (1).pptx
 
Maintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed LanguagesMaintenance of Dynamically vs. Statically typed Languages
Maintenance of Dynamically vs. Statically typed Languages
 
Nlp (1)
Nlp (1)Nlp (1)
Nlp (1)
 
1 Introduction.ppt
1 Introduction.ppt1 Introduction.ppt
1 Introduction.ppt
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Shallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliteratorShallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliterator
 
Natural Language Processing, Techniques, Current Trends and Applications in I...
Natural Language Processing, Techniques, Current Trends and Applications in I...Natural Language Processing, Techniques, Current Trends and Applications in I...
Natural Language Processing, Techniques, Current Trends and Applications in I...
 
How To "Speak Developer"
How To "Speak Developer"How To "Speak Developer"
How To "Speak Developer"
 

Plus de narendrancool

Data-Science g BBC ghjkkkksjsjsjsjjdjsns
Data-Science g BBC ghjkkkksjsjsjsjjdjsnsData-Science g BBC ghjkkkksjsjsjsjjdjsns
Data-Science g BBC ghjkkkksjsjsjsjjdjsnsnarendrancool
 
Week_07_Assignment_07.pdf
Week_07_Assignment_07.pdfWeek_07_Assignment_07.pdf
Week_07_Assignment_07.pdfnarendrancool
 
4_2017_12_05!05_45_31_PM.pptx
4_2017_12_05!05_45_31_PM.pptx4_2017_12_05!05_45_31_PM.pptx
4_2017_12_05!05_45_31_PM.pptxnarendrancool
 
Create table student
Create table studentCreate table student
Create table studentnarendrancool
 

Plus de narendrancool (7)

Data-Science g BBC ghjkkkksjsjsjsjjdjsns
Data-Science g BBC ghjkkkksjsjsjsjjdjsnsData-Science g BBC ghjkkkksjsjsjsjjdjsns
Data-Science g BBC ghjkkkksjsjsjsjjdjsns
 
Team Slides.pptx
Team Slides.pptxTeam Slides.pptx
Team Slides.pptx
 
Week_07_Assignment_07.pdf
Week_07_Assignment_07.pdfWeek_07_Assignment_07.pdf
Week_07_Assignment_07.pdf
 
Rangoli for you.pdf
Rangoli for you.pdfRangoli for you.pdf
Rangoli for you.pdf
 
4_2017_12_05!05_45_31_PM.pptx
4_2017_12_05!05_45_31_PM.pptx4_2017_12_05!05_45_31_PM.pptx
4_2017_12_05!05_45_31_PM.pptx
 
1
11
1
 
Create table student
Create table studentCreate table student
Create table student
 

Dernier

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Dernier (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

NLP Module Explains Key Steps and Applications

  • 3. 13.3 Natural Language Generation The steps in natural language generation are as follows. Meaning representation Utterance Planning Meaning representations for sentences Sentence Planning and Lexical Choice Syntactic structures of sentences with lexical choices Sentence Generation Morphologically analyzed words Morphological Generation Words 13.4 Steps in Language Understanding and Generation 13.4.1 Morphological Analysis • Analyzing words into their linguistic components (morphemes). • Morphemes are the smallest meaningful units of language. cars car+PLU giving give+PROG geliyordum gel+PROG+PAST+1SG - I was coming • Ambiguity: More than one alternatives flies flyVERB+PROG flyNOUN+PLU adam adam+ACC - the man (accusative) adam+P1SG - my man ada+P1SG+ACC - my island (accusative) Version 2 CSE IIT, Kharagpur
  • 4. 13.4.2 Parts-of-Speech (POS) Tagging • Each word has a part-of-speech tag to describe its category. • Part-of-speech tag of a word is one of major word groups (or its subgroups). – open classes -- noun, verb, adjective, adverb – closed classes -- prepositions, determiners, conjuctions, pronouns, particples • POS Taggers try to find POS tags for the words. • duck is a verb or noun? (morphological analyzer cannot make decision). • A POS tagger may make that decision by looking the surrounding words. – Duck! (verb) – Duck is delicious for dinner. (noun) 13.4.3 Lexical Processing • The purpose of lexical processing is to determine meanings of individual words. • Basic methods is to lookup in a database of meanings – lexicon • We should also identify non-words such as punctuation marks. • Word-level ambiguity -- words may have several meanings, and the correct one cannot be chosen based solely on the word itself. – bank in English • Solution -- resolve the ambiguity on the spot by POS tagging (if possible) or pass- on the ambiguity to the other levels. 13.4.4 Syntactic Processing • Parsing -- converting a flat input sentence into a hierarchical structure that corresponds to the units of meaning in the sentence. • There are different parsing formalisms and algorithms. • Most formalisms have two main components: – grammar -- a declarative representation describing the syntactic structure of sentences in the language. – parser -- an algorithm that analyzes the input and outputs its structural representation (its parse) consistent with the grammar specification. Version 2 CSE IIT, Kharagpur
  • 5. • CFGs are in the center of many of the parsing mechanisms. But they are complemented by some additional features that make the formalism more suitable to handle natural languages. 13.4.5 Semantic Analysis • Assigning meanings to the structures created by syntactic analysis. • Mapping words and structures to particular domain objects in way consistent with our knowledge of the world. • Semantic can play an import role in selecting among competing syntactic analyses and discarding illogical analyses. – I robbed the bank -- bank is a river bank or a financial institution • We have to decide the formalisms which will be used in the meaning representation. 13.5 Knowledge Representation for NLP • Which knowledge representation will be used depends on the application -- Machine Translation, Database Query System. • Requires the choice of representational framework, as well as the specific meaning vocabulary (what are concepts and relationship between these concepts -- ontology) • Must be computationally effective. • Common representational formalisms: – first order predicate logic – conceptual dependency graphs – semantic networks – Frame-based representations 13.6 Discourse • Discourses are collection of coherent sentences (not arbitrary set of sentences) • Discourses have also hierarchical structures (similar to sentences) • anaphora resolution -- to resolve referring expression – Mary bought a book for Kelly. She didn’t like it. • She refers to Mary or Kelly. -- possibly Kelly • It refers to what -- book. – Mary had to lie for Kelly. She didn’t like it. Version 2 CSE IIT, Kharagpur
  • 6. • Discourse structure may depend on application. – Monologue – Dialogue – Human-Computer Interaction 13.7 Applications of Natural Language Processing • Machine Translation – Translation between two natural languages. – See the Babel Fish translations system on Alta Vista. • Information Retrieval – Web search (uni-lingual or multi-lingual). • Query Answering/Dialogue – Natural language interface with a database system, or a dialogue system. • Report Generation – Generation of reports such as weather reports. • Some Small Applications – – Grammar Checking, Spell Checking, Spell Corrector 13.8 Machine Translation • Machine Translation refers to converting a text in language A into the corresponding text in language B (or speech). • Different Machine Translation architectures are: – interlingua based systems – transfer based systems • Challenges are to acquire the required knowledge resources such as mapping rules and bi-lingual dictionary? By hand or acquire them automatically from corpora. • Example Based Machine Translation acquires the required knowledge (some of it or all of it) from corpora. Version 2 CSE IIT, Kharagpur
  • 7. Questions 1. Consider the following short story: John went to the diner to eat lunch. He ordered a hamburger. But John wasn't very hungry so he didn't _nish it. John told the waiter that he wanted a doggy bag. John gave the waiter a tip. John then went to the hardware store and home. Each inference below is based on a plausible interpretation of the story. For each inference, briefly explain whether that inference was primarily based on syntactic, semantic, pragmatic, discourse, or world knowledge. (Do not answer world knowledge unless none of the other categories are appropriate.) (a) John is the person who ordered a hamburger. (b) John wasn't just stating a fact that he desired a doggy bag, but was requesting that the waiter bring him a doggy bag. (c) John went to the hardware store and then went to his house. (As opposed to going to a hardware store and a hardware home.) (d) John gave the waiter some money as a gratuity. (As opposed to giving him a suggestion or hint.) (e) John was wearing clothes. 2. Identify the thematic role associated with each noun phrase in the sentence below: Mary went from Utah to Colorado with John by bicycle. Solutions 1.a. Discourse knowledge. The inference comes from coreference resolution between John” and “He” in the first and second sentences. 1.b. Pragmatics. Most people would assume that John was making a request of the waiter and not merely stating a fact, which is a pragmatic issue because it reects the purpose of John's statement. 1.c. Syntactic knowledge. This inference reflects one syntactic parse: ((hardware store) and (home)), as opposed to an alternative parse: (hardware (store and home)). 1.d Semantic knowledge. Most people would assume that “tip” means gratuity, as opposed to other meanings of the word “tip”, such as suggestion or hint. Version 2 CSE IIT, Kharagpur
  • 8. 1.e. World Knowledge. There is nothing stated in the story that mentions clothes, but in our culture people virtually always wear clothes when they leave their house. So we make this assumption. 2. The roles are agent = Mary source (from-loc) = Utah destination (to-loc) = Colorado co-agent = John instrument = bicycle Version 2 CSE IIT, Kharagpur