SlideShare a Scribd company logo
Chapter Five
Learning, Communicating, Perceiving, and
Acting
5.1 Learning
• Definition: “learning is a goal-directed process of a system that
improves the knowledge or the knowledge representation of the
system by exploring experience and prior knowledge”
acquisition of new declarative knowledge
Development of motor and cognitive skills through instruction and
practice.
Organization of new knowledge into general effective representation.
discovery of new facts and theories through observation and
experimentation
Learning from Examples/Observation
• Observational Learning: To learn by watching and imitating others. For example,
child tries to learn by mimicking her parent.
Knowledge in Learning
• Supervised Learning: It involves a teacher that is scholar than the ANN itself.
For example, the teacher feeds some example data about which the teacher
already knows the answers.
For example, pattern recognizing. The ANN comes up with guesses while
recognizing.
Then the teacher provides the ANN with the answers. The network then compares
it guesses with the teacher’s “correct” answers and makes adjustments according
to errors.
• For supervised learning, the aim is to find a simple hypothesis approximately
consistent with training examples
Cont’d
• Unsupervised Learning: It is required when there is no example data
set with known answers. For example, searching for a hidden pattern.
In this case, clustering i.e. dividing a set of elements into groups
according to some unknown pattern is carried out based on the
existing data sets present.
• Reinforcement Learning: This strategy built on observation. The ANN
makes a decision by observing its environment. If the observation is
negative, the network adjusts its weights to be able to make a
different required decision the next time.
Learning Probabilistic Models
• A deterministic mathematical model is meant to yield a single
solution describing the outcome of some "experiment" given
appropriate inputs. A probabilistic model is, instead, meant to give a
distribution of possible outcomes (i.e. it describes all outcomes and
gives some measure of how likely each is to occur)
Neural Networks
• An Artificial Neural Network (ANN) is an information processing
paradigm that is inspired by the way biological nervous systems, such
as the brain, process information. The key element of this paradigm is
the novel structure of the information processing system.
Cont’d
• A neural network is composed of a number of nodes, or units,
connected by links.
• Each link has a numeric weight associated with it.
• Weights are the primary means of long-term storage in neural
networks, and learning usually takes place by updating the weights.
5.2 Communicating, Perceiving, and Acting
• Natural Language Processing (NLP) refers to AI method of communicating
with an intelligent systems using a natural language such as English.
• Processing of Natural Language is required when you want an intelligent
system like robot to perform as per your instructions, when you want to
hear decision from a dialogue based clinical expert system, etc.
• The field of NLP involves making computers to perform useful tasks with
the natural languages humans use. The input and output of an NLP system
can be −
Speech
Written Text
Components of NLP
There are two components of NLP as given
Natural Language Understanding (NLU)
• Understanding involves the following tasks −
Mapping the given input in natural language into useful
representations.
Analyzing different aspects of the language.
Natural Language Generation (NLG)
• It is the process of producing meaningful phrases and sentences in
the form of natural language from some internal representation.
Cont’d
• It involves −
• Text planning − It includes retrieving the relevant content from
knowledge base.
• Sentence planning − It includes choosing required words, forming
meaningful phrases, setting tone of the sentence.
• Text Realization − It is mapping sentence plan into sentence
structure.
• The NLU is harder than NLG.
Difficulties in NLU
• NL has an extremely rich form and structure.
• It is very ambiguous. There can be different levels of ambiguity −
Lexical ambiguity − It is at very primitive level such as word-level.
• For example, treating the word “board” as noun or verb?
Syntax Level ambiguity − A sentence can be parsed in different ways.
• For example, “He lifted the beetle with red cap.” − Did he use cap to lift the
beetle or he lifted a beetle that had red cap?
Referential ambiguity − Referring to something using pronouns.
• For example, Rima went to Gauri. She said, “I am tired.” − Exactly who is tired?
• One input can mean different meanings.
• Many inputs can mean the same thing.
NLP Terminology
• Phonology − It is study of organizing sound systematically.
• Morphology − It is a study of construction of words from primitive meaningful
units.
• Morpheme − It is primitive unit of meaning in a language.
• Syntax − It refers to arranging words to make a sentence. It also involves
determining the structural role of words in the sentence and in phrases.
• Semantics − It is concerned with the meaning of words and how to combine
words into meaningful phrases and sentences.
• Pragmatics − It deals with using and understanding sentences in different
situations and how the interpretation of the sentence is affected.
• Discourse − It deals with how the immediately preceding sentence can affect the
interpretation of the next sentence.
• World Knowledge − It includes the general knowledge about the world.
Steps in NLP
• There are general five steps −
• Lexical Analysis − It involves identifying and analyzing the structure of
words. Lexicon of a language means the collection of words and
phrases in a language. Lexical analysis is dividing the whole chunk of
txt into paragraphs, sentences, and words.
• Syntactic Analysis (Parsing) − It involves analysis of words in the
sentence for grammar and arranging words in a manner that shows
the relationship among the words. The sentence such as “The school
goes to boy” is rejected by English syntactic analyzer.
Cont’d
• Semantic Analysis − It draws the exact meaning or the dictionary
meaning from the text. The text is checked for meaningfulness. It is
done by mapping syntactic structures and objects in the task domain.
The semantic analyzer disregards sentence such as “hot ice-cream”.
• Discourse Integration − The meaning of any sentence depends upon
the meaning of the sentence just before it. In addition, it also brings
about the meaning of immediately succeeding sentence.
• Pragmatic Analysis − During this, what was said is re-interpreted on
what it actually meant. It involves deriving those aspects of language
which require real world knowledge.
Cont’d
Implementation Aspects of Syntactic Analysis
• There are a number of algorithms researchers have developed for
syntactic analysis, but we consider only the following simple methods
−
• Context-Free Grammar
• Top-Down Parser
Let us see them in detail −
Context-Free Grammar
• It is the grammar that consists rules with a single symbol on the left-hand
side of the rewrite rules. Let us create grammar to parse a sentence − “The
bird pecks the grains”
Articles (DET) − a | an | the
Nouns − bird | birds | grain | grains
Noun Phrase (NP) − Article + Noun | Article + Adjective + Noun
= DET N | DET ADJ N
Verbs − pecks | pecking | pecked
Verb Phrase (VP) − NP V | V NP
Adjectives (ADJ) − beautiful | small | chirping
Cont’d
• The parse tree breaks down the sentence into structured parts so that
the computer can easily understand and process it. In order for the
parsing algorithm to construct this parse tree, a set of rewrite rules,
which describe what tree structures are legal, need to be constructed.
• These rules say that a certain symbol may be expanded in the tree by
a sequence of other symbols. According to first order logic rule, if
there are two strings Noun Phrase (NP) and Verb Phrase (VP), then
the string combined by NP followed by VP is a sentence.
• The rewrite rules for the sentence are as follows −
Cont’d
S → NP VP
NP → DET N | DET ADJ N
VP → V NP
Lexocon −
DET → a | the
ADJ → beautiful | perching
N → bird | birds | grain | grains
V → peck | pecks | pecking
Cont’d
• The parse tree can be created as shown −
Cont’d
• Now consider the above rewrite rules. Since V can be replaced by
both, "peck" or "pecks", sentences such as "The bird peck the
grains" with wrong subject-verb agreement are also permitted.
• Merit − The simplest style of grammar, therefore widely used one.
Cont’d
• Demerits
• They are not highly precise. For example, “The grains peck the bird”,
is a syntactically correct according to parser, but even if it makes no
sense, parser takes it as a correct sentence.
• To bring out high precision, multiple sets of grammar need to be
prepared. It may require a completely different sets of rules for
parsing singular and plural variations, passive sentences, etc., which
can lead to creation of huge set of rules that are unmanageable.
Top-Down Parser
• Here, the parser starts with the S symbol and attempts to rewrite it
into a sequence of terminal symbols that matches the classes of the
words in the input sentence until it consists entirely of terminal
symbols.
• These are then checked with the input sentence to see if it matched.
If not, the process is started over again with a different set of rules.
This is repeated until a specific rule is found which describes the
structure of the sentence.
Cont’d
Merit
• It is simple to implement.
Demerits
• It is inefficient, as the search process has to be repeated if an error
occurs.
• Slow speed of working.
Thank You

