SlideShare a Scribd company logo
Grammar Rules for English
 Grammar is defined as the rules for
forming well-structured sentences.
 Grammar also plays an essential role in
describing the syntactic structure of well-
formed programs, like denoting the
syntactical rules used for conversation in
natural languages.
 Mathematically, a grammar G can be written
as a 4-tuple (N, T, S, P) where:
◦ N orVN = set of non-terminal symbols or
variables.
◦ T or ∑ = set of terminal symbols.
◦ S = Start symbol where S N
∈
◦ P = Production rules for Terminals as well as Non-
terminals.
◦ It has the form α→βα→β, where and are
α β
strings on VN ∑
∪ VN ∑, and at least one symbol
∪
of belongs toVN
α
Components of Syntax
 Syntax also refers to the way words are arranged together.
 Constituency: Groups of words may behave as a single unit or phrase - A
constituent, for example, like a Noun phrase.
 Grammatical relations: These are the formalization of ideas from
traditional grammar. Examples include - subjects and objects.
 Subcategorization and dependency relations: These are the relations
between words and phrases, for example, aVerb followed by an infinitive
verb.
 Regular languages and part of speech: Refers to the way words are
arranged together but cannot support easily.
Examples are Constituency, Grammatical relations, and Subcategorization and
dependency relations.
 Syntactic categories and their common denotations in NLP: np -
noun phrase, vp - verb phrase, s - sentence, det - determiner (article), n -
noun, tv - transitive verb (takes an object), iv - intransitive verb, prep -
preposition, pp - prepositional phrase, adj - adjective
Types of Grammars
 Context Free Grammar
 Constituency Grammar (CG)
 Dependency Grammar (DG)
Context-free grammar
 Context-free grammar consists of a set of rules expressing how symbols of the
language can be grouped and ordered together and a lexicon of words and symbols.
 CFG consists of a finite set of grammar rules having the following four components
 Set of Non-terminals: It is represented byV.The non-terminals are syntactic
variables that denote the sets of strings, which helps in defining the language that is
generated with the help of grammar.
 Set ofTerminals: It is also known as tokens and represented by . Strings are
Σ
formed with the help of the basic symbols of terminals.
 Set of Productions: It is represented by P.The set gives an idea about how the
terminals and nonterminals can be combined. Every production consists of the
following components:Non-terminals,Arrow,Terminals (the sequence of terminals).
 The left side of production is called non-terminals while the right side of production
is called terminals.
 Start Symbol: The production begins from the start symbol. It is represented by
symbol S. Non-terminal symbols are always designated as start symbols.
Constituency Grammar
 It is also known as Phrase structure
grammar. Furthermore, it is called
constituency Grammar as it is based on
the constituency relation. It is the
opposite of dependency grammar.
 The constituents can be any word, group of words
or phrases in Constituency Grammar.The goal of
constituency grammar is to organize any sentence
into its constituents using their properties.
 Characteristic properties of constituency
grammar and constituency relation:
◦ All the related frameworks view the sentence structure
in terms of constituency relation.
◦ To derive the constituency relation, we take the help of
subject-predicate division of Latin as well as Greek
grammar.
◦ In constituency grammar, we study the clause structure
in terms of noun phrase NP and verb phraseVP.
 For Example, constituency grammar can organize any sentence into
its three constituents- a subject, a context, and an object.
 Sentence: <subject> <context> <
 <subject>The horses /The dogs /They
 <context> are running / are barking / are eating
 <object> in the park / happily / since the morning
Dependency Grammar
 Dependency Grammar states that words of a sentence are
dependent upon other words of the sentence.These Words
are connected by directed links in dependency grammar.The
verb is considered the center of the clause structure.
 Dependency Grammar organizes the words of a sentence
