Top Banner
Semantic Parsing to Linked Data Michael Roth
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Semantic Parsing to Linked Data

Semantic Parsing to Linked Data

Michael Roth

Page 2: Semantic Parsing to Linked Data

2

Ewan forgot the mozzarella in his car.

Semantic Parsing

10 September 2014

∃x0 named(x0, ewan, person) ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧ in(x1, x2) ∧∃e event(e) forget(e) agent(e, x0) ∧ ∧ ∧ patient(e, x1)

Definition: process of mapping natural language text into a formal representation of its meaning.

Page 3: Semantic Parsing to Linked Data

3

Ewan forgot the mozzarella in his car.

Semantic Parsing

10 September 2014

∃x0 named(x0, ewan, person) ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧ in(x1, x2) ∧∃e event(e) forget(e) agent(e, x0) ∧ ∧ ∧ patient(e, x1)

Definition: process of mapping natural language text into a formal representation of its meaning.

Page 4: Semantic Parsing to Linked Data

4

Ewan forgot the mozzarella in his car.

Semantic Role Labelling

10 September 2014

Mapping to a shallow semantic representation of predicates and associated semantic arguments

∃x0 named(x0, ewan, person) ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧ in(x1, x2) ∧∃e event(e) forget(e) agent(e, x0) ∧ ∧ ∧ patient(e, x1)

Page 5: Semantic Parsing to Linked Data

5

Ewan forgot the mozzarella in his car.

Semantic Role Labelling

10 September 2014

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧∃e event(e) forget(e) agent(e, x0) ∧ ∧ ∧ patient(e, x3) ∧ in(e, x2)

Mapping to a shallow semantic representation of predicates and associated semantic arguments

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧∃e event(e) ∧ forget(e) agent(e, x0) ∧ ∧ patient(e, x3) ∧ in(e, x2)

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car←———his ∧Ewan—actor→forget) Ewan———↗ ↖ ———mozzarella

Page 6: Semantic Parsing to Linked Data

6

Ewan forgot the mozzarella in his car.

Semantic Role Labelling

10 September 2014

Mapping to a shallow semantic representation of predicates and associated semantic arguments

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧∃e event(e) ∧ forget(e) agent(e, x0) ∧ ∧ patient(e, x3) ∧ in(e, x2)

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car←owner—his car—location ∧Ewan—actor→forget) ↓ Ewan—actor↗ ↖theme—mozzarella

Page 7: Semantic Parsing to Linked Data

7

Ewan forgot the mozzarella in his car.

Semantic Role Labelling

10 September 2014

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧∃e event(e) forget(e) agent(e, x0) ∧ ∧ ∧ patient(e, x3) ∧ in(e, x2)

Motivation: identify who did what to whom, where, why and how, etc.

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car(x2) of(x2,x0) ∧ ∧∃e event(e) ∧ forget(e) agent(e, x0) ∧ ∧ patient(e, x3) ∧ in(e, x2)

∃x0 named(x0, ewan, per) male(x0) ∧ ∧∃x1 mozzarella(x1) ∧∃x2 car←owner—his car—location ∧Ewan—actor→forget) ↓ Ewan—actor↗ ↖theme—mozzarella

Page 8: Semantic Parsing to Linked Data

8

S-CASE Project

CASE: Computer Assisted Software Engineering Plethora of software solutions already available Could be (re)used for rapid prototyping

The role of UEDIN in this project: Analyse textual requirements of existing

solutions that describe their functionalities Provide a search interface for finding solutions

10 September 2014

Page 9: Semantic Parsing to Linked Data

9

Functional Requirements

Properties Discussed by developers and customers Basis for work plans, implementations, etc.

Examples“The user must be able to login to his account.”“The system should store all activities.”…

10 September 2014

Page 10: Semantic Parsing to Linked Data

10

Pre-processing

Before mapping text to meaning representations: Tokenization Part-of-speech tagging and lemmatization Syntactic dependency parsing

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Page 11: Semantic Parsing to Linked Data

11

Semantic Analysis

Several steps of analysis are required Find “predicates” in a sentence Identify potential arguments Classify arguments of each predicate

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Page 12: Semantic Parsing to Linked Data

12

Semantic Analysis—Detailed View

Several steps of analysis are required Find “predicates” in a sentence Identify potential arguments Classify arguments of each predicate

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Assigned part-of-speech Number of children Parent word form

Page 13: Semantic Parsing to Linked Data

13

Semantic Analysis—Detailed View

Several steps of analysis are required Find “predicates” in a sentence Identify potential arguments Classify arguments of each predicate

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Assigned part-of-speech Labelled path to predicate (Other) children of pred

Page 14: Semantic Parsing to Linked Data

14

Semantic Analysis—Detailed View

Several steps of analysis are required Find “predicates” in a sentence Identify potential arguments Classify arguments of each predicate

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Head word of argument Relative position Labelled dependency

Page 15: Semantic Parsing to Linked Data

15

What about Linked Data?

Once we identified all predicates and arguments We can map them into a structured format Link with other information and share online Store in a database for downstream applications

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

Page 16: Semantic Parsing to Linked Data

16

The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

RDF Representation

Storing SRL predicates and arguments Define one entity per relevant word token

(predicates and arguments can coincide) Use RDF triples to describe relations

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .

:x0 a :user :e0 a :login

The user must be able to login to his account .

:x0 a :user; :e0 a :login;

:actor_of :e0. :has_actor :x0;

:acts_on :x1.

Page 17: Semantic Parsing to Linked Data

17

The user must be able to login to his account .

theDT

userNN

mustMD

beVB

ableJJ

toTO

loginVB

toTO

hisPRP

accountNN

.

.

RDF Representation (cont.)

The bigger scheme: what are users, logins, etc.? Ontology defines classes, relations, restrictions user is-a actor is-a thingtype is-a concept ACTOR_OF(x, y) ↔ HAS_ACTOR(y, x)

“The user must be able to login to his account.”

10 September 2014

The user must be able to login to his account .

_:x0 a :user _:e0 a :login

The user must be able to login to his account .

:x0 a :user; :e0 a :login;

:actor_of :e0. :has_actor :x0;

:acts_on :x1.

Page 18: Semantic Parsing to Linked Data

18

Advantages for Applications Ontology defines concept types and relations

Finite set of pre-defined symbols

user is-a actor is-a thingtype is-a concept subclasses can be exploited for search

ACTOR_OF(x, y) ↔ HAS_ACTOR(y, x) Axioms for detecting inconsistencies

and inferring missing relations

10 September 2014

Page 19: Semantic Parsing to Linked Data

19

Applications

Putting the Pieces Together

10 September 2014

Implemented Software

Component

Requirements Document

DB

RDF Triples

OWL Ontology

Applications

Page 20: Semantic Parsing to Linked Data

20

Conclusions Semantic parsing is an important prerequisite for

computational natural language understanding

Results of shallow semantic analysis can be represented in a structured format for downstream applications

Linked data helps us to connect and share information on existing software solutions and makes efficient search possible

10 September 2014

Page 21: Semantic Parsing to Linked Data

21

Thank you!

10 September 2014

Page 22: Semantic Parsing to Linked Data

22

Questions?

10 September 2014