More Related Content

PPTX
Sanskrit in Natural Language Processing
Hitesh Joshi
 
PDF
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Guy De Pauw
 
PDF
DESIGN OF A RULE BASED HINDI LEMMATIZER
csandit
 
PDF
Design of a rule based hindi lemmatizer
csandit
 
PDF
Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Saurabh Kaushik
 
PDF
Pxc3898474
Sivajyothi Chandra
 
PPTX
Poggi analytics - ebl - 1
Gaston Liberman
 
PDF
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Saurabh Kaushik
 
Sanskrit in Natural Language Processing
Hitesh Joshi
 
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Guy De Pauw
 
DESIGN OF A RULE BASED HINDI LEMMATIZER
csandit
 
Design of a rule based hindi lemmatizer
csandit
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 1
Saurabh Kaushik
 
Pxc3898474
Sivajyothi Chandra
 
Poggi analytics - ebl - 1
Gaston Liberman
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Saurabh Kaushik
 

What's hot (20)

PPTX
Reasoning in AI
Gunjan Chhabra
 
PPTX
A Simple Explanation of XLNet
Domyoung Lee
 
PPTX
Natural Language Processing
Sagacious IT Solution
 
PPTX
Semi supervised approach for word sense disambiguation
kokanechandrakant
 
PDF
Roee Aharoni - 2017 - Towards String-to-Tree Neural Machine Translation
Association for Computational Linguistics
 
