Lecture 20a Feature Based Grammars Topics Description Logic III Overview of MeaningReadings: Text Chapter 18 NLTK book Chapter 10 March 28, 2013 CSCE 771.

Slides:



Advertisements
Similar presentations
Artificial Intelligence 4. Knowledge Representation
Advertisements

Query Answering based on Standard and Extended Modal Logic Evgeny Zolin The University of Manchester
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Biointelligence Lab School of Computer Sci. & Eng.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
First Order Logic Resolution
Reinforced Concrete: A Fundamental Approach, Sixth Edition By Edward G. Nawy Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey.
LTAG Semantics on the Derivation Tree Presented by Maria I. Tchalakova.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
1 Predicates and quantifiers Chapter 8 Formal Specification using Z.
ITCS 3153 Artificial Intelligence Lecture 10 Logical Agents Chapter 7 Lecture 10 Logical Agents Chapter 7.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Beginning Problem-Solving Concepts for the Computer Problem Solving and Programming Concepts 9 th Edition.
Copyright © Cengage Learning. All rights reserved.
FIRST ORDER LOGIC Levent Tolga EREN.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2005 Lecture 1 21 July 2005.
LDK R Logics for Data and Knowledge Representation Description Logics as query language.
Lecture 3 [Self Study] Relational Calculus
Formal Languages, Part Two SIE 550 Lecture Matt Dube Doctoral Student – Spatial.
Copyright ©2011 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Chapter Cost-Benefit Analysis Concepts and Practice.
Artificial Intelligence 4. Knowledge Representation Course V231 Department of Computing Imperial College, London © Simon Colton.
1 Statistical Parsing Chapter 14 October 2012 Lecture #9.
Chapter 8 Relational Calculus. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.8-2 Topics in this Chapter Tuple Calculus Calculus vs. Algebra.
1 COSC3306: Programming Paradigms Lecture 8: Declarative Programming Specifications Haibin Zhu, Ph.D. Computer Science Nipissing University (C) 2003.
LDK R Logics for Data and Knowledge Representation ClassL (part 3): Reasoning with an ABox 1.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Description Logics: Logic foundation of Semantic Web Semantic.
Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.
Propositional Calculus Knowledge based agent Knowledge is contained in agents in the form of sentences in a knowledge representation language stored in.
CSA2050 Introduction to Computational Linguistics Lecture 1 Overview.
Lecture 21 Computational Lexical Semantics Topics Features in NLTK III Computational Lexical Semantics Semantic Web USCReadings: NLTK book Chapter 10 Text.
CSA2050 Introduction to Computational Linguistics Lecture 1 What is Computational Linguistics?
More on Description Logic(s) Frederick Maier. Note Added 10/27/03 So, there are a few errors that will be obvious to some: So, there are a few errors.
JAVA: An Introduction to Problem Solving & Programming, 7 th Ed. By Walter Savitch ISBN © 2015 Pearson Education, Inc., Upper Saddle River,
Bertram Ludäscher Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
DL Overview Second Pass Ming Fang 06/19/2009. Outlines  Description Languages  Knowledge Representation in DL  Logical Inference in DL.
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
Figure Materials in Basal Reading Programs Gail E. Tompkins Literacy for the 21st Century, 3e Copyright ©2003 by Pearson Education, Inc. Upper Saddle.
ece 627 intelligent web: ontology and beyond
CSE-291: Ontologies in Data Integration Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
Figure A--1 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.
Artificial Intelligence Knowledge Representation Department of Computer Science & Enggineering V. R. Palekar.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Of 29 lecture 15: description logic - introduction.
Figure 7.1 Categories Grid Bill Harp and Jo Ann Brewer The Informed Reading Teacher: Research- Based Practice Copyright ©2005 by Pearson Education, Inc.
LDK R Logics for Data and Knowledge Representation Description Logics: family of languages.
NLP. Introduction to NLP What is the meaning of: (5+2)*(4+3)? Parse tree N N N N + + E E E E F F* FE E E 49.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Artificial Intelligence 4. Knowledge Representation
Chapter 7. Propositional and Predicate Logic
Logics for Data and Knowledge Representation
ece 720 intelligent web: ontology and beyond
The function of knowledge representation scheme is
Lecture 21 Computational Lexical Semantics
CSC 594 Topics in AI – Applied Natural Language Processing
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Back to “Serious” Topics…
Lecture 20a Feature Based Grammars
Chapter 7. Propositional and Predicate Logic
CS 416 Artificial Intelligence
Thinking Mathematically
Description Logics.
Logics for Data and Knowledge Representation
Predicate Logic: Syntax.
Predicate Logic.
Presentation transcript:

Lecture 20a Feature Based Grammars Topics Description Logic III Overview of MeaningReadings: Text Chapter 18 NLTK book Chapter 10 March 28, 2013 CSCE 771 Natural Language Processing

– 2 – CSCE 771 Spring 2013 Overview Last Time (Programming) Computational SemanticsToday Feature based grammarsReadings: Text NLTK Book: Chapters 9 and 10 Next Time: Computational Lexical Semantics

– 3 – CSCE 771 Spring 2013 Automated Reasoning Services Satisfiability: A concept C is satisfiable with respect to T if there exists a model I of T such that C I ≠ ∅. We also say that I is a model of C. Satisfiability: A concept C is satisfiable with respect to T if there exists a model I of T such that C I ≠ ∅. We also say that I is a model of C. Subsumption: A concept C 1 is subsumed by a concept C 2 with respect to T if CI ⊆ CI for every model I of T. We also write C 1 ⊑ T C 2 or T |= C 1 ⊑ C 2. Subsumption: A concept C 1 is subsumed by a concept C 2 with respect to T if CI ⊆ CI for every model I of T. We also write C 1 ⊑ T C 2 or T |= C 1 ⊑ C 2. Equivalence: Two concepts C 1 and C 2 are equivalent with respect to T if C 1 I = C 2 I for every model I of T. We also write C 1 ≡T C 2 or T |= C 1 ≡ C 2. Equivalence: Two concepts C 1 and C 2 are equivalent with respect to T if C 1 I = C 2 I for every model I of T. We also write C 1 ≡T C 2 or T |= C 1 ≡ C 2. Disjointness: Two concepts C 1 and C 2 are disjoint with respect to T if C 1 I ⊓ C 2 I = ∅ for every model I of T Disjointness: Two concepts C 1 and C 2 are disjoint with respect to T if C 1 I ⊓ C 2 I = ∅ for every model I of T Chuming Chen’s Dissertation 2008

– 4 – CSCE 771 Spring 2013 Abox Reasoning ABox consistency checking: An ABox A is consistent with respect to a TBox T if there exists an interpretation I that is a model of both T and A. Instance checking: An individual a is an instance of concept C with respect to T and A if aI ⊆ CI for every model of T and A. Instance checking: An individual a is an instance of concept C with respect to T and A if aI ⊆ CI for every model of T and A. Retrieval problem: Given an ABox A and a concept C, to find all individuals a such that A |= a : C. Retrieval problem: Given an ABox A and a concept C, to find all individuals a such that A |= a : C. Realization problem: Given an individual a and a set of concepts, find the most specific concepts C from the set such that A |= a : C. Note, the most specific concepts are those that are minimal with respect to the subsumption ordering ⊑. Realization problem: Given an individual a and a set of concepts, find the most specific concepts C from the set such that A |= a : C. Note, the most specific concepts are those that are minimal with respect to the subsumption ordering ⊑. Chuming Chen’s Dissertation 2008

– 5 – CSCE 771 Spring 2013 Figure 18.5 Quantifier Scope and Ambiguity Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin Every Restaurant has a menu. Two possible meanings

– 6 – CSCE 771 Spring 2013 UnderSpecification Underspecification is supporting “ambiguous” meanings by leaving unspecified aspects unspecified So we need to be able to “Create underspecified representations that embody all possible readings without explicitly enumerating them”“Create underspecified representations that embody all possible readings without explicitly enumerating them” Extract the readings if necessaryExtract the readings if necessary Choose amongst those readingsChoose amongst those readings Haver(e,Restaurant) ^ had(e, Menu) “it should remain agonstic about the placement of qualifiers”

– 7 – CSCE 771 Spring 2013 Stores Cooper storage (1983) For meanings of nodes of parse tree we have been using predicate calculus (FOL) formulae In Cooper’s approach we replace the single formula with a “store” consisting of a list of quantified expressions gathered from below

– 8 – CSCE 771 Spring 2013 Figure 18.6 Semantic Stores for VP Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 9 – CSCE 771 Spring 2013 Hole Semantics Hole semantics (Bos 1996) λ - reductions replace λ- variables with “holes” Instead of using λ – reductions we just create labels (“holes”) Dominance constraints Plugging the holes

– 10 – CSCE 771 Spring 2013 Figure 18.7 Hole Semantic Repr. for Every Restaurant has a menu. Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 11 – CSCE 771 Spring 2013 Figure 18.8 Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 12 – CSCE 771 Spring 2013 Feature and Unification based approaches Feature structures associated with nodes of the parse tree and performing unifications

– 13 – CSCE 771 Spring 2013 Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin Exists e Closing(e) ^ Closed(e, Rhumba)

– 14 – CSCE 771 Spring 2013 Figure 18.9 DAG for Semantic Features Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 15 – CSCE 771 Spring 2013 Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 16 – CSCE 771 Spring 2013 Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 17 – CSCE 771 Spring 2013 Figure Earley + Semantics Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. Speech and Language Processing, Second Edition Daniel Jurafsky and James H. Martin

– 18 – CSCE 771 Spring 2013 Problem with SQL and Agents

– 19 – CSCE 771 Spring 2013 Consistency of Statements (5) a.Sylvania is to the north of Freedonia. b.Freedonia is a republic. (6) a.The capital of Freedonia has a population of 9,000. b.No city in Freedonia has a population of 9,000. (7) a.Sylvania is to the north of Freedonia. b.Freedonia is to the north of Sylvania. NLTK Book Chapter 10

– 20 – CSCE 771 Spring 2013 Models again “A model for a set W of sentences is a formal representation of a situation in which all the sentences in W are true.” NLTK Book Chapter 10

– 21 – CSCE 771 Spring 2013 Logic and the NLTK >>> nltk.boolean_ops() negation - conjunction & disjunction | implication -> equivalence equivalence >>> lp = nltk.LogicParser() >>> lp.parse('-(P & Q)') >>> lp.parse('P & Q') >>> lp.parse('P | (R -> Q)') Q))> Q))> >>> lp.parse('P -- P') --P)> --P)> NLTK Book Chapter 10

– 22 – CSCE 771 Spring 2013 Theorem Prover 9 >>> NotFnS = lp.parse('-north_of(f, s)') >>> SnF = lp.parse('north_of(s, f)') >>> R = lp.parse('all x. all y. (north_of(x, y) -> -north_of(y, x))') >>> prover = nltk.Prover9() >>> prover.prove(NotFnS, [SnF, R]) True >>> lp = nltk.LogicParser() >>> SnF = lp.parse('SnF') >>> NotFnS = lp.parse('-FnS') >>> R = lp.parse('SnF -> -FnS') >>> prover = nltk.Prover9() >>> prover.prove(NotFnS, [SnF, R]) True NLTK Book Chapter 10

– 23 – CSCE 771 Spring 2013 Models and Values >>> val = nltk.Valuation([('P', True), ('Q', True), ('R', False)]) >>> val['P'] True >>> dom = set([]) >>> g = nltk.Assignment(dom) >>> m = nltk.Model(dom, val) >>> print m.evaluate('(P & Q)', g) True >>> print m.evaluate('-(P & Q)', g) False >>> print m.evaluate('(P & R)', g) False NLTK Book Chapter 10

– 24 – CSCE 771 Spring 2013 First Order Logic and the NLTK >>> tlp = nltk.LogicParser(type_check=True) >>> parsed = tlp.parse('walk(angus)') >>> parsed.argument >>> parsed.argument.type e >>> parsed.function >>> parsed.function.type <e,?> NLTK Book Chapter 10

– 25 – CSCE 771 Spring 2013 Free Variables >>> lp = nltk.LogicParser() >>> lp.parse('dog(cyril)').free() set([]) >>> lp.parse('dog(x)').free() set([Variable('x')]) >>> lp.parse('own(angus, cyril)').free() set([]) >>> lp.parse('exists x.dog(x)').free() set([]) >>> lp.parse('((some x. walk(x)) -> sing(x))').free() set([Variable('x')]) >>> lp.parse('exists x.own(y, x)').free() set([Variable('y')]) NLTK Book Chapter 10

– 26 – CSCE 771 Spring 2013 >>> NotFnS = lp.parse('-north_of(f, s)') >>> SnF = lp.parse('north_of(s, f)') >>> R = lp.parse('all x. all y. (north_of(x, y) -> - north_of(y, x))') >>> prover = nltk.Prover9() >>> prover.prove(NotFnS, [SnF, R]) True >>> FnS = lp.parse('north_of(f, s)') >>> prover.prove(FnS, [SnF, R]) False NLTK Book Chapter 10

– 27 – CSCE 771 Spring 2013 >>> v = """... bertie => b... olive => o... cyril => c... boy => {b}... girl => {o}... dog => {c}... walk => {o, c}... see => {(b, o), (c, b), (o, c)}... """ >>> val = nltk.parse_valuation(v) >>> print val {'bertie': 'b', 'boy': set([('b',)]), 'boy': set([('b',)]), 'cyril': 'c', 'cyril': 'c', 'dog': set([('c',)]), 'dog': set([('c',)]), 'girl': set([('o',)]), 'girl': set([('o',)]), 'olive': 'o', 'olive': 'o', 'see': set([('o', 'c'), ('c', 'b'), ('b', 'o')]), 'see': set([('o', 'c'), ('c', 'b'), ('b', 'o')]), 'walk': set([('c',), ('o',)])} 'walk': set([('c',), ('o',)])} NLTK Book Chapter 10

– 28 – CSCE 771 Spring 2013 >>> fmla1 = lp.parse('girl(x) | boy(x)') >>> m.satisfiers(fmla1, 'x', g) set(['b', 'o']) >>> fmla2 = lp.parse('girl(x) -> walk(x)') >>> m.satisfiers(fmla2, 'x', g) set(['c', 'b', 'o']) >>> fmla3 = lp.parse('walk(x) -> girl(x)') >>> m.satisfiers(fmla3, 'x', g) set(['b', 'o']) NLTK Book Chapter 10

– 29 – CSCE 771 Spring 2013 Admire Relation >>> v2 = """... bruce => b... cyril => c... elspeth => e... julia => j... matthew => m... person => {b, e, j, m}... admire => {(j, b), (b, b), (m, e), (e, m), (c, a)}... """ >>> val2 = nltk.parse_valuation(v2) NLTK Book Chapter 10

– 30 – CSCE 771 Spring 2013 >>> dom2 = val2.domain >>> m2 = nltk.Model(dom2, val2) >>> g2 = nltk.Assignment(dom2) >>> fmla4 = lp.parse('(person(x) -> exists y.(person(y) & admire(x, y)))') >>> m2.satisfiers(fmla4, 'x', g2) set(['a', 'c', 'b', 'e', 'j', 'm']) >>> fmla5 = lp.parse('(person(y) & all x.(person(x) -> admire(x, y)))') >>> m2.satisfiers(fmla5, 'y', g2) set([]) NLTK Book Chapter 10

– 31 – CSCE 771 Spring 2013 Theorem9 prover arguments = [ ('(man(x) (not (not man(x))))', []), ('(not (man(x) & (not man(x))))', []), ('(man(x) | (not man(x)))', []), ('(man(x) & (not man(x)))', []), ('(man(x) -> man(x))', []), ('(not (man(x) & (not man(x))))', []), ('(man(x) | (not man(x)))', []), ('(man(x) -> man(x))', []), ('(man(x) man(x))', []), ('(not (man(x) (not man(x))))', []), ('mortal(Socrates)', ['all x.(man(x) -> mortal(x))', 'man(Socrates)']), ('((all x.(man(x) -> walks(x)) & man(Socrates)) -> some y.walks(y))', []),

– 32 – CSCE 771 Spring 2013 ('(all x.man(x) -> all x.man(x))', []), ('some x.all y.sees(x,y)', []), ('some e3.(walk(e3) & subj(e3, mary))', ['some e1.(see(e1) & subj(e1, john) & some e2.(pred(e1, e2) & walk(e2) & subj(e2, mary)))']), ('some x e1.(see(e1) & subj(e1, x) & some e2.(pred(e1, e2) & walk(e2) & subj(e2, mary)))', ['some e1.(see(e1) & subj(e1, john) & some e2.(pred(e1, e2) & walk(e2) & subj(e2, mary)))']) ]