according to their dependencies. Every other syntactic unit is
connected to the verb in terms of a directed link. These
syntactic units are called dependencies.
◦ One of the words in a sentence behaves as a root, and all the
other words except that word itself are linked directly or
indirectly with the root using their dependencies.
◦ These dependencies represent relationships among the words in a
sentence, and dependency grammar is used to infer the structure
and semantic dependencies between the words.
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Step 6: Dependency parsing
Next comes dependency parsing which is mainly used to find out how all the
words in a sentence are related to each other.To find the dependency, we can
build a tree and assign a single word as a parent word.The main verb in the
sentence will act as the root node.
The edges in a dependency tree represent grammatical relationships.
These relationships define words’ roles in a sentence, such as subject,
object, modifier, or adverbial.
Subject-Verb Relationship: In a sentence
like “She sings,” the word “She” depends
on “sings” as the subject of the verb.
Modifier-Head Relationship:
In the sentence “The big cat,” “big” modifies
“cat,” creating a modifier-head relationship.
Direct Object-Verb Relationship:
In “She eats apples,” “apples” is the direct
object that depends on the verb “eats.”
Adverbial-Verb Relationship:
In “He sings well,” “well” modifies the
verb “sings” and forms an adverbial-verb
relationship.
DependencyTag Description
acl
clausal modifier of a noun
(adnominal clause)
acl:relcl relative clause modifier
advcl adverbial clause modifier
advmod adverbial modifier
advmod:emph emphasizing phrase, intensifier
advmod:lmod locative adverbial modifier
amod adjectival modifier
appos appositional modifier
aux auxiliary
aux:move passive auxiliary
case case-marking
cc coordinating conjunction
cc:preconj preconjunct
ccomp clausal complement
clf classifier
compound compound
conj conjunct
cop copula
csubj clausal topic
csubj:move clausal passive topic
dep unspecified dependency
det determiner
det:numgov рrоnоminаl quаntifier gоverning the саse оf the nоun
det:nummod r n min l qu ntifier agreeing with the se f the n un
р о о а а са о о
det:poss possessive determiner
discourse discourse ingredient
dislocated dislocated parts
expl expletive
expl:impers impersonal expletive
expl:move reflexive pronoun utilized in reflexive passive
expl:pv reflexive clitic with an inherently reflexive verb
mounted mounted multiword expression
flat flat multiword expression
flat:overseas overseas phrases
flat:title names
goeswith goes with
iobj oblique object
checklist checklist
mark marker
nmod nominal modifier
nmod:poss possessive nominal modifier
nmod:tmod temporal modifier
Grammar rules in English, Dependency Parsing, Shallow parsing
Shallow parsing
 It is also known as chunking, is a type of natural
language processing (NLP) technique that aims to
identify and extract meaningful phrases or chunks from
a sentence.
 Unlike full parsing, which involves analyzing the
grammatical structure of a sentence, shallow parsing
focuses on identifying individual phrases or constituents,
such as noun phrases, verb phrases, and prepositional
phrases.
 Shallow parsing is an essential component of many NLP
tasks, including information extraction, text
classification, and sentiment analysis.
 Full parsing involves analyzing the entire grammatical
structure of a sentence, which can be computationally
intensive and time-consuming.
 Shallow parsing, on the other hand, involves identifying
and extracting only the most important phrases or
constituents, making it faster and more efficient than full
parsing.
 This makes shallow parsing particularly useful for
applications that require processing large volumes of
text, such as web crawling, document indexing, and
machine translation.
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Grammar rules in English, Dependency Parsing, Shallow parsing
Ad

Recommended

Factors Involved in Reading and Writing Difficulties Ch. 2
Factors Involved in Reading and Writing Difficulties Ch. 2
Miami-Dade County Public Schools
 
Teaching Vocabulary[1]
Teaching Vocabulary[1]
Mar Mendoza
 
ELL Strategies and Activities Presentation.pptx
ELL Strategies and Activities Presentation.pptx
Julius284141
 
Writing workshop presentation
Writing workshop presentation
mrsgrysko
 
Teach vocabulary
Teach vocabulary
Vanne Lili
 
Spelling
Spelling
Khaleel Al Bataineh
 
Nivea case study mm - 1
Nivea case study mm - 1
HDFC Bank Limited
 
Developmental reading 1.4
Developmental reading 1.4
Jovy Elimanao - Mihm
 
ESL Strategies for Content Area Teachers
ESL Strategies for Content Area Teachers
LaConti Bryant, M.Ed, Ed.S
 