PDF
Comparative study of Text-to-Speech Synthesis for Indian Languages by using S...
ravi sharma
 
PDF
Statistically-Enhanced New Word Identification
Andi Wu
 
PPTX
Eskm20140903
Shuhei Otani
 
PDF
Paper id 25201466
IJRAT
 
PDF
NLP Bootcamp 2018 : Representation Learning of text for NLP
Anuj Gupta
 
PDF
Anaphora resolution in hindi language using gazetteer method
ijcsa
 
DOCX
Langauage model
c sharada
 
PPTX
NLP Bootcamp
Anuj Gupta
 
PDF
Comparative performance analysis of two anaphora resolution systems
ijfcstjournal
 
PDF
ANALYSIS OF MWES IN HINDI TEXT USING NLTK
ijnlc
 
PPTX
summarization-oct12.pptx
Basha Chand
 
PDF
Anthiil Inside workshop on NLP
Satyam Saxena
 
PPT
PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
University Politehnica Bucharest
 
PPS
Extraction of Socio-Semantic Data from Chat Conversations in Collaborative Le...
Traian Rebedea
 
PDF
A Self-Supervised Tibetan-Chinese Vocabulary Alignment Method
dannyijwest
 
Reasoning in AI
Gunjan Chhabra
 
A Simple Explanation of XLNet
Domyoung Lee
 
Natural Language Processing
Sagacious IT Solution
 
Semi supervised approach for word sense disambiguation
kokanechandrakant
 
Roee Aharoni - 2017 - Towards String-to-Tree Neural Machine Translation
Association for Computational Linguistics
 
Comparative study of Text-to-Speech Synthesis for Indian Languages by using S...
ravi sharma
 
Statistically-Enhanced New Word Identification
Andi Wu
 
Eskm20140903
Shuhei Otani
 
Paper id 25201466
IJRAT
 
NLP Bootcamp 2018 : Representation Learning of text for NLP
Anuj Gupta
 
Anaphora resolution in hindi language using gazetteer method
ijcsa
 
Langauage model
c sharada
 
NLP Bootcamp
Anuj Gupta
 
Comparative performance analysis of two anaphora resolution systems
ijfcstjournal
 
ANALYSIS OF MWES IN HINDI TEXT USING NLTK
ijnlc
 
summarization-oct12.pptx
Basha Chand
 
