Semantic Parsing to Linked Data
Transcript of Semantic Parsing to Linked Data
Semantic Parsing to Linked Data
Michael Roth
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.
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.
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)
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
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
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
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
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
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
.
.
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
.
.
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
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
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
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
.
.
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.
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.
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
19
Applications
Putting the Pieces Together
10 September 2014
Implemented Software
Component
Requirements Document
DB
RDF Triples
OWL Ontology
Applications
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
21
Thank you!
10 September 2014
22
Questions?
10 September 2014