The importance of reading on teaching and learning
The importance of reading on teaching and learning
Thao Le
 
Materials for developing reading_present by Zahra Farajnezhad
Materials for developing reading_present by Zahra Farajnezhad
Islamic Azad University, Najafabad Branch
 
Reading as a Cognitive Process
Reading as a Cognitive Process
Pauwee Ticong
 
Summary:The Common European Framework of Reference for Language
Summary:The Common European Framework of Reference for Language
JrPanaifo
 
language testing
language testing
desva ariasanti
 
Teaching Reading Power Point
Teaching Reading Power Point
Margaret Vass
 
Fluency vs. accuracy
Fluency vs. accuracy
Marinazx
 
Three Reading Models
Three Reading Models
Antonette A.
 
Tefl - content based instruction
Tefl - content based instruction
Ardyka Irvan Prastama
 
Stages of Beginning Reading
Stages of Beginning Reading
Ghen Celis
 
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
Mohammed Mallah
 
Syntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence Structure
Lalala351579
 
Grammar Syntax(1).pptx
Grammar Syntax(1).pptx
SistemadeEstudiosMed
 
NLP-my-lecture (3).ppt
NLP-my-lecture (3).ppt
KrishnaGupta717939
 
unit -3 part 1.ppt
unit -3 part 1.ppt
LSURYAPRAKASHREDDY
 
7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax
Tikaram Poudel
 
SETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGING
kevig
 
Applied Linguistics "Grammar"
Applied Linguistics "Grammar"
Kum Visal
 
Principles of parameters
Principles of parameters
Velnar
 
NLP topic CHAPTER 2_word level analysis.pptx
NLP topic CHAPTER 2_word level analysis.pptx
mohdumaira1
 
05 linguistic theory meets lexicography
05 linguistic theory meets lexicography
Duygu Aşıklar
 

More Related Content

What's hot (12)

ESL Strategies for Content Area Teachers
ESL Strategies for Content Area Teachers
LaConti Bryant, M.Ed, Ed.S
 
The importance of reading on teaching and learning
The importance of reading on teaching and learning
Thao Le
 
Materials for developing reading_present by Zahra Farajnezhad
Materials for developing reading_present by Zahra Farajnezhad
Islamic Azad University, Najafabad Branch
 
Reading as a Cognitive Process
Reading as a Cognitive Process
Pauwee Ticong
 
Summary:The Common European Framework of Reference for Language
Summary:The Common European Framework of Reference for Language
JrPanaifo
 
language testing
language testing
desva ariasanti
 
Teaching Reading Power Point
Teaching Reading Power Point
Margaret Vass
 
Fluency vs. accuracy
Fluency vs. accuracy
Marinazx
 
Three Reading Models
Three Reading Models
Antonette A.
 
Tefl - content based instruction
Tefl - content based instruction
Ardyka Irvan Prastama
 
Stages of Beginning Reading
Stages of Beginning Reading
Ghen Celis
 
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
Mohammed Mallah
 
The importance of reading on teaching and learning
The importance of reading on teaching and learning
Thao Le
 
Reading as a Cognitive Process
Reading as a Cognitive Process
Pauwee Ticong
 
Summary:The Common European Framework of Reference for Language
Summary:The Common European Framework of Reference for Language
JrPanaifo
 
Teaching Reading Power Point
Teaching Reading Power Point
Margaret Vass
 
Fluency vs. accuracy
Fluency vs. accuracy
Marinazx
 
Three Reading Models
Three Reading Models
Antonette A.
 
Stages of Beginning Reading
Stages of Beginning Reading
Ghen Celis
 
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
A lecture about Individual Differences in SLA & SLL (Motivation & Attitude) B...
Mohammed Mallah
 

Similar to Grammar rules in English, Dependency Parsing, Shallow parsing (20)

Syntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence Structure
Lalala351579
 
Grammar Syntax(1).pptx
Grammar Syntax(1).pptx
SistemadeEstudiosMed
 
NLP-my-lecture (3).ppt
NLP-my-lecture (3).ppt
KrishnaGupta717939
 