Anthiil Inside workshop on NLP
Satyam Saxena
 
PhD Thesis - Influence of Repetitions on Discourse and Semantic Analysis
University Politehnica Bucharest
 
Extraction of Socio-Semantic Data from Chat Conversations in Collaborative Le...
Traian Rebedea
 
A Self-Supervised Tibetan-Chinese Vocabulary Alignment Method
dannyijwest
 
Ad

Similar to https://www.slideshare.net/amaresimachew/hot-topics-132093738 (20)

PPTX
Natural Language Processing (NLP)
Abdullah al Mamun
 
PPTX
naturallanguageprocessingnlp-231215172843-839c05ab.pptx
baocongle204
 
PDF
Natural Language Processing Course in AI
SATHYANARAYANAKB
 
PPTX
Artificial Intelligence Notes Unit 4
DigiGurukul
 
PPTX
Natural Language Processing
Rishikese MR
 
PPTX
NLP Introduction and basics of natural language processing
mailtoahmedhassan
 
PDF
Natural Language Processing basics presentation
PREETHIRRA2011003040
 
PPT
6 KBS_ES.ppt
MikialeTesfamariam
 
PPTX
Dhdhddhd5. Syntactic analysis-Parsing.pptx
NehanTanwar1
 
PPTX
5. Syntacticfffgffg analysis-Parsing.pptx
NehanTanwar1
 
PDF
Natural language processing (nlp)
Kuppusamy P
 
PPTX
Natural Language Processing (NLP).pptx
SHIBDASDUTTA
 
PPTX
Unit 1 Natural Language Procerssing.pptx
sriramrpselvam
 
PPTX
natural language processing help at myassignmenthelp.net
www.myassignmenthelp.net
 
PPTX
Deep Learning and Modern Natural Language Processing (AnacondaCon2019)
Zachary S. Brown
 
PPTX
Teaching Reading Skills
abeer al najjar
 
PPTX
operating system notes for II year IV semester students
MsPKaviyaCSE
 
PDF
4.3.pdf
UjjwalKumarSingh23
 
PPTX
Natural Language Processing
Varunjeet Singh Rekhi
 
Natural Language Processing (NLP)
Abdullah al Mamun
 
naturallanguageprocessingnlp-231215172843-839c05ab.pptx
baocongle204
 
Natural Language Processing Course in AI
SATHYANARAYANAKB
 
Artificial Intelligence Notes Unit 4
DigiGurukul
 
Natural Language Processing
Rishikese MR
 
NLP Introduction and basics of natural language processing
mailtoahmedhassan
 
Natural Language Processing basics presentation
PREETHIRRA2011003040
 
6 KBS_ES.ppt
MikialeTesfamariam
 
Dhdhddhd5. Syntactic analysis-Parsing.pptx
NehanTanwar1
 
5. Syntacticfffgffg analysis-Parsing.pptx
NehanTanwar1
 
Natural language processing (nlp)
Kuppusamy P
 
Natural Language Processing (NLP).pptx
SHIBDASDUTTA
 
Unit 1 Natural Language Procerssing.pptx
sriramrpselvam
 
natural language processing help at myassignmenthelp.net
www.myassignmenthelp.net
 
Deep Learning and Modern Natural Language Processing (AnacondaCon2019)
Zachary S. Brown
 
Teaching Reading Skills
abeer al najjar
 
operating system notes for II year IV semester students
MsPKaviyaCSE
 
Natural Language Processing
Varunjeet Singh Rekhi
 
Ad

Recently uploaded (20)

PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PDF
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
PDF
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
PDF
Introducing Procurement and Supply L2M1.pdf
labyankof
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Skill Development Program For Physiotherapy Students by SRY.pptx
Prof.Dr.Y.SHANTHOSHRAJA MPT Orthopedic., MSc Microbiology
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
Understanding operators in c language.pptx
auteharshil95
 
Introducing Procurement and Supply L2M1.pdf
labyankof
 

https://www.slideshare.net/amaresimachew/hot-topics-132093738

  • 1. Chapter Five Learning, Communicating, Perceiving, and Acting
  • 2. 5.1 Learning • Definition: “learning is a goal-directed process of a system that improves the knowledge or the knowledge representation of the system by exploring experience and prior knowledge” acquisition of new declarative knowledge Development of motor and cognitive skills through instruction and practice. Organization of new knowledge into general effective representation. discovery of new facts and theories through observation and experimentation
  • 3. Learning from Examples/Observation • Observational Learning: To learn by watching and imitating others. For example, child tries to learn by mimicking her parent. Knowledge in Learning • Supervised Learning: It involves a teacher that is scholar than the ANN itself. For example, the teacher feeds some example data about which the teacher already knows the answers. For example, pattern recognizing. The ANN comes up with guesses while recognizing. Then the teacher provides the ANN with the answers. The network then compares it guesses with the teacher’s “correct” answers and makes adjustments according to errors. • For supervised learning, the aim is to find a simple hypothesis approximately consistent with training examples
  • 4. Cont’d • Unsupervised Learning: It is required when there is no example data set with known answers. For example, searching for a hidden pattern. In this case, clustering i.e. dividing a set of elements into groups according to some unknown pattern is carried out based on the existing data sets present. • Reinforcement Learning: This strategy built on observation. The ANN makes a decision by observing its environment. If the observation is negative, the network adjusts its weights to be able to make a different required decision the next time.
  • 5. Learning Probabilistic Models • A deterministic mathematical model is meant to yield a single solution describing the outcome of some "experiment" given appropriate inputs. A probabilistic model is, instead, meant to give a distribution of possible outcomes (i.e. it describes all outcomes and gives some measure of how likely each is to occur) Neural Networks • An Artificial Neural Network (ANN) is an information processing paradigm that is inspired by the way biological nervous systems, such as the brain, process information. The key element of this paradigm is the novel structure of the information processing system.
  • 6. Cont’d • A neural network is composed of a number of nodes, or units, connected by links. • Each link has a numeric weight associated with it. • Weights are the primary means of long-term storage in neural networks, and learning usually takes place by updating the weights.
  • 7. 5.2 Communicating, Perceiving, and Acting • Natural Language Processing (NLP) refers to AI method of communicating with an intelligent systems using a natural language such as English. • Processing of Natural Language is required when you want an intelligent system like robot to perform as per your instructions, when you want to hear decision from a dialogue based clinical expert system, etc. • The field of NLP involves making computers to perform useful tasks with the natural languages humans use. The input and output of an NLP system can be − Speech Written Text
  • 8. Components of NLP There are two components of NLP as given Natural Language Understanding (NLU) • Understanding involves the following tasks − Mapping the given input in natural language into useful representations. Analyzing different aspects of the language. Natural Language Generation (NLG) • It is the process of producing meaningful phrases and sentences in the form of natural language from some internal representation.
  • 9. Cont’d • It involves − • Text planning − It includes retrieving the relevant content from knowledge base. • Sentence planning − It includes choosing required words, forming meaningful phrases, setting tone of the sentence. • Text Realization − It is mapping sentence plan into sentence structure. • The NLU is harder than NLG.
  • 10. Difficulties in NLU • NL has an extremely rich form and structure. • It is very ambiguous. There can be different levels of ambiguity − Lexical ambiguity − It is at very primitive level such as word-level. • For example, treating the word “board” as noun or verb? Syntax Level ambiguity − A sentence can be parsed in different ways. • For example, “He lifted the beetle with red cap.” − Did he use cap to lift the beetle or he lifted a beetle that had red cap? Referential ambiguity − Referring to something using pronouns. • For example, Rima went to Gauri. She said, “I am tired.” − Exactly who is tired? • One input can mean different meanings. • Many inputs can mean the same thing.
  • 11. NLP Terminology • Phonology − It is study of organizing sound systematically. • Morphology − It is a study of construction of words from primitive meaningful units. • Morpheme − It is primitive unit of meaning in a language. • Syntax − It refers to arranging words to make a sentence. It also involves determining the structural role of words in the sentence and in phrases. • Semantics − It is concerned with the meaning of words and how to combine words into meaningful phrases and sentences. • Pragmatics − It deals with using and understanding sentences in different situations and how the interpretation of the sentence is affected. • Discourse − It deals with how the immediately preceding sentence can affect the interpretation of the next sentence. • World Knowledge − It includes the general knowledge about the world.
  • 12. Steps in NLP • There are general five steps − • Lexical Analysis − It involves identifying and analyzing the structure of words. Lexicon of a language means the collection of words and phrases in a language. Lexical analysis is dividing the whole chunk of txt into paragraphs, sentences, and words. • Syntactic Analysis (Parsing) − It involves analysis of words in the sentence for grammar and arranging words in a manner that shows the relationship among the words. The sentence such as “The school goes to boy” is rejected by English syntactic analyzer.
  • 13. Cont’d • Semantic Analysis − It draws the exact meaning or the dictionary meaning from the text. The text is checked for meaningfulness. It is done by mapping syntactic structures and objects in the task domain. The semantic analyzer disregards sentence such as “hot ice-cream”. • Discourse Integration − The meaning of any sentence depends upon the meaning of the sentence just before it. In addition, it also brings about the meaning of immediately succeeding sentence. • Pragmatic Analysis − During this, what was said is re-interpreted on what it actually meant. It involves deriving those aspects of language which require real world knowledge.
  • 15. Implementation Aspects of Syntactic Analysis • There are a number of algorithms researchers have developed for syntactic analysis, but we consider only the following simple methods − • Context-Free Grammar • Top-Down Parser Let us see them in detail −
  • 16. Context-Free Grammar • It is the grammar that consists rules with a single symbol on the left-hand side of the rewrite rules. Let us create grammar to parse a sentence − “The bird pecks the grains” Articles (DET) − a | an | the Nouns − bird | birds | grain | grains Noun Phrase (NP) − Article + Noun | Article + Adjective + Noun = DET N | DET ADJ N Verbs − pecks | pecking | pecked Verb Phrase (VP) − NP V | V NP Adjectives (ADJ) − beautiful | small | chirping
  • 17. Cont’d • The parse tree breaks down the sentence into structured parts so that the computer can easily understand and process it. In order for the parsing algorithm to construct this parse tree, a set of rewrite rules, which describe what tree structures are legal, need to be constructed. • These rules say that a certain symbol may be expanded in the tree by a sequence of other symbols. According to first order logic rule, if there are two strings Noun Phrase (NP) and Verb Phrase (VP), then the string combined by NP followed by VP is a sentence. • The rewrite rules for the sentence are as follows −
  • 18. Cont’d S → NP VP NP → DET N | DET ADJ N VP → V NP Lexocon − DET → a | the ADJ → beautiful | perching N → bird | birds | grain | grains V → peck | pecks | pecking
  • 19. Cont’d • The parse tree can be created as shown −
  • 20. Cont’d • Now consider the above rewrite rules. Since V can be replaced by both, "peck" or "pecks", sentences such as "The bird peck the grains" with wrong subject-verb agreement are also permitted. • Merit − The simplest style of grammar, therefore widely used one.
  • 21. Cont’d • Demerits • They are not highly precise. For example, “The grains peck the bird”, is a syntactically correct according to parser, but even if it makes no sense, parser takes it as a correct sentence. • To bring out high precision, multiple sets of grammar need to be prepared. It may require a completely different sets of rules for parsing singular and plural variations, passive sentences, etc., which can lead to creation of huge set of rules that are unmanageable.
  • 22. Top-Down Parser • Here, the parser starts with the S symbol and attempts to rewrite it into a sequence of terminal symbols that matches the classes of the words in the input sentence until it consists entirely of terminal symbols. • These are then checked with the input sentence to see if it matched. If not, the process is started over again with a different set of rules. This is repeated until a specific rule is found which describes the structure of the sentence.
  • 23. Cont’d Merit • It is simple to implement. Demerits • It is inefficient, as the search process has to be repeated if an error occurs. • Slow speed of working.