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

an extensible natural language query interface to an
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 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

slide-3
SLIDE 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

slide-4
SLIDE 4

Demonstration

The Web Page The list of event-based triples The natural language interface

1

Example queries with nouns, pnouns, intransitive verbs, conjunction and disjunction

2

Example queries with quantifjers

3

Example queries with transitive verbs

4

Example queries with prepositions

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 4

slide-5
SLIDE 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

slide-6
SLIDE 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

slide-7
SLIDE 7

Montague Semantics

Note: ∥w∥ is the denotation of w

∥spin∥ = spins_pred ∥phobos∥ = λp.p ephobos ∥phobos spins∥ = ⇒∥phobos∥ ∥spins∥ = ⇒λp.p ephobos ∥spins∥ = ⇒λp.p ephobos spins_pred = ⇒spins_pred ephobos = ⇒True

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 7

slide-8
SLIDE 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

slide-9
SLIDE 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

slide-10
SLIDE 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

slide-11
SLIDE 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

slide-12
SLIDE 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

slide-13
SLIDE 13

Our approach I: set based MS

FLMS: Modify MS for effjciency

∥phobos∥ = λs.ephobos ∈ 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.ephobos ∈ s) ∥spins∥

=

⇒ ephobos ∈ ∥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

slide-14
SLIDE 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

slide-15
SLIDE 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, imagex

) : x is a member of the domain of r and imagex 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

slide-16
SLIDE 16

Our approach III: Explicit denotation for transitive verbs

e.g. “discover phobos” discover_relsubj→obj = {(ehall, ephobos), (ehall, edeimos), (ekuiper, emiranda), (ekuiper, enereid), . . .}

  • etc. This is a relation

FDBR(discover_relsubj→obj) = {(ehall, {ephobos, edeimos}), (ekuiper, {emiranda, enereid}), . . .}

  • etc. This is a function

Then ∥tv tmp∥ applies ∥tmp∥ to each y in every pair (x, y) ∈ FDBRsubj→obj and if True, add

(x, y) to the answer.

Example: “discover phobos”: {(x, y)|(x, y) ∈ FDBRsubj→obj & ∥phobos∥ y. Final answer is all x returned. Another example: “discovered every moon that orbits mars”: {ehall}

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 16

slide-17
SLIDE 17

N-ary events and N-ary relations defjne N2–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_relimplement→object) = {(erefractor_telescope_1, ephobos, edeimos), . . .} 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

slide-18
SLIDE 18

Passive transitive verbs and queries with simple prepositional phrases

“discovered by hall” Create appropriate FDBR, e.g. for passive voice use: FDBR(discover_relobj→subj) =

{(edeimos, {ehall}), (ephobos, {ehall}), (emiranda, {ekuiper}), (enereidr, {ekuiper}), . . .}

then process as with active voice for “was discovered with a telescope” use: FDBR(discover_relobj→implement) =

{(edeimos, {erefractor_telescope_1}), (ephobos, {erefractor_telescope_1}), . . .}

then process as with active voice

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 18

slide-19
SLIDE 19

Chained prepositional phrases

Change FDBRx→y to include the event_ids which relate x to y values.

∥tv∥ changed to take a list of a possibly empty list of PPs after the possibly empty

termphrase Each PP fjlters the previous FDBR to select only those pairs that satisfy the PP E.g… “in 1877” checks for events which are related by “….date” to “…1877” and the tv passes the fjltered FDBR to be processed by the next PP. Details in the paper

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 19

slide-20
SLIDE 20

Scoping

Outermost/leftmost scoping after syntactic parsing

a planet is orbited by two moons that were discovered by kuiper – False kuiper discovered two moons that orbit a planet – True a planet is orbited by two moons that were discovered by hall – True hall discovered two moons that orbit a planet – True

Prepositional scoping:

every moon that orbits Neptune was discovered with a telescope or voyager_2 – True a telescope or voyager_2 was used to discover every moon that orbits Neptune – False

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 20

slide-21
SLIDE 21

Superlatives

“who discovered the largest moon” several meanings, some depending on comparison set Absolute superlative: “who discovered Ganymede” Comparative superlative: “who, of the discoverers in question discovered the largest moon” FDBR(discover_relsubj→obj) =

{(ehall, {ephobos, edeimos}), (ekuiper, {emiranda, enereid}), (egalileo, {eio, eganymede, . . .}), . . .}

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 21

slide-22
SLIDE 22

Polysemy

polysemy – e.g. “depart” – use event data and PPs

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 22

slide-23
SLIDE 23

Implementation

Virtuoso[5] software used to store triples in a triplestore with a SPARQL endpoint. Only basic SPARQL retrieval commands used by NLI NLI constructed as an executable attribute grammar in Haskell XSAIGA Parser combinators from Hackage are used to construct the EAG

hsparql package used to communicate with SPARQL endpoint from Haskell program

Haskell program also runs on a wireless router with acceptable speed Shane Peelar is building special-purpose hardware for semantic computation.

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 23

slide-24
SLIDE 24

Our Previous Work

SEMANTICS:

  • R. A. Frost, B. S. Amour, and R. Fortier. “An Event Based Denotational Semantics for

Natural Language Queries to Data Represented in Triple Stores”. In: proc. of ICSC 2013.

  • IEEE. Sept. 2013, pp. 142–145
  • R. A. Frost. “Realization of natural language interfaces using lazy functional programming”.

In: ACM Computing Surveys (CSUR) 38.4 (2006), p. 11

  • S. Peelar. “Accommodating prepositional phrases in a highly modular natural language

query interface to semantic web triplestores using a novel event-based denotational semantics for English and a set of functional parser combinators”. MA thesis. University of Windsor (Canada), 2016

  • R. A. Frost, W. Agboola, and E. Matthews. “Querying Graph-structured Data Using Natural

Language”. In: proc. GraphQ Workshop EDBT/ICDT 2104. 2014, pp. 192–199

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 24

slide-25
SLIDE 25

Our Previous Work (con’t)

PARSING:

  • R. Hafjz and R. Frost. “Lazy Combinators for Executable Specifjcations of General Attribute

Grammars”. In: proc. of the 12th int. symp. on Practical Aspects of Declarative lang. (PADL). ACM-SIGPLAN. Jan. 2010, pp. 167–182

  • R. A. Frost, R. Hafjz, and P. C. Callaghan. “Modular and effjcient top-down parsing for

ambiguous left-recursive grammars”. In: Proceedings of the 10th International Conference on Parsing Technologies. Association for Computational Linguistics. 2007, pp. 109–120

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 25

slide-26
SLIDE 26

Related work: NLIs to DBs or the Semantic Web

  • M. G. Main and D. Benson. “Denotational Semantics for a Natural Language Question

Answering Program”. In: Comput. linguist. 9.1 (1983), pp. 11–21

  • P. Cimiano, P. Haase, and J. Heizmann. “Porting Natural Language Interfaces Between

Domains: an Experimental User Study With the ORAKEL System”. In: Proc. 12th Intnl.

  • Conf. on intell. User Interfaces. ACM. 2007, pp. 180–189
  • J. Van Eijck and C. Unger. Computational semantics with functional programming. Cambridge

University Press, 2010

  • S. Ferre. “SQUALL: A Controlled Natural Language for Querying and Updating RDF

Graphs”. In: proc. of CNL 2012. LNCS 7427. 2012, pp. 11–25

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 26

slide-27
SLIDE 27

Related work: Compositional Semantics

  • R. Montague. “English as a formal language”. In: (1970) In Bruno Visentini (ed.),

Linguaggi nella societa e nella tecnica. Edizioni di Communita. pp. 188-221

Abstract

I reject the contention that an important theoretical difgerence exists between formal and natural languages.

  • W. Zadrozny. “From compositional to systematic semantics”. In: Linguistics and philosophy

17.4 (1994), pp. 329–342 W.-P. De Roever, F. de Boer, U. Hanneman, J. Hooman, Y. Lakhnech, M. Poel, and

  • J. Zwiers. Concurrency Verifjcation: Introduction to Compositional and Non-compositional
  • Methods. Vol. 54. Cambridge University Press, 2001
  • L. Champollion. “The interaction of compositional semantics and event semantics”. In:

Linguistics and Philosophy 38.1 (2015), pp. 31–66

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 27

slide-28
SLIDE 28

Related work: Compositional Semantics (con’t)

  • F. Gayral, D. Kayser, and F. Lévy. “Challenging the principle of compositionality in

interpreting natural language texts”. In: The Compositionality of Meaning and Content 2 (2005), pp. 83–106

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 28

slide-29
SLIDE 29

Future Work

Convert DBpedia to event format Accommodate negation, superlatives and polysemy Speech frontend Intelligent things – cofgee maker, children’s toys

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 29

slide-30
SLIDE 30

Thank You & Feedback

Thank you for attending! Questions, comments, or suggestions?

This research was funded by NSERC of Canada.

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 30

slide-31
SLIDE 31

References

[1]

  • L. Champollion. “The interaction of compositional semantics and event semantics”.

In: Linguistics and Philosophy 38.1 (2015), pp. 31–66 (cit. on p. 27). [2]

  • P. Cimiano, P. Haase, and J. Heizmann. “Porting Natural Language Interfaces

Between Domains: an Experimental User Study With the ORAKEL System”. In: Proc. 12th Intnl. Conf. on intell. User Interfaces. ACM. 2007, pp. 180–189 (cit. on p. 26). [3] W.-P. De Roever, F. de Boer, U. Hanneman, J. Hooman, Y. Lakhnech, M. Poel, and

  • J. Zwiers. Concurrency Verifjcation: Introduction to Compositional and

Non-compositional Methods. Vol. 54. Cambridge University Press, 2001 (cit. on p. 27). [4]

  • D. Dowty, R. Wall, and S. Peters. Introduction to Montague Semantics. Dordrecht,

Boston, Lancaster, Tokyo: D. Reidel Publishing Company, 1981 (cit. on p. 11). [5]

  • O. Erling and I. Mikhailov. “Virtuoso: RDF support in a native RDBMS”. In: Semantic

Web Information Management. Springer, 2010, pp. 501–519 (cit. on p. 23).

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 31

slide-32
SLIDE 32

References (con’t)

[6]

  • S. Ferre. “SQUALL: A Controlled Natural Language for Querying and Updating RDF

Graphs”. In: proc. of CNL 2012. LNCS 7427. 2012, pp. 11–25 (cit. on p. 26). [7]

  • R. A. Frost. “Realization of natural language interfaces using lazy functional

programming”. In: ACM Computing Surveys (CSUR) 38.4 (2006), p. 11 (cit. on pp. 12, 24). [8]

  • R. A. Frost, W. Agboola, and E. Matthews. “Querying Graph-structured Data Using

Natural Language”. In: proc. GraphQ Workshop EDBT/ICDT 2104. 2014, pp. 192–199 (cit. on p. 24). [9]

  • R. A. Frost, B. S. Amour, and R. Fortier. “An Event Based Denotational Semantics for

Natural Language Queries to Data Represented in Triple Stores”. In: proc. of ICSC

  • 2013. IEEE. Sept. 2013, pp. 142–145 (cit. on p. 24).

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 32

slide-33
SLIDE 33

References (con’t)

[10]

  • R. A. Frost, R. Hafjz, and P. C. Callaghan. “Modular and effjcient top-down parsing

for ambiguous left-recursive grammars”. In: Proceedings of the 10th International Conference on Parsing Technologies. Association for Computational Linguistics. 2007,

  • pp. 109–120 (cit. on p. 25).

[11]

  • F. Gayral, D. Kayser, and F. Lévy. “Challenging the principle of compositionality in

interpreting natural language texts”. In: The Compositionality of Meaning and Content 2 (2005), pp. 83–106 (cit. on p. 28). [12]

  • R. Hafjz and R. Frost. “Lazy Combinators for Executable Specifjcations of General

Attribute Grammars”. In: proc. of the 12th int. symp. on Practical Aspects of Declarative

  • lang. (PADL). ACM-SIGPLAN. Jan. 2010, pp. 167–182 (cit. on p. 25).

[13]

  • R. Hafjz. “Executable Attribute Grammars for Modular and Effjcient Natural

Language Processing”. In: (2011) (cit. on p. 10).

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 33

slide-34
SLIDE 34

References (con’t)

[14]

  • M. G. Main and D. Benson. “Denotational Semantics for a Natural Language Question

Answering Program”. In: Comput. linguist. 9.1 (1983), pp. 11–21 (cit. on p. 26). [15]

  • R. Montague. “English as a formal language”. In: (1970) (cit. on pp. 9, 27).

[16]

  • S. Peelar. “Accommodating prepositional phrases in a highly modular natural

language query interface to semantic web triplestores using a novel event-based denotational semantics for English and a set of functional parser combinators”. MA thesis. University of Windsor (Canada), 2016 (cit. on pp. 15, 24). [17]

  • J. Van Eijck and C. Unger. Computational semantics with functional programming.

Cambridge University Press, 2010 (cit. on p. 26). [18]

  • W. Zadrozny. “From compositional to systematic semantics”. In: Linguistics and

philosophy 17.4 (1994), pp. 329–342 (cit. on p. 27).

An Extensible Natural-Language Query Interface to an Event-Based Semantic Web Triplestore Frost, Peelar 34