unit -3 part 1.ppt
unit -3 part 1.ppt
LSURYAPRAKASHREDDY
 
7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax
Tikaram Poudel
 
SETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGING
kevig
 
Applied Linguistics "Grammar"
Applied Linguistics "Grammar"
Kum Visal
 
Principles of parameters
Principles of parameters
Velnar
 
NLP topic CHAPTER 2_word level analysis.pptx
NLP topic CHAPTER 2_word level analysis.pptx
mohdumaira1
 
05 linguistic theory meets lexicography
05 linguistic theory meets lexicography
Duygu Aşıklar
 
NLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for English
Hemantha Kulathilake
 
Chapter 5 meyer maryam noori khorasani
Chapter 5 meyer maryam noori khorasani
arshidanoori
 
SESSION 1, GRAMMAR COMPONENTS 1 TO4.pptx
SESSION 1, GRAMMAR COMPONENTS 1 TO4.pptx
lourdesmartinez428679
 
dependency theory in phonetics and phonology for linguistics
dependency theory in phonetics and phonology for linguistics
TeebaAbdulRazzaq
 
2 Basic Concepts and TerminologyI have to admit, sometimes I ge.docx
2 Basic Concepts and TerminologyI have to admit, sometimes I ge.docx
felicidaddinwoodie
 
Morphology and Word Formation in English
Morphology and Word Formation in English
HiraTariqButt
 
Nlp ambiguity presentation
Nlp ambiguity presentation
Gurram Poorna Prudhvi
 
George Yule_Phrases and sentences grammar.pdf
George Yule_Phrases and sentences grammar.pdf
Najma Asyifa
 
prof vivi
prof vivi
Vlado Petric
 
Principles and parameters of grammar report
Principles and parameters of grammar report
Aubrey Expressionista
 
Syntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence Structure
Lalala351579
 
7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax
Tikaram Poudel
 
SETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGING
kevig
 
Applied Linguistics "Grammar"
Applied Linguistics "Grammar"
Kum Visal
 
Principles of parameters
Principles of parameters
Velnar
 
NLP topic CHAPTER 2_word level analysis.pptx
NLP topic CHAPTER 2_word level analysis.pptx
mohdumaira1
 
05 linguistic theory meets lexicography
05 linguistic theory meets lexicography
Duygu Aşıklar
 
NLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for English
Hemantha Kulathilake
 
Chapter 5 meyer maryam noori khorasani
Chapter 5 meyer maryam noori khorasani
arshidanoori
 
SESSION 1, GRAMMAR COMPONENTS 1 TO4.pptx
SESSION 1, GRAMMAR COMPONENTS 1 TO4.pptx
lourdesmartinez428679
 
dependency theory in phonetics and phonology for linguistics
dependency theory in phonetics and phonology for linguistics
TeebaAbdulRazzaq
 
2 Basic Concepts and TerminologyI have to admit, sometimes I ge.docx
2 Basic Concepts and TerminologyI have to admit, sometimes I ge.docx
felicidaddinwoodie
 
Morphology and Word Formation in English
Morphology and Word Formation in English
HiraTariqButt
 
George Yule_Phrases and sentences grammar.pdf
George Yule_Phrases and sentences grammar.pdf
Najma Asyifa
 
Principles and parameters of grammar report
Principles and parameters of grammar report
Aubrey Expressionista
 
Ad

More from Kirti Verma (20)

WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,
WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,
Kirti Verma
 
Probabilistic parsing, Parsing In NLP ,Context Free grammer
Probabilistic parsing, Parsing In NLP ,Context Free grammer
Kirti Verma
 
feature structure and unification NLP,what is Unification, Feture structure i...
feature structure and unification NLP,what is Unification, Feture structure i...
Kirti Verma
 
Role of Parser Words & Word Groups Parsing in NL, Types of parsing, Parsing A...
Role of Parser Words & Word Groups Parsing in NL, Types of parsing, Parsing A...
Kirti Verma
 
Words _Transducers Finite state transducers in natural language processing
Words _Transducers Finite state transducers in natural language processing
Kirti Verma
 
Regular-expressions in NLP and regular expression with example
Regular-expressions in NLP and regular expression with example
Kirti Verma
 
NLP Introduction , applications, NLP Pipeline, Steps in NLP
NLP Introduction , applications, NLP Pipeline, Steps in NLP
Kirti Verma
 
L-5 BCEProcess management.ppt
L-5 BCEProcess management.ppt
Kirti Verma
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
Kirti Verma
 
L-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.ppt
Kirti Verma
 
L-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.ppt
Kirti Verma
 
BCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.ppt
Kirti Verma
 
BCE L-3 overview of C++.ppt
BCE L-3 overview of C++.ppt
Kirti Verma
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
BCE L-1 Programmimg languages.pptx
BCE L-1 Programmimg languages.pptx
Kirti Verma
 
BCE L-1 networking fundamentals 111.pptx
BCE L-1 networking fundamentals 111.pptx
Kirti Verma
 
BCE L-2 e commerce.pptx
BCE L-2 e commerce.pptx
Kirti Verma
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptx
Kirti Verma
 
L 5 Numpy final learning and Coding
L 5 Numpy final learning and Coding
Kirti Verma
 
L 2 Introduction to Data science
L 2 Introduction to Data science
Kirti Verma
 
WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,
WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,
Kirti Verma
 
Probabilistic parsing, Parsing In NLP ,Context Free grammer
Probabilistic parsing, Parsing In NLP ,Context Free grammer
Kirti Verma
 
feature structure and unification NLP,what is Unification, Feture structure i...
feature structure and unification NLP,what is Unification, Feture structure i...
Kirti Verma
 
Role of Parser Words & Word Groups Parsing in NL, Types of parsing, Parsing A...
Role of Parser Words & Word Groups Parsing in NL, Types of parsing, Parsing A...
Kirti Verma
 
Words _Transducers Finite state transducers in natural language processing
Words _Transducers Finite state transducers in natural language processing
Kirti Verma
 
Regular-expressions in NLP and regular expression with example
Regular-expressions in NLP and regular expression with example
Kirti Verma
 
NLP Introduction , applications, NLP Pipeline, Steps in NLP
NLP Introduction , applications, NLP Pipeline, Steps in NLP
Kirti Verma
 
L-5 BCEProcess management.ppt
L-5 BCEProcess management.ppt
Kirti Verma
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
Kirti Verma
 
L-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.ppt
Kirti Verma
 
L-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.ppt
Kirti Verma
 
BCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.ppt
Kirti Verma
 
BCE L-3 overview of C++.ppt
BCE L-3 overview of C++.ppt
Kirti Verma
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
BCE L-1 Programmimg languages.pptx
BCE L-1 Programmimg languages.pptx
Kirti Verma
 
BCE L-1 networking fundamentals 111.pptx
BCE L-1 networking fundamentals 111.pptx
Kirti Verma
 
BCE L-2 e commerce.pptx
BCE L-2 e commerce.pptx
Kirti Verma
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptx
Kirti Verma
 
L 5 Numpy final learning and Coding
L 5 Numpy final learning and Coding
Kirti Verma
 
L 2 Introduction to Data science
L 2 Introduction to Data science
Kirti Verma
 
Ad

Recently uploaded (20)

AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
 
Unit III_One Dimensional Consolidation theory
Unit III_One Dimensional Consolidation theory
saravananr808639
 
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
Introduction to Python Programming Language
Introduction to Python Programming Language
merlinjohnsy
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
Structured Programming with C++ :: Kjell Backman
Structured Programming with C++ :: Kjell Backman
Shabista Imam
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
 
How to Un-Obsolete Your Legacy Keypad Design
How to Un-Obsolete Your Legacy Keypad Design
Epec Engineered Technologies
 
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
ketan09101
 
machine learning is a advance technology
machine learning is a advance technology
ynancy893
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
 
Introduction to Natural Language Processing - Stages in NLP Pipeline, Challen...
Introduction to Natural Language Processing - Stages in NLP Pipeline, Challen...
resming1
 
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
 
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
 
Fundamentals of Digital Design_Class_12th April.pptx
Fundamentals of Digital Design_Class_12th April.pptx
drdebarshi1993
 
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
 
AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
 
Unit III_One Dimensional Consolidation theory
Unit III_One Dimensional Consolidation theory
saravananr808639
 
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
Introduction to Python Programming Language
Introduction to Python Programming Language
merlinjohnsy
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
Microwatt: Open Tiny Core, Big Possibilities
Microwatt: Open Tiny Core, Big Possibilities
IBM
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
Structured Programming with C++ :: Kjell Backman
Structured Programming with C++ :: Kjell Backman
Shabista Imam
 
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
IPL_Logic_Flow.pdf Mainframe IPLMainframe IPL
KhadijaKhadijaAouadi
 
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
 
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
(Continuous Integration and Continuous Deployment/Delivery) is a fundamental ...
ketan09101
 
machine learning is a advance technology
machine learning is a advance technology
ynancy893
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
 
Introduction to Natural Language Processing - Stages in NLP Pipeline, Challen...
Introduction to Natural Language Processing - Stages in NLP Pipeline, Challen...
resming1
 
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
 
Machine Learning - Classification Algorithms
Machine Learning - Classification Algorithms
resming1
 
Fundamentals of Digital Design_Class_12th April.pptx
Fundamentals of Digital Design_Class_12th April.pptx
drdebarshi1993
 
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
 

Grammar rules in English, Dependency Parsing, Shallow parsing

  • 2.  Grammar is defined as the rules for forming well-structured sentences.  Grammar also plays an essential role in describing the syntactic structure of well- formed programs, like denoting the syntactical rules used for conversation in natural languages.
  • 3.  Mathematically, a grammar G can be written as a 4-tuple (N, T, S, P) where: ◦ N orVN = set of non-terminal symbols or variables. ◦ T or ∑ = set of terminal symbols. ◦ S = Start symbol where S N ∈ ◦ P = Production rules for Terminals as well as Non- terminals. ◦ It has the form α→βα→β, where and are α β strings on VN ∑ ∪ VN ∑, and at least one symbol ∪ of belongs toVN α
  • 4. Components of Syntax  Syntax also refers to the way words are arranged together.  Constituency: Groups of words may behave as a single unit or phrase - A constituent, for example, like a Noun phrase.  Grammatical relations: These are the formalization of ideas from traditional grammar. Examples include - subjects and objects.  Subcategorization and dependency relations: These are the relations between words and phrases, for example, aVerb followed by an infinitive verb.  Regular languages and part of speech: Refers to the way words are arranged together but cannot support easily. Examples are Constituency, Grammatical relations, and Subcategorization and dependency relations.  Syntactic categories and their common denotations in NLP: np - noun phrase, vp - verb phrase, s - sentence, det - determiner (article), n - noun, tv - transitive verb (takes an object), iv - intransitive verb, prep - preposition, pp - prepositional phrase, adj - adjective
  • 5. Types of Grammars  Context Free Grammar  Constituency Grammar (CG)  Dependency Grammar (DG)
  • 6. Context-free grammar  Context-free grammar consists of a set of rules expressing how symbols of the language can be grouped and ordered together and a lexicon of words and symbols.  CFG consists of a finite set of grammar rules having the following four components  Set of Non-terminals: It is represented byV.The non-terminals are syntactic variables that denote the sets of strings, which helps in defining the language that is generated with the help of grammar.  Set ofTerminals: It is also known as tokens and represented by . Strings are Σ formed with the help of the basic symbols of terminals.  Set of Productions: It is represented by P.The set gives an idea about how the terminals and nonterminals can be combined. Every production consists of the following components:Non-terminals,Arrow,Terminals (the sequence of terminals).  The left side of production is called non-terminals while the right side of production is called terminals.  Start Symbol: The production begins from the start symbol. It is represented by symbol S. Non-terminal symbols are always designated as start symbols.
  • 7. Constituency Grammar  It is also known as Phrase structure grammar. Furthermore, it is called constituency Grammar as it is based on the constituency relation. It is the opposite of dependency grammar.
  • 8.  The constituents can be any word, group of words or phrases in Constituency Grammar.The goal of constituency grammar is to organize any sentence into its constituents using their properties.  Characteristic properties of constituency grammar and constituency relation: ◦ All the related frameworks view the sentence structure in terms of constituency relation. ◦ To derive the constituency relation, we take the help of subject-predicate division of Latin as well as Greek grammar. ◦ In constituency grammar, we study the clause structure in terms of noun phrase NP and verb phraseVP.
  • 9.  For Example, constituency grammar can organize any sentence into its three constituents- a subject, a context, and an object.  Sentence: <subject> <context> <  <subject>The horses /The dogs /They  <context> are running / are barking / are eating  <object> in the park / happily / since the morning
  • 10. Dependency Grammar  Dependency Grammar states that words of a sentence are dependent upon other words of the sentence.These Words are connected by directed links in dependency grammar.The verb is considered the center of the clause structure.  Dependency Grammar organizes the words of a sentence according to their dependencies. Every other syntactic unit is connected to the verb in terms of a directed link. These syntactic units are called dependencies. ◦ One of the words in a sentence behaves as a root, and all the other words except that word itself are linked directly or indirectly with the root using their dependencies. ◦ These dependencies represent relationships among the words in a sentence, and dependency grammar is used to infer the structure and semantic dependencies between the words.
  • 14. Step 6: Dependency parsing Next comes dependency parsing which is mainly used to find out how all the words in a sentence are related to each other.To find the dependency, we can build a tree and assign a single word as a parent word.The main verb in the sentence will act as the root node. The edges in a dependency tree represent grammatical relationships. These relationships define words’ roles in a sentence, such as subject, object, modifier, or adverbial. Subject-Verb Relationship: In a sentence like “She sings,” the word “She” depends on “sings” as the subject of the verb.
  • 15. Modifier-Head Relationship: In the sentence “The big cat,” “big” modifies “cat,” creating a modifier-head relationship. Direct Object-Verb Relationship: In “She eats apples,” “apples” is the direct object that depends on the verb “eats.” Adverbial-Verb Relationship: In “He sings well,” “well” modifies the verb “sings” and forms an adverbial-verb relationship.
  • 16. DependencyTag Description acl clausal modifier of a noun (adnominal clause) acl:relcl relative clause modifier advcl adverbial clause modifier advmod adverbial modifier advmod:emph emphasizing phrase, intensifier advmod:lmod locative adverbial modifier amod adjectival modifier appos appositional modifier aux auxiliary aux:move passive auxiliary case case-marking cc coordinating conjunction cc:preconj preconjunct ccomp clausal complement clf classifier compound compound conj conjunct cop copula csubj clausal topic csubj:move clausal passive topic dep unspecified dependency det determiner det:numgov рrоnоminаl quаntifier gоverning the саse оf the nоun det:nummod r n min l qu ntifier agreeing with the se f the n un р о о а а са о о det:poss possessive determiner discourse discourse ingredient dislocated dislocated parts expl expletive expl:impers impersonal expletive expl:move reflexive pronoun utilized in reflexive passive expl:pv reflexive clitic with an inherently reflexive verb mounted mounted multiword expression flat flat multiword expression flat:overseas overseas phrases flat:title names goeswith goes with iobj oblique object checklist checklist mark marker nmod nominal modifier nmod:poss possessive nominal modifier nmod:tmod temporal modifier
  • 18. Shallow parsing  It is also known as chunking, is a type of natural language processing (NLP) technique that aims to identify and extract meaningful phrases or chunks from a sentence.  Unlike full parsing, which involves analyzing the grammatical structure of a sentence, shallow parsing focuses on identifying individual phrases or constituents, such as noun phrases, verb phrases, and prepositional phrases.  Shallow parsing is an essential component of many NLP tasks, including information extraction, text classification, and sentiment analysis.
  • 19.  Full parsing involves analyzing the entire grammatical structure of a sentence, which can be computationally intensive and time-consuming.  Shallow parsing, on the other hand, involves identifying and extracting only the most important phrases or constituents, making it faster and more efficient than full parsing.  This makes shallow parsing particularly useful for applications that require processing large volumes of text, such as web crawling, document indexing, and machine translation.