Artificial Intelligence: Natural Language

Slides:



Advertisements
Similar presentations
Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Advertisements

Grammar and Sentences “It is impossible ..to teach English grammar in the schools for the simple reason that no one knows exactly what it is” Government.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
DEFINITE CLAUSE GRAMMARS Ivan Bratko University of Ljubljana Faculty of Computer and Information Sc.
Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section This is an additional example to symbolic.
COGN1001: Introduction to Cognitive Science Topics in Computer Science Formal Languages and Models of Computation Qiang HUO Department of Computer.
Grammars.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
MORPHOLOGY - morphemes are the building blocks that make up words.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
Understanding Natural Language
Natural Language Processing AI - Weeks 19 & 20 Natural Language Processing Lee McCluskey, room 2/07
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Chapter 3: Formal Translation Models
Parsing SLP Chapter 13. 7/2/2015 Speech and Language Processing - Jurafsky and Martin 2 Outline  Parsing with CFGs  Bottom-up, top-down  CKY parsing.
Lect. 11Phrase structure rules Learning objectives: To define phrase structure rules To learn the forms of phrase structure rules To compose new sentences.
Meaning and Language Part 1.
Today  What is syntax?  Grammaticality  Ambiguity  Phrase structure Readings: 6.1 – 6.2.
Languages and Grammars MSU CSE 260. Outline Introduction: E xample Phrase-Structure Grammars: Terminology, Definition, Derivation, Language of a Grammar,
Dr. Ansa Hameed Syntax (4).
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
1. Introduction Which rules to describe Form and Function Type versus Token 2 Discourse Grammar Appreciation.
Statistical Natural Language Processing. What is NLP?  Natural Language Processing (NLP), or Computational Linguistics, is concerned with theoretical.
Three Generative grammars
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2005 Lecture 1 21 July 2005.
Lecture 19 Methods of simulation of understanding of NL
Grammars.
Computer Science 112 Fundamentals of Programming II Recursive Processing of Languages.
exquisite corpse: form and content
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
Introduction Syntax: form of a sentence (is it valid) Semantics: meaning of a sentence Valid: the frog writes neatly Invalid: swims quickly mathematics.
What is a Sentence? By Jaye Lynn Trapp.
Lecture 12: 22/6/1435 Natural language processing Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language (omit 14.4)
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Dr. Monira Al-Mohizea MORPHOLOGY & SYNTAX WEEK 12.
Natural Language Processing Lecture 6 : Revision.
SYNTAX Lecture -1 SMRITI SINGH.
CSNB143 – Discrete Structure Topic 11 – Language.
Adjective Groups and Phrases Grammar & Language. 1. I don’t know much about this topic. 2. I know a little about this topic. 3. I know a bit about this.
Artificial Intelligence: Natural Language
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
Linguistic Essentials
Parsing with Context-Free Grammars for ASR Julia Hirschberg CS 4706 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Rules, Movement, Ambiguity
Chapter 3 Describing Syntax and Semantics
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
For Monday Read chapter 26 Last Homework –Chapter 23, exercise 7.
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
SYNTAX.
Language Language - a system for combining symbols (such as words) so that an unlimited number of meaningful statements can be made for the purpose of.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
Distinctively Visual. Your task Define/describe what each symbol represents. Write down the first few things that pop into your mind.
1 LIN 1310B Introduction to Linguistics Prof: Nikolay Slavkov TA: Qinghua Tang CLASS 11, Feb 9, 2007.
Natural Language Processing (NLP)
For Monday Read chapter 26 Homework: –Chapter 23, exercises 8 and 9.
NATURAL LANGUAGE PROCESSING
Composing Music with Grammars. grammar the whole system and structure of a language or of languages in general, usually taken as consisting of syntax.
Meaning and Language Part 1. Plan We will talk about two different types of meaning, corresponding to two different types of objects: –Lexical Semantics:
By Kyle McCardle.  Issues with Natural Language  Basic Components  Syntax  The Earley Parser  Transition Network Parsers  Augmented Transition Networks.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesAlgebraic.
Chapter Eight Syntax.
Advanced Higher Computing Based on Heriot-Watt University Scholar Materials Applications of AI – Vision and Languages 1.
Chapter Eight Syntax.
Natural Language - General
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

Artificial Intelligence: Natural Language Lecture 7 Intro Syntax Semantics Pragmatics

Review Intelligence involves: So far looked at last of these: communicating recognising what we see around us navigating Using our knowledge to draw new conclusions and solve problems. So far looked at last of these: knowledge representation and problem solving. Time to turn back to first of these.

