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

Tendances

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 ProcessingYasir Khan
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingRishikese MR
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingMariana Soffer
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)Yuriy Guts
 
Natural language processing
Natural language processingNatural language processing
Natural language processingKarenVacca
 
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 (NLP)
Natural language processing (NLP) Natural language processing (NLP)
Natural language processing (NLP) ASWINKP11
 
Natural Language Processing
Natural Language Processing Natural Language Processing
Natural Language Processing Adarsh Saxena
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)Kuppusamy P
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: ParsingRushdi Shams
 
Natural language processing
Natural language processingNatural language processing
Natural language processingHansi Thenuwara
 
Natural Language Processing in Alternative and Augmentative Communication
Natural Language Processing in Alternative and Augmentative CommunicationNatural Language Processing in Alternative and Augmentative Communication
Natural Language Processing in Alternative and Augmentative CommunicationDivya Sugumar
 
Natural Language Processing in AI
Natural Language Processing in AINatural Language Processing in AI
Natural Language Processing in AISaurav Shrestha
 
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!
 

Tendances (20)

Natural language processing
Natural language processing Natural language processing
Natural language processing
 
Nlp
NlpNlp
Nlp
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
NLP
NLPNLP
NLP
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Natural Language Processing (NLP)
Natural Language Processing (NLP)Natural Language Processing (NLP)
Natural Language Processing (NLP)
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
NLP_KASHK: Introduction
NLP_KASHK: Introduction NLP_KASHK: Introduction
NLP_KASHK: Introduction
 
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 (NLP)
Natural language processing (NLP) Natural language processing (NLP)
Natural language processing (NLP)
 
Natural Language Processing
Natural Language Processing Natural Language Processing
Natural Language Processing
 
Natural language processing (nlp)
Natural language processing (nlp)Natural language processing (nlp)
Natural language processing (nlp)
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural Language Processing in Alternative and Augmentative Communication
Natural Language Processing in Alternative and Augmentative CommunicationNatural Language Processing in Alternative and Augmentative Communication
Natural Language Processing in Alternative and Augmentative Communication
 
Natural Language Processing in AI
Natural Language Processing in AINatural Language Processing in AI
Natural Language Processing in AI
 
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 ...
 

En vedette (12)

Mobile Computing UNIT-8
Mobile Computing UNIT-8Mobile Computing UNIT-8
Mobile Computing UNIT-8
 
Mobile OS Computer presentation
Mobile OS Computer presentationMobile OS Computer presentation
Mobile OS Computer presentation
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Unit 7
Unit 7Unit 7
Unit 7
 
Unit 6
Unit 6Unit 6
Unit 6
 
Mobile Ad-hoc Network (MANET) Routing Algorithms─ Part 1
Mobile Ad-hoc Network (MANET) Routing Algorithms─ Part 1Mobile Ad-hoc Network (MANET) Routing Algorithms─ Part 1
Mobile Ad-hoc Network (MANET) Routing Algorithms─ Part 1
 
Unit 4
Unit 4Unit 4
Unit 4
 
Mobile Computing UNIT-6
Mobile Computing UNIT-6Mobile Computing UNIT-6
Mobile Computing UNIT-6
 
Unit 2
Unit 2Unit 2
Unit 2
 
It6601 mobile computing unit 5
It6601 mobile computing unit 5It6601 mobile computing unit 5
It6601 mobile computing unit 5
 
Mobile computing unit 5
Mobile computing  unit 5Mobile computing  unit 5
Mobile computing unit 5
 
Unit 3
Unit 3Unit 3
Unit 3
 

Similaire à AI Lesson 41

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 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 with Python
Natural Language Processing with PythonNatural Language Processing with Python
Natural Language Processing with PythonBenjamin Bengfort
 
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
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingMichael Browning
 

Similaire à AI Lesson 41 (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 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
 
Presentation generative-transformational grammar
Presentation generative-transformational grammar Presentation generative-transformational grammar
Presentation generative-transformational grammar
 
Natural Language Processing with Python
Natural Language Processing with PythonNatural Language Processing with Python
Natural Language Processing with Python
 
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
 
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
 
NLP todo
NLP todoNLP todo
NLP todo
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 

Plus de Assistant Professor (20)

AI Lesson 39
AI Lesson 39AI Lesson 39
AI Lesson 39
 
AI Lesson 38
AI Lesson 38AI Lesson 38
AI Lesson 38
 
AI Lesson 37
AI Lesson 37AI Lesson 37
AI Lesson 37
 
AI Lesson 36
AI Lesson 36AI Lesson 36
AI Lesson 36
 
AI Lesson 35
AI Lesson 35AI Lesson 35
AI Lesson 35
 
AI Lesson 34
AI Lesson 34AI Lesson 34
AI Lesson 34
 
AI Lesson 33
AI Lesson 33AI Lesson 33
AI Lesson 33
 
AI Lesson 32
AI Lesson 32AI Lesson 32
AI Lesson 32
 
AI Lesson 31
AI Lesson 31AI Lesson 31
AI Lesson 31
 
AI Lesson 30
AI Lesson 30AI Lesson 30
AI Lesson 30
 
AI Lesson 29
AI Lesson 29AI Lesson 29
AI Lesson 29
 
AI Lesson 28
AI Lesson 28AI Lesson 28
AI Lesson 28
 
AI Lesson 27
AI Lesson 27AI Lesson 27
AI Lesson 27
 
AI Lesson 26
AI Lesson 26AI Lesson 26
AI Lesson 26
 
AI Lesson 25
AI Lesson 25AI Lesson 25
AI Lesson 25
 
AI Lesson 24
AI Lesson 24AI Lesson 24
AI Lesson 24
 
AI Lesson 23
AI Lesson 23AI Lesson 23
AI Lesson 23
 
AI Lesson 22
AI Lesson 22AI Lesson 22
AI Lesson 22
 
AI Lesson 21
AI Lesson 21AI Lesson 21
AI Lesson 21
 
Lesson 20
Lesson 20Lesson 20
Lesson 20
 

Dernier

31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 

Dernier (20)

31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 

AI Lesson 41

  • 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