SYNTAX, Grammar - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

SYNTAX, Grammar

Description:

Adj: big , black. Noun: dog , cat. ProperNoun: Jim, Fido , Rex ... Fido chases the black big cat. Sentences may be understandable even if grammatically flawed. ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 25
Provided by: compu137
Category:
Tags: syntax | grammar

less

Transcript and Presenter's Notes

Title: SYNTAX, Grammar


1
SYNTAX, Grammar
  • Word Classes
  • Phrase-Structure Grammar
  • Recursion
  • Features
  • For more information JM, chap 9

2
Stages of NL Understanding
  • Morphology analyse word inflection
  • Lexicon Word Class Tagging
  • Syntax determine grammatical structure
  • Semantics convert to a form that is meaningful
    to a computer
  • e.g., SQL query
  • Pragmatics influence of context
  • e.g., what them refers to

3
Example
  • Original Who wrote them
  • morphology
  • who write/past them
  • Word Class Tagging
  • Pronounwho, Verbwrite, Pronoun them
  • Grammar
  • verbwrite, subjectwho, objectthem
  • semantics
  • Select title, firstname, lastname from X
  • pragmatics
  • Select title, firstname, lastname from books in
    current focus
  • Where salesthisyear gt10000

4
Grammar Definition
  • Syntax the body of knowledge of how proper
    sentences are structured (ordered) in the natural
    language (e.g. English).
  • A grammar defines syntactically legal sentences.
  • John ate an apple (syn legal)
  • John ate apple (not syn legal)
  • Apple big ate John (not syn legal)
  • John ate a building (syn legal)

5
Word Classes
  • Open Classes -- Tens of thousands of words
  • Nouns
  • Verbs
  • Adjectives
  • Adverbs
  • Closed Classes a few to tens of words
  • Prepositions
  • Determiners
  • Pronouns
  • Conjunctions
  • Auxiliaries
  • Particles

6
The Major Open Classes
  • Nouns words for people, places, things, ideas
  • Common Nouns a dog, a tree, an idea
  • Proper Nouns Dan, IBM, Fido
  • Count Nouns goat / goats , apple / apples
  • Mass Nouns water, sand, snow, communism
  • Verbs words referring to actions and processes
  • Transitive he broke the glass
  • Nontransitive John slept
  • Adjectives words that describe properties,
    qualities
  • Color white, blue Age young, old Value
    good, bad
  • Adverbs words modifying the verb or verbphrase
  • Directional adverb home, north
  • Locative Adverb here, downhill
  • Degree Adverb extremely, very, somewhat
  • Manner Adverbs slowly, delicately, cruelly

7
The Closed Classes
  • Prepositions
  • On, under, over, near, by, at, from, to, with
  • Determiners
  • The, an, a (articles)
  • Pronouns
  • He, she, it, this, which, her, we, our, its, that
  • Conjunctions
  • And, or, all, but, if, so, before, while, after
  • Auxiliary Verbs words that modify the verb
    phrase
  • Be, have, had, do, were, did, can, should, could,
    not
  • Particles Bill put up with him, put him down
  • up, down, off, by, abroad, besides
  • Numerals
  • one, two, three, first,

8
A very simple grammar
  • S ? NP Verb NP
  • NP ? Det Noun
  • NP ? Name
  • Det a , the
  • Noun dog , cat
  • Name Fido , Misty
  • Verb chases , sees
  • Fido chases the cat
  • A cat sees Misty

9
Sentence Constituents
  • Grammar rules mention constituents (NP) as well
    as atomic types (noun)
  • Also known as non-terminals
  • A constituent can occur in many rules
  • NP also after a preposition (near the dog), in
    possessives (the cats paws),...
  • Dont know if they really exist, but they make
    grammars simpler!

10
Common Constituents
  • Some common constituents (head)
  • Noun phrase the dog, an apple, the man I saw
    yesterday
  • Adjective phrase happy, very happy
  • Verb Group eat, ate, am eating, have been
    eating.
  • Verb Phrase eating an apple, ran into the store
  • Prepositional Phrase in the car, on the table,
    to the door

11
Phrase-Structure Grammar
  • PS grammars use context-free rules to define
    constituents and sentences
  • S ? NP Verb NP
  • Similar to rules used to define syntax of
    programming languages.
  • if-statement ? if condition then statement
  • Also called context-free grammar (CFG)
  • Adequate for (almost all of?) English
  • see JM, chap 13

12
Another simple grammar
  • S ? NP VP
  • NP ? Det Adj Noun
  • NP ? ProperNoun
  • VP ? IntranVerb
  • VP ? TranVerb NP
  • Det a , the
  • Adj big , black
  • Noun dog , cat
  • ProperNoun Jim, Fido , Rex
  • IntranVerb run , sleep
  • TranVerb chase , see

13
Example Sam sleeps
14
Ex The cat sees the dog
15
Fido chases the big black cat
16
Recursion
  • NL Grammars allow recursion
  • NP Det Adj CommonNoun PP
  • PP Prep NP
  • The man in the store saw John
  • I fixed the intake of the engine of BAs first
    jet.

17
The man in the store saw John
NP
VP
PP
Noun
Prep
NP
Noun
man
in
the
store
The
saw John
18
Grammar is not everything
  • Sentences may be grammatically OK but not
    acceptable (acceptability?)
  • The sleepy table eats the green idea.
  • Fido chases the black big cat.
  • Sentences may be understandable even if
    grammatically flawed.
  • Fido chases a cat small.
  • Features
  • Features are annotations to words and consituents
  • Grammar rules use unification (as in Prolog) to
    manipulate features.
  • Allow grammars to be smaller and simpler
  • See JM, chap 11

19
Ex Number
  • One feature is numberN, where N is singular or
    plural.
  • A nouns number comes from morphology
  • cat - singular noun
  • cats - plural noun
  • An NPs number comes from its head noun
  • A VPs number comes from its verb (aux verb?)
  • is happy - singular VP
  • are happy - plural VP

20
Grammar Modified with Features
  • Features are added to the rules.
  • The simple grammar Modified
  • S NPnumN VPnumN
  • NPnumN DetnumN Adj NounnumN PP
  • NPnumsingular ProperNoun
  • VPnumN IntranVerbnumN
  • VPnumN TranVerbnumN NP
  • PP Prep NP
  • NPnumN DetnumN Adj NounnumN

21
Example Features Agreement
  • An NPs determiner and noun (but not its
    adjectives) must agree in number.
  • this dog is OK
  • these dogs is OK
  • this dogs is not OK (det must agree)
  • these dog is not OK (det must agree)
  • the big red dog is OK
  • the big red dogs is OK (adjs dont agree)
  • number of NP is number of Noun
  • Three dogs an NP

22
Ex The cats see the dog
VPplur
NPplur
TranVerbplur
NPsing
Nounplur
Nounsing
cats
see
the
dog
The
23
Other features
  • Person (I, you, him)
  • Tense (past, present, future)
  • Gender (he, she)
  • Polarity (positive, negative)
  • etc, etc, etc

24
Grammar Summary
  • Phrase-structure grammars
  • (like those used for C, Pascal syntax)
  • Based on word types
  • Intermediate constituents
  • Recursion
  • Features
Write a Comment
User Comments (0)
About PowerShow.com