cfg and ai

18
 Context free  Grammar  By : Kalpana Nagle

Upload: kalpana-nagle

Post on 30-May-2018

244 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 1/18

Context free

Grammar

By :

KalpanaNagle

Page 2: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 2/18

Points to be discussed

• What is grammar.

• Who developed the context free grammar.

• More focused on context free grammar.•

• Relation with artificial intelligent.•

• Importance of context free grammar .

Page 3: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 3/18

What is Grammar

• Grammar is the study of rules governing the use of language.

• The set of rules governing aparticular language is alsocalled the grammar of the

language; thus, eachlanguage can be said tohave its own distinctgrammar.

• Grammar is art of the

Page 4: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 4/18

… What is Grammar

Definition : A Grammar G is defined as an orderedquadruple of the form

• G = ( V N , V T , S, P )•

• where the entries are identified as follows: V N is anonterminal consisting of the lexical and syntacticcategory labels;

V T denotes a set of words, called the terminal of G; •

• S is a special member of V N that, in addition to beingthe label of the sentence category, identifies thestarting symbol of G; and

Page 5: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 5/18

oam Chomskoam Chomsk

oam Chomsky lassified the

rammar into 4.ategories

Page 6: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 6/18

Chomsky classification ofGrammar

Type Name Type of Productions

0 Unrestricted

1 Context-Sensitive

2 Context-Free

3 Regular, Finite

Page 7: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 7/18

C ntext Free Grammar ntext Free Grammar

A ormal grammar ,is a precisely defined grammar typically used for o mp ut er p ro gr am mi ng

languages .

A en er at ive grammar is a ormal grammar that" " -can in some sense generate the well formed

expressions of a .atural language

An entire branch of in gu ist ic theory is based on.generative grammars e ne ra ti ve g ram ma rs were

popularized by .oam Chomsky

Page 8: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 8/18

C ntext Free Grammar ntext Free Grammar

-Context free grammars play a central role in the description and design f r og ra mmi ng la ng ua ge s

and .ompilers

They are also used for analyzing the syntax of.a tural languag es

oam Chomsky has posited that all uman anguages are based on ontext free grammars

Page 9: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 9/18

Page 10: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 10/18

atural language atural languageprocessingrocessing

atural language( )rocessing NLP is the use

of computers to understand uman languages .

enerat ive g ra mma r is the use of rules to onstruct

.entences

oam Chomsky has posited that all uman languages are based on ontext free

grammars

Page 11: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 11/18

atural language atural languageprocessingrocessing

( )The goal of Natural Language Processing NLP is to,design and build a computer system that will analyze

, - .understand and generate natural human languages

Applications of NLP include machine translation of- ;one human language text to another

- ,Generation of human language text such as fiction, ;manuals and general descriptions interfacing to other systems such as databases and robotic systems

-Thus enabling the use of human language type commands; -and queries and understanding human language text to

.provide a summary or to draw conclusions

Page 12: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 12/18

atural language atural languageprocessingrocessing

One of the easiest tasks for a NLP system is to parse.a sentence to determine its syntax

A more difficult task is determining the semantic.meaning of a sentence One of the most difficult tasks

is the analysis of the context to determine the true.meaning and comparing that with other text

Page 13: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 13/18

Computers

r ti fi ci a l Int el ligence Algorithms

Databases

Networking

Robotics

Search

at ural L anguage P roces sing

InformationRetrieval

achineTranslation

anguageAnalysis

Semantics Parsing

Page 14: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 14/18

Natural Language Processing

• Subfield of Artificial Intelligence (AI) – Typically seen as one part of knowledge

representation•

• Can also be seen as a combination of computer science and linguistics.

– Computational Linguistics•

• Applications – English as a command language – Database queries – Translation systems – Speech recognition systems

Page 15: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 15/18

Linguistics

• Human language divides into five levels

1.2. Phonology• How sounds are used in language

3.4. Morphology

• Word formation

5.6. Syntax

• Sentence formation7.8. Semantics

Sentence meaning9.

Page 16: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 16/18

Page 17: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 17/18

Page 18: cfg and ai

8/14/2019 cfg and ai

http://slidepdf.com/reader/full/cfg-and-ai 18/18

:NY QUERIES