SlideShare a Scribd company logo
1 of 8
Download to read offline
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

More Related Content

What's hot

Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)Yuriy Guts
Β 
Natural Language Processing in AI
Natural Language Processing in AINatural Language Processing in AI
Natural Language Processing in AISaurav Shrestha
Β 
NLP_KASHK:Text Normalization
NLP_KASHK:Text NormalizationNLP_KASHK:Text Normalization
NLP_KASHK:Text NormalizationHemantha Kulathilake
Β 
Natural language processing
Natural language processingNatural language processing
Natural language processingAanchal Chaurasia
Β 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: ParsingRushdi Shams
Β 
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...Edureka!
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingRishikese MR
Β 
Natural language processing
Natural language processing Natural language processing
Natural language processing Md.Sumon Sarder
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingMariana Soffer
Β 
Natural Language Processing with Python
Natural Language Processing with PythonNatural Language Processing with Python
Natural Language Processing with PythonBenjamin Bengfort
Β 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingTed Xiao
Β 
Formal languages
Formal languagesFormal languages
Formal languagesVestforsk.no
Β 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Mustafa Jarrar
Β 
Natural Language Processing glossary for Coders
Natural Language Processing glossary for CodersNatural Language Processing glossary for Coders
Natural Language Processing glossary for CodersAravind Mohanoor
Β 
Natural Language Processing - Unit 1
Natural Language Processing - Unit 1Natural Language Processing - Unit 1
Natural Language Processing - Unit 1Mithun B N
Β 
Natural language processing
Natural language processingNatural language processing
Natural language processingKarenVacca
Β 

What's hot (20)

Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
Β 
Natural Language Processing in AI
Natural Language Processing in AINatural Language Processing in AI
Natural Language Processing in AI
Β 
NLP_KASHK:Text Normalization
NLP_KASHK:Text NormalizationNLP_KASHK:Text Normalization
NLP_KASHK:Text Normalization
Β 
Natural language processing
Natural language processingNatural language processing
Natural language processing
Β 
NLP
NLPNLP
NLP
Β 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
Β 
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...
Stemming And Lemmatization Tutorial | Natural Language Processing (NLP) With ...
Β 
Nlp
NlpNlp
Nlp
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Β 
Natural language processing
Natural language processing Natural language processing
Natural language processing
Β 
NLP_KASHK:POS Tagging
NLP_KASHK:POS TaggingNLP_KASHK:POS Tagging
NLP_KASHK:POS Tagging
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Β 
Natural Language Processing with Python
Natural Language Processing with PythonNatural Language Processing with Python
Natural Language Processing with Python
Β 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
Β 
Formal languages
Formal languagesFormal languages
Formal languages
Β 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
Β 
Natural Language Processing glossary for Coders
Natural Language Processing glossary for CodersNatural Language Processing glossary for Coders
Natural Language Processing glossary for Coders
Β 
Natural Language Processing - Unit 1
Natural Language Processing - Unit 1Natural Language Processing - Unit 1
Natural Language Processing - Unit 1
Β 
NLP
NLPNLP
NLP
Β 
Natural language processing
Natural language processingNatural language processing
Natural language processing
Β 

Similar to Parsing and Applications of NLP

Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4DigiGurukul
Β 
NLP introduced and in 47 slides Lecture 1.ppt
NLP introduced and in 47 slides Lecture 1.pptNLP introduced and in 47 slides Lecture 1.ppt
NLP introduced and in 47 slides Lecture 1.pptOlusolaTop
Β 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)Kuppusamy P
Β 
Natural Language Processing Course in AI
Natural Language Processing Course in AINatural Language Processing Course in AI
Natural Language Processing Course in AISATHYANARAYANAKB
Β 
Natural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxNatural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxSHIBDASDUTTA
Β 
Presentation generative-transformational grammar
Presentation generative-transformational grammar Presentation generative-transformational grammar
Presentation generative-transformational grammar Nailun Naja
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingToine Bogers
Β 
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
Β 
Sanskrit in Natural Language Processing
Sanskrit in Natural Language ProcessingSanskrit in Natural Language Processing
Sanskrit in Natural Language ProcessingHitesh Joshi
Β 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)Abdullah al Mamun
Β 
Jarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingJarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingMustafa Jarrar
Β 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language ProcessingPranav Gupta
Β 
Wide Coverage Semantic Representations from a CCG Parser
Wide Coverage Semantic Representations from a CCG ParserWide Coverage Semantic Representations from a CCG Parser
Wide Coverage Semantic Representations from a CCG ParserMark Chang
Β 

Similar to Parsing and Applications of NLP (20)

Lesson 41.pdf
Lesson 41.pdfLesson 41.pdf
Lesson 41.pdf
Β 
AI Lesson 40
AI Lesson 40AI Lesson 40
AI Lesson 40
Β 
intro.ppt
intro.pptintro.ppt
intro.ppt
Β 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
Β 
NLP introduced and in 47 slides Lecture 1.ppt
NLP introduced and in 47 slides Lecture 1.pptNLP introduced and in 47 slides Lecture 1.ppt
NLP introduced and in 47 slides Lecture 1.ppt
Β 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
Β 
Natural Language Processing Course in AI
Natural Language Processing Course in AINatural Language Processing Course in AI
Natural Language Processing Course in AI
Β 
Natural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptxNatural Language Processing (NLP).pptx
Natural Language Processing (NLP).pptx
Β 
NLP_KASHK: Introduction
NLP_KASHK: Introduction NLP_KASHK: Introduction
NLP_KASHK: Introduction
Β 
Presentation generative-transformational grammar
Presentation generative-transformational grammar Presentation generative-transformational grammar
Presentation generative-transformational grammar
Β 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Β 
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
Β 
Sanskrit in Natural Language Processing
Sanskrit in Natural Language ProcessingSanskrit in Natural Language Processing
Sanskrit in Natural Language Processing
Β 
L1 nlp intro
L1 nlp introL1 nlp intro
L1 nlp intro
Β 
Nlp (1)
Nlp (1)Nlp (1)
Nlp (1)
Β 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
Β 
Jarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingJarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language Processing
Β 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processing
Β 
Natural language processing
Natural language processingNatural language processing
Natural language processing
Β 
Wide Coverage Semantic Representations from a CCG Parser
Wide Coverage Semantic Representations from a CCG ParserWide Coverage Semantic Representations from a CCG Parser
Wide Coverage Semantic Representations from a CCG Parser
Β 

More from Avijit Kumar

More from Avijit Kumar (20)

Lesson 18
Lesson 18Lesson 18
Lesson 18
Β 
Lesson 19
Lesson 19Lesson 19
Lesson 19
Β 
Lesson 20
Lesson 20Lesson 20
Lesson 20
Β 
Lesson 21
Lesson 21Lesson 21
Lesson 21
Β 
Lesson 23
Lesson 23Lesson 23
Lesson 23
Β 
Lesson 25
Lesson 25Lesson 25
Lesson 25
Β 
Lesson 24
Lesson 24Lesson 24
Lesson 24
Β 
Lesson 22
Lesson 22Lesson 22
Lesson 22
Β 
Lesson 26
Lesson 26Lesson 26
Lesson 26
Β 
Lesson 27
Lesson 27Lesson 27
Lesson 27
Β 
Lesson 28
Lesson 28Lesson 28
Lesson 28
Β 
Lesson 29
Lesson 29Lesson 29
Lesson 29
Β 
Lesson 30
Lesson 30Lesson 30
Lesson 30
Β 
Lesson 31
Lesson 31Lesson 31
Lesson 31
Β 
Lesson 32
Lesson 32Lesson 32
Lesson 32
Β 
Lesson 33
Lesson 33Lesson 33
Lesson 33
Β 
Lesson 36
Lesson 36Lesson 36
Lesson 36
Β 
Lesson 35
Lesson 35Lesson 35
Lesson 35
Β 
Lesson 37
Lesson 37Lesson 37
Lesson 37
Β 
Lesson 39
Lesson 39Lesson 39
Lesson 39
Β 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
Β 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
Β 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
Β 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
Β 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Β 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
Β 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
Β 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Β 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
Β 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
Β 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
Β 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
Β 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
Β 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
Β 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
Β 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
Β 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
Β 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Β 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Β 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Β 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
Β 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Β 
Hot Sexy call girls in Panjabi Bagh πŸ” 9953056974 πŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh πŸ” 9953056974 πŸ” Delhi escort ServiceHot Sexy call girls in Panjabi Bagh πŸ” 9953056974 πŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh πŸ” 9953056974 πŸ” Delhi escort Service
Β 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Β 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Β 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Β 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Β 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Β 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Β 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
Β 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Β 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Β 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Β 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Β 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
Β 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Β 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Β 

Parsing and Applications of NLP

  • 1. Module 13 Natural Language Processing Version 2 CSE IIT, Kharagpur
  • 2. Lesson 41 Parsing Version 2 CSE IIT, Kharagpur
  • 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