Artificial Intelligence: Natural Language

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

Semantics (Representing Meaning)
Grade 2 Common Core I Can Statements… 1. Second Grade Common Core… The Next Generation Strand: Reading: Literature RL.2.1 –
Knowledge Representation
(It’s not that bad…). Error ID  They give you a sentence  Four sections are underlined  E is ALWAYS “No error”  Your job is to identify which one,
 Sentence: a group of words that contains a subject and a verb and expresses a complete thought. Sentences contain a subject and a predicate. ◦ Subject:
What is a sentence? A sentence is a group of words that expresses a complete thought; it is an independent clause that contains a subject and a verb.
Discourse Martin Hassel KTH NADA Royal Institute of Technology Stockholm
Knowledge Representation Methods
For Friday No reading Homework –Chapter 23, exercises 1, 13, 14, 19 –Not as bad as it sounds –Do them IN ORDER – do not read ahead here.
Linguistic Theory Lecture 8 Meaning and Grammar. A brief history In classical and traditional grammar not much distinction was made between grammar and.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Introduction to Semantics To be able to reason about the meanings of utterances, we need to have ways of representing the meanings of utterances. A formal.
Artificial Intelligence 2005/06 From Syntax to Semantics.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
Natural Language Processing AI - Weeks 19 & 20 Natural Language Processing Lee McCluskey, room 2/07
Matakuliah: G0922/Introduction to Linguistics Tahun: 2008 Session 10 Syntax 1.
Meaning and Language Part 1.
Syntax.
Grammar Nuha Alwadaani.
February 2009Introduction to Semantics1 Logic, Representation and Inference Introduction to Semantics What is semantics for? Role of FOL Montague Approach.
Lecture 19 Methods of simulation of understanding of NL
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
Grammars.
ESLG 320 Ch. 12 A little grammar language…. Parts of Speech  Noun: a person/place/thing/idea  Verb: an action or a state of being  Adjective: a word.
Subjects/Predicates & the types of grammatical sentences.
Understanding Natural Language
Introduction to Linguistics Ms. Suha Jawabreh Lecture 18.
A Procedural Model of Language Understanding Terry Winograd in Schank and Colby, eds., Computer Models of Thought and Language, Freeman, 1973 발표자 : 소길자.
Grammar Race!. What is a sentence? Sentences express complete thoughts; they have a subject and a predicate. Subjects are nouns or pronouns (or phrases.
The Parts of Speech By Ms. Walsh The 8 Parts of Speech… Nouns Adjectives Pronouns Verbs Adverbs Conjunctions Prepositions Interjections Walsh Publishing.
Linguistic Essentials
Introduction to Dialogue Systems. User Input System Output ?
The Parts of Speech The 8 Parts of Speech… Nouns Adjectives Pronouns Verbs Adverbs Conjunctions Prepositions Interjections.
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
Artificial Intelligence: Natural Language
For Monday Read chapter 24, sections 1-3 Homework: –Chapter 23, exercise 8.
For Friday Finish chapter 24 No written homework.
For Monday Read chapter 26 Last Homework –Chapter 23, exercise 7.
Topic and the Representation of Discourse Content
Parts of Speech Review. A Noun is a person, place, thing, or idea.
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
GoBack definitions Level 1 Parts of Speech GoBack is a memorization game; the teacher asks students definitions, and when someone misses one, you go back.
Natural Language Processing Slides adapted from Pedro Domingos
Knowledge Structure Vijay Meena ( ) Gaurav Meena ( )
First Person Point of View A story told through the eyes of a single character. You only know what the narrating character knows. First person writing.
Natural Language Processing (NLP)
For Monday Read chapter 26 Homework: –Chapter 23, exercises 8 and 9.
NATURAL LANGUAGE PROCESSING
Parts of Speech By: Miaya Nischelle Sample. NOUN A noun is a person place or thing.
Parts of Speech Our First Unit in Grammar. What is a noun?
Natural Language Processing (NLP)
7.2 Programming Languages - An Introduction to Informatics WMN Lab. Hye-Jin Lee.
Artificial Intelligence Knowledge Representation.
MENTAL GRAMMAR Language and mind. First half of 20 th cent. – What the main goal of linguistics should be? Behaviorism – Bloomfield: goal of linguistics.
Parts of Speech Review.
Simple Sentences.
Semantics (Representing Meaning)
ALL ABOUT VERBS GRAMMAR SUMMARY.
Chapter Eight Syntax.
Part I: Basics and Constituency
DGP: Daily Grammar Practice
Chapter Eight Syntax.
Natural Language Processing
PREPOSITIONAL PHRASES
Artificial Intelligence 2004 Speech & Natural Language Processing
Information Retrieval
Editing Process: English 10 Spoken Language
Presentation transcript:

Artificial Intelligence: Natural Language A little more on grammars Semantics Pragmatics Generation

More on grammars Consider following examples: “John likes.” NOT OK “John jumps.” OK “John jumps in the water,” OK “The small fluffy cat jumps.” OK John like the cat. NOT OK. The cats likes John. NOT OK. The cat on the table likes John. OK

Better grammar Should deal with: Intransive/Transitive verbs. Former are ones that don’t need following noun phrase. Prepositional phrases (e.g., in the lake). Prepostion followed by noun phrase. Series of adjectives. Recursive rule can be used.. Subject-verb agreement. Can add arguments to grammar rules/dictionary entries. sentence --> np(Num), vp(Num). np(Num) --> art, noun(Num). noun(sing) --> [cat].

Semantics Syntax: Uses grammar to structure sentence. Semantics: Maps this to a structured representation that can be used in inference. (often referred to as sentence meaning) Possible representations: SQL. Map “Find me all the students who are taking AI3” to relevant SQL query. Predicate Logic: Map “John loves anyone who is tall” onto relevant statement in predicate logic. Other structured rep: (e.g., “case frame”: action: loves subject: john object: mary

Semantics How do we get from the parsed sentence to this kind of representation? In general rather tricky, but to illustrate idea we will show how it could be done for “John loves Mary” by adding extra arguments to a prolog grammar. We want to map that sentence to loves(john, mary). We will cheat by assuming that the functor pf Prolog structured objects can be a variable. Verb(Object, Subject)

Grammar with Semantics Sentence(Verb(Subject, Object)) --> nounPhrase(Subject), verbPhrase(Verb, Object). nounPhrase(Subject) --> properName(Subject). verbPhrase(Verb, Object) --> verb(Verb), nounPhrase(Object). General idea is that we can “compose” the sentence meaning by working out the “meaning” of the syntactic constituents and sticking the results together somehow.

Pragmatics But can’t get very far without knowing something about the world, and the context in which a sentence is uttered. Pragmatics deals with this. Example. Determining referents of pronouns etc. “John likes that blue car. He buys it.” We need context to determine what he is referring to in “that blue car”, “he”, it”. Then can create meaning: likes(john, car1) and buys(john, car1).

Pragmatics Pragmatics is also about what people DO with language. Making sense of, and generating language involves mapping language to goals. “Do you have the time?” -> speaker wants to know the time. “When is the last train to London?” -> speaker probably wants to go there. We can apply some of our planning ideas to this problem.

Pragmatics and Plans As an example of a plan-based approach to language, consider the actions of requesting, informing, asking. Referred to as “speech acts”. We can describe these as planning operators. The preconditions and effects refer to speaker and hearer’s beliefs and desires. We use a notation to describe these: knows(Agent, Fact) wants(Agent, State/Action) e.g., wants(fred, kiss(fred, mary)) knows(fred, loves(mary, joe))

More speech acts Sketch of inform, request, inform(Speaker, Hearer, Fact) pre: knows(Speaker, Fact) wants(Speaker, knows(Hearer, Fact)) add: knows(Hearer, Fact) knows(Speaker, knows(Hearer, Fact)) How does this oversimplify the “informing” action? request(Speaker, Hearer, do(Hearer, Action)) pre: wants(Speaker, Action) knows(Speaker, cando(Hearer, Action)) add: wants(hearer, Action) (Note: A bit tricky to integrate with ordinary planning rules.) We talk of people having “communicative goals” (like wanting someone to know something)

Putting it all together Given sentences like spoken by John about Fred: “What is the time? He has missed the train. Can now parse the sentence map that to a structured representation that is good for inference. Use context and knowledge of goals/plans to obtain from that: wants(john, know(john, time1)) (where time1 is the time at some instant) believes(john, missed(fred, train2))

Language Generation Language processing also about generation of language. Structured representation --> NL text. Simplest generation method is using templates, mapping representation straight to text template (with variables/slots to fill in). loves(X, Y) -> X “loves” Y gives(X, Y, Z) -> X “gives the” Y “to” Z Mail-merge tools in word processors work similarly, extracting data from simple database to fill slots.

Language Generation But much more to language generation in general. Templates are very rigid. Consider “John eats the cheese. John eats the apple. John sneezes. John laughs.” Better as “John eats the cheese and apple, then sneezes. He then laughs.” Getting good style involves working out how to map many facts to one sentence, when to use pronouns, when to use “connectives” like “then”.

Language Generation Serious language generation involves deciding: what to say. how to order and structure it. How to break it up into sentences. How to refer to objects (using pronouns, and expressions like “the cat” etc). How to express things in terms of grammatically correct sentences. Often starting point is a communicative goal

Summary Natural Language Processing includes: And involves: Syntax Semantics Pragmatics And involves: Generating language Understanding language