Natural Language Processing Natural language processing concerns: Undertanding or generating spoken and written text. Examples of NL tasks: understanding questions/instructions posed in natural language “e.g., switch off the computer”. May be spoken or typed Generating natural language responses “skimming” written texts to find information, or to create a summary. .Generating coherent Nldocuments from some structured information.

Natural Language Processing So NL Processing covers understanding and generation short sentences and larger texts spoken and written language. We will focus mainly on understanding short written sentences.

Knowledge Required What knowledge do we (as humans) use to make sense of language? Knowledge of how words sound.. “cat” == “c” “a” “t” Knowledge of how words can be composed into sentences (the grammar). The can sat on the mat OK sat mat can on the NO Knowledge of people, events, the world, types of text. Recognising adverts for what they are. Undertstanding indirect requests “I don’t quite understand this” as request for help.

Stages of processing To deal with complexity, can process language in series of stages: speech recognition using knowledge of how sounds make up words. syntactic analysis using grammar of language to get at sentence structure. semantic analysis mapping this to meaning pragmatics using world knowledge and context to fill in aspects of meaning.

Syntactic Analysis We will focus on syntax. How do we recognise that a sentence is grammatically correct? The cat sat on the mat. OK On the the sat cat mat. NO. More importantly, how to we use knowledge of language structures to assign structure to a sentence (helping in deriving its meaning). (The large green cat) (sat on (the small mat)) Bracketed bits are meaningful subparts.

Grammars Grammars define the legal structures of a language. We “parse” a sentence using a grammar to: Determine whether it is grammatical. Assign some useful structure/grouping to the sentence. We want the words denoting an object to be grouped together, and words denoting actions to be grouped together.

Syntactic Categories Grammars based on each word belonging to a particular category: nouns verbs adjectives adverbs articles/determiners The black cat jumps quickly article adjective noun verb adverb

Larger groupings Noun phrase: sequence of words denoting an object. E.g., the black cat. Verb phrase: sequence of words denoting an action. E.g., jumps quickly runs after the small dog kicks the small boy with the funny teeth Note that verb phrases may contain noun phrases.

Simple NL Grammar We can write a simple NL grammar using phrase structure rules such as the following: sentence --> nounPhrase, verbPhrase. nounPhrase --> article, adjective, noun. verbPhrase --> verb, nounPhrase. This means: a sentence can consist of a noun phrase followed by a verb phrase. A noun phrase can consist of an article, followed by an adjective, followed by a noun. Rules define constituent structure.

Parsing Using these rules we can determine whether a sentence is legal, and obtain its structure. “The large cat eats the small rat” This consists of: Noun Phrase: The large cat Verb Phrase: eats the small rat The verb phrase in turn consists of: verb: eats Noun Phrase: the small rat

Parse Tree This structure can be represented as a tree: sentence verb phrase noun phrase verb noun phrase article adjective noun article adjective noun The large cat eats the small rat

Parse Tree This tree structure gives you groupings of words. (e.g., the small cat). These are meaningful groupings - considering these together helps in working out what the sentence means.

Parsing Basic approach is based on rewriting. To parse a sentence you must be able to “rewrite” the “start” symbol (in this case sentence) to the sequence of syntactic categories corresponding to the sentence. You can rewrite a symbol using one of the grammar rules if it corresponds to the LHS of a rule. You then just replace it with the symbols in LHS. e.g., sentence nounPhrase verbPhrase article adjective noun verbPhrase e etc

A little more on grammars Example grammar will ONLY parse sentences of a very restricted form. What about: “John jumps” The man jumps”. John jumps in the pond. We need to add extra rules to cover some of these cases

Extended Grammar (Think how you might handle “in the pond”..) sentence --> nounPhrase, verbPhrase. nounPhrase --> article, adjective, noun. nounPhrase --> article, noun. nounPhrase --> properName. verbPhrase --> verb, nounPhrase. verbPhrase --> verb. (Think how you might handle “in the pond”..) Grammar now parses: John jumps the pond. And fails to parse ungrammatical ones like: jumps pond John the

NL Grammars A good NL grammar should: cover a reasonable subset of natural language. Avoid parsing ungrammatical sentences (or at least, ones that are viewed as not acceptable in the target application). Assign plausible structures to the sentence, where meaningful bits of the sentence are grouped together. But.. The role is NOT to check that a sentence is grammatical. By excluding dodgy sentences the grammar is more likely to get the right structure of a sentence.

Summary Natural Language Processing covers understanding and generating spoken and written language, from sentences to large texts. Focus on understanding sentences. First step is to parse sentence to derive structure. Use grammar rules which define constituency structure of language. Parse gives tree structure which shows how words are grouped together.