an extensible natural language query interface to an
play

An Extensible Natural-Language Query Interface to an Event-Based - PowerPoint PPT Presentation

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Richard Frost (Professor Emeritus) Shane Peelar (Doctoral Candidate) { richard , peelar}@uwindsor.ca School of Computer Science University of Windsor


  1. An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Richard Frost (Professor Emeritus) Shane Peelar (Doctoral Candidate) { richard , peelar}@uwindsor.ca School of Computer Science University of Windsor Windsor, Ontario, Canada NLIWoD 2018 An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 1

  2. The Semantic Web - Advantages Billions of facts, stored as triples e.g., where URIs are given as bare names: <…hall> <…discovered> <…phobos> Simple format facilitates computer processing Unique URIs facilitate addition of facts, e.g.: <…hall> <…discovered> <…deimos> URIs and standard format facilitate verifjcation. An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 2

  3. Natural Language Query Interfaces Two approaches: Translate to SPARQL Interpret queries directly using a compositional semantics – The approach that we adopt An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 3

  4. Demonstration The Web Page The list of event-based triples The natural language interface Example queries with nouns, pnouns, intransitive verbs, conjunction and disjunction 1 Example queries with quantifjers 2 Example queries with transitive verbs 3 Example queries with prepositions 4 An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 4

  5. Addition of Facts about a Relationship (Reifjcation and events) <event1030> <subject> <hall> . <event1030> <object> <phobos> . <event1030> <type> <discovery> . <event1030> <date> <1877> . <event1030> <implement> <refractor_telescope_1> . <event1030> <location> <us_naval_observatory> . An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 5

  6. Lambda Calculus Universal model of computation Consider the function: add = ( λ x . ( λ y . x + y )) Example application: add 3 4 = ( λ x . ( λ y . x + y )) 3 4 ⇒ ( λ y . 3 + y ) 4 This is an example of beta reduction = = ⇒ 3 + 4 add_three = add 3 = λ y . 3 + y Partial application of add returns a function add_three 6 = ⇒ add 3 6 = ⇒ 9 An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 6

  7. Montague Semantics Note: ∥ w ∥ is the denotation of w ∥ spin ∥ = spins _ pred ∥ phobos ∥ = λ p . p e phobos ∥ phobos spins ∥ ⇒∥ phobos ∥ ∥ spins ∥ = ⇒ λ p . p e phobos ∥ spins ∥ = ⇒ λ p . p e phobos spins _ pred = ⇒ spins _ pred e phobos = ⇒ True = An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 7

  8. Montague Semantics (con’t) ∥ every ∥ = λ p .λ q . ∀ x ( p x ⇒ q x ) ∥ every moon spins ∥ ⇒ ( ∥ every ∥ ∥ moon ∥ ) ∥ spins ∥ ( from syntactic parsing ) = ⇒ ( λ p .λ q . ∀ x ( p x ⇒ q x ) moon _ pred ) spins _ pred = ⇒ ( λ q . ∀ x ( moon _ pred x ⇒ q x )) spins _ pred = ⇒∀ x moon _ pred x ⇒ spins _ pred x = ⇒ True ( every moon in the universe of discourse spins ( costly !)) = Note: ∥ phobos ∥ has same type as ∥ every moon ∥ An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 8

  9. Montague Semantics (con’t) Abstract (Montague 1970) I reject the contention that an important theoretical difgerence exists between formal and natural languages.[15] MS: Direct Evaluation of NL Queries w.r.t. Datastore “Who (stole (a car) [in (1918 or 1920), in (a (borough (of New_York)))])?” ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ λ . . . ( λ . . . ( λ . . . λ . . . )[ λ . . . ( λ . . . λ . . . λ . . . ) , λ . . . ( λ . . . ( λ . . . ( λ . . . λ . . . )))]) ⇑ ⇑ ⇑ ⇑ TRIPLESTORE Where λ . . . are functions (which are the denotations of English words) Some functions are defjned ⇑ in terms of triplestore retrieval operations An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 9

  10. Advantages of compositional semantics and MS In MS, all words/phrases of the same syntactic category have denotations of the same semantic type. Modularity – facilitates implementation, especially as an Executable Attribute Grammar [13] Extensibility – new constructs of a syntactic category c must have denotations of the same type as existing constructs of category c . Facilitates construction and proofs An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 10

  11. Montague’s treatment of transitive verbs: syntactic manipulation Transitive verbs are left uninterpreted until the rest of the phrase has been interpreted and reduced as far as possible. The expression is then rewritten to another lambda expression using a syntactic sigma σ rule. See page 216 of Dowty, Wall and Peters 1981 [4] . Complicated and diffjcult to implement No explicit denotation for transitive verbs Therefore no denotation, for example, for “discovered phobos” An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 11

  12. Blackburn and Bos approach to Transitive Verbs ∥ discover ∥ = λ z . z ( λ x .λ y . discover _ pred ( y , x )) Works for 2-place trans verbs (see Frost ACM Surveys [7]) An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 12

  13. Our approach I: set based MS FLMS: Modify MS for effjciency ∥ phobos ∥ = λ s . e phobos ∈ s ( where ∈ is the set membership operator ) ∥ every ∥ = λ s .λ t . ( s ⊆ t ) ( where s ⊆ t returns True if s is a subset of t ) ∥ spins ∥ = the set of entities that spin ∥ phobos spins ∥ = ⇒ ( λ s . e phobos ∈ s ) ∥ spins ∥ = ⇒ e phobos ∈ ∥ spins ∥ = ⇒ True ( because Phobos , in our universe of discourse , is in the set of entities that spin ) An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 13

  14. Our approach I: set based MS (con’t) ∥ every moon spins ∥ = ⇒ ( λ s .λ t . ( s ⊆ t )) ∥ moon ∥ ∥ spins ∥ = ⇒ ∥ moon ∥ ⊆ ∥ spins ∥ = ⇒ True ( because all moons in our universe of discourse are in the set of things that spin ) Note: ∥ phobos ∥ has same type as ∥ every moon ∥ An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 14

  15. Our approach II: Use of FDBRs Function Defjned by a Relation (FDBR) First described in Master’s thesis [16] Can take any binary relation and turn it into a function {( } FDBR ( r ) = x , image x : x is a member of the domain of r and image x is the image of x under r ) ({ }) {( )} Example: FDBR ( a , b ) , ( a , c ) , ( a , d ) , ( e , b ) a , { b , c , d } e , { b } ) ( = , What is the mathematical name? Set of images? Album? (Taylor Tracey Kyryliuk) Set of Umbra? (Bryan St. Amour) An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 15

  16. Our approach III: Explicit denotation for transitive verbs e.g. “discover phobos” discover _ rel subj → obj = { ( e hall , e phobos ) , ( e hall , e deimos ) , ( e kuiper , e miranda ) , ( e kuiper , e nereid ) , . . . } etc. This is a relation FDBR ( discover _ rel subj → obj ) = { ( e hall , { e phobos , e deimos } ) , ( e kuiper , { e miranda , e nereid } ) , . . . } etc. This is a function Then ∥ tv tmp ∥ applies ∥ tmp ∥ to each y in every pair ( x , y ) ∈ FDBR subj → obj and if True , add ( x , y ) to the answer. Example: “discover phobos”: { ( x , y ) | ( x , y ) ∈ FDBR subj → obj & ∥ phobos ∥ y . Final answer is all x returned. Another example: “discovered every moon that orbits mars”: { e hall } An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 16

  17. N -ary events and N -ary relations defjne N 2 – Ns FDBR functions e.g. discovery event: <event1030> <subject> <hall> . <event1030> <object> <phobos> . <event1030> <date> <1877> . <event1030> <implement> <refractor_telescope_1> . <event1030> <location> <us_naval_observatory> . plus other events of type discovery Equiv. 5 -ary relation has 5 columns: subject , object , year , implement , location with 20 relations and 20 FDBRs between columns (excluding col to itself). These FDBRs can be used to process “wh..” queries. These FDBRs can also be used to defjne denotations of tvs with prepositional phrases. e.g. FDBR ( discover _ rel implement → object ) = { ( e refractor _ telescope _ 1 , e phobos , e deimos ) , . . . } can be used to answer queries such as “who discovered phobos and deimos with a telescope” An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 17

Recommend


More recommend