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

More Related Content

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

Syntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence StructureSyntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence Structure
Lalala351579
 
Grammar Syntax(1).pptx
Grammar Syntax(1).pptxGrammar Syntax(1).pptx
Grammar Syntax(1).pptx
SistemadeEstudiosMed
 
NLP-my-lecture (3).ppt
NLP-my-lecture (3).pptNLP-my-lecture (3).ppt
NLP-my-lecture (3).ppt
KrishnaGupta717939
 
unit -3 part 1.ppt
unit -3 part 1.pptunit -3 part 1.ppt
unit -3 part 1.ppt
LSURYAPRAKASHREDDY
 
7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax
Tikaram Poudel
 
SETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGINGSETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGING
kevig
 
Applied Linguistics "Grammar"
Applied Linguistics "Grammar"Applied Linguistics "Grammar"
Applied Linguistics "Grammar"
Kum Visal
 
Principles of parameters
Principles of parametersPrinciples of parameters
Principles of parameters
Velnar
 
NLP topic CHAPTER 2_word level analysis.pptx
NLP topic CHAPTER 2_word level analysis.pptxNLP 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 lexicography05 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 EnglishNLP_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 khorasaniChapter 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.pptxSESSION 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 linguisticsdependency 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.docx2 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 EnglishMorphology and Word Formation in English
Morphology and Word Formation in English
HiraTariqButt
 
Nlp ambiguity presentation
Nlp ambiguity presentationNlp ambiguity presentation
Nlp ambiguity presentation
Gurram Poorna Prudhvi
 
George Yule_Phrases and sentences grammar.pdf
George Yule_Phrases and sentences  grammar.pdfGeorge Yule_Phrases and sentences  grammar.pdf
George Yule_Phrases and sentences grammar.pdf
Najma Asyifa
 
prof vivi
prof viviprof vivi
prof vivi
Vlado Petric
 
Principles and parameters of grammar report
Principles and parameters of grammar reportPrinciples and parameters of grammar report
Principles and parameters of grammar report
Aubrey Expressionista
 
Syntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence StructureSyntax: The Analysis of Sentence Structure
Syntax: The Analysis of Sentence Structure
Lalala351579
 
7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax7. ku gr.sem 2013: Syntax
7. ku gr.sem 2013: Syntax
Tikaram Poudel
 
SETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGINGSETSWANA PART OF SPEECH TAGGING
SETSWANA PART OF SPEECH TAGGING
kevig
 
Applied Linguistics "Grammar"
Applied Linguistics "Grammar"Applied Linguistics "Grammar"
Applied Linguistics "Grammar"
Kum Visal
 
Principles of parameters
Principles of parametersPrinciples of parameters
Principles of parameters
Velnar
 
NLP topic CHAPTER 2_word level analysis.pptx
NLP topic CHAPTER 2_word level analysis.pptxNLP 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 lexicography05 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 EnglishNLP_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 khorasaniChapter 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.pptxSESSION 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 linguisticsdependency 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.docx2 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 EnglishMorphology 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.pdfGeorge 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 reportPrinciples and parameters of grammar report
Principles and parameters of grammar report
Aubrey Expressionista
 

More from Kirti Verma (20)

WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,
WORD SENSE DISAMIGUITION, methods to resolve WSD, wordnet,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 grammerProbabilistic 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...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...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 processingWords _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 exampleRegular-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 NLPNLP 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.pptL-5 BCEProcess management.ppt
L-5 BCEProcess management.ppt
Kirti Verma
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-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.pptL-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.pptL-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++.pptBCE 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++.pptBCE 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.pptBCE 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.pptxBCE 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.pptxBCE 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.pptxBCE L-2 e commerce.pptx
BCE L-2 e commerce.pptx
Kirti Verma
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptxBCE 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 CodingL 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 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,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 grammerProbabilistic 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...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...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 processingWords _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 exampleRegular-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 NLPNLP 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.pptL-5 BCEProcess management.ppt
L-5 BCEProcess management.ppt
Kirti Verma
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-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.pptL-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.pptL-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++.pptBCE 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++.pptBCE 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.pptBCE 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.pptxBCE 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.pptxBCE 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.pptxBCE L-2 e commerce.pptx
BCE L-2 e commerce.pptx
Kirti Verma
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptxBCE 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 CodingL 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 L 2 Introduction to Data science
L 2 Introduction to Data science
Kirti Verma
 
Ad

Recently uploaded (20)

Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Personal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.pptPersonal Protective Efsgfgsffquipment.ppt
Personal Protective Efsgfgsffquipment.ppt
ganjangbegu579
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink DisplayHow to Build a Desktop Weather Station Using ESP32 and E-ink Display
How to Build a Desktop Weather Station Using ESP32 and E-ink Display
CircuitDigest
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Ad

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.
  翻译: