Diagram of the architecture:
LFT logic form of text T
||
|| Syntactic Translator
||
\/
ATM logic form of T
||
|| Semantic Translator
||
\/
ATM semantic representation of T
||
|| Module Selector
||
\/
ASP theory, Th(T), relevant to T
LFT logic form of hypothesis H
||
|| Syntactic Translator
||
\/
ATM logic form of H, LF(H)
||
|| Semantic Translator
||
\/
ATM semantic representation, R(H), of H
||
|| Post-processor
||
\/
generates rules
yes :- R(H)
a rule no :- -S for every S in R(H)
unknown :- not yes, not no
combines them with Th(T)
calls ASP solver
The Syntactic Translator and the Post-processor are written in some
scripting language.
Semantic translator and library knowledge modules are written in ASP-Prolog
or its variants.
In what follows we illustrate each step by example from (a modification of)
pair #21:
T: North Korea opened relations with 10 other countries: Belgium and Brazil
and Canada and Germany and Greece and Kuwait and Luxembourg and the
Netherlands and New Zealand and Spain.
H: Spain and Korea started ambassadorial relations.
LFT logic form of text T -- notice that LFT does not handle properly "10
other countries":
north_NN(x1) & korea_NN(x2) & nn_NNC(x3,x1,x2) & _country_NE(x3) &
open_VB_2(e1,x3,x4) & relation_NN_1(x4) & with_IN(x4,x26) & 10_NN(x5) &
_number_NE(x5) & other_JJ_1(x20,x6) & country_NN_2(x6) & year_NN_1(x7) &
belgium_NN(x8) & _country_NE(x8) & and_CC(x21,x8,x9,x10,x11) & brazil_NN(x9)
& _country_NE(x9) & canada_NN(x10) & _country_NE(x10) & germany_NN(x11) &
_country_NE(x11) & and_CC(x26,x21,x25) & greece_NN(x12) & _country_NE(x12) &
and_CC(x22,x12,x13,x14) & kuwait_NN(x13) & _country_NE(x13) &
luxembourg_NN(x14) & _country_NE(x14) & and_CC(x25,x22,x24) &
netherlands_NN(x15) & _country_NE(x15) & and_CC(x24,x15,x23) & New_NN(x16) &
zealand_NN(x17) & nn_NNC(x18,x16,x17) & _country_NE(x18) &
and_CC(x23,x18,x19) & spain_NN(x19) & _country_NE(x19) & MEA_SR(x5,x6) &
THM_SR(x4,e1)
The syntactic translator transforms LFT logic form in a format amenable for
use in A-Prolog programs. The process includes translating the relation
and_CC with variable number of arguments (used in LFT logic form for "and")
into a relation with fixed number of arguments (cc). The resulting ATM logic
form of T is:
nn(x1,north,1).
nn(x2,korea,1).
nnc(x3,x1,x2,nn,1).
ne(x3,country,1).
vb(e1,x3,x4,open,2).
nn(x4,relation,1).
in(x4,x26,with,1).
cc(x26,x21,x25,cc_and,1).
cc(x21,x8,x9_prime,cc_and,1).
nn(x8,belgium,1).
ne(x8,country,1).
cc(x9_prime,x9,x10_prime,cc_and,1).
nn(x9,brazil,1).
ne(x9,country,1).
[...]
syntevent(e1).
syntobj(x1).
syntobj(x10).
syntobj(x10_prime).
syntobj(x11).
[...]
The semantic translator, SemT, uses a universal hierarchy, UH, of classes
(to be gradually developed in our work). In the above example we only use
one class, <country>.
SemT(<Sent>) contains the description of the objects of the domain of
LF(<Sent>) and the encoding of <Sent> in the form of recorded history a la
action languages.
SemT contains, for example, the axioms that generate appropriate sets
whenever objects are connected by "and" in <Sent> (the process was described
during December's site visit at TTU):
set(X) :- cc(X,X1,X2,cc_and,1).
disjoint_union(X,X1,X2) :- cc(X,X1,X2,cc_and,1).
Another example is the axiom that, given a statement "X opened relations
with Y" adds to the recorded history the occurrence of an action
open(rel(X,Y)):
o(open(rel(X1,X3)),T) :- vb(E,X1,X2,open,2),
nn(X2,relation,1),
in(X2,X3,with,1).
In a similar way, we determine when the relationship is diplomatic:
diplomatic(rel(X1,X3)) :- vb(E,X1,X2,open,2),
nn(X2,relation,1),
in(X2,X3,with,1),
not -diplomatic(rel(X1,X3)).
The ATM semantic representation of T for pair #21 is:
name(x8,belgium)
name(x9,brazil)
sort(country,x8)
sort(country,x9)
set(x26)
disjoint_union(x26,x21,x25)
set(x21)
disjoint_union(x21,x8,x9_prime)
o(open(rel(x3,x8)),0)
diplomatic(rel(x3,x8))
[...]
The ASP theory for pair #21 includes the ATM semantic representation,
together with axioms that describe the effects of action open(rel(X,Y)),
such as:
h(opened(O),I2) :-
next(I2,I1),
o(open(O),I1).
h(ambassadorial(rel(XC,YC)),I) :-
diplomatic(rel(XC,YC)),
h(opened(rel(XC,YC)),I),
country(XC),
country(YC),
not -default(d1(XC,YC)),
not -h(ambassadorial(rel(XC,YC)),I).
The processing of hypothesis H works in a similar way, giving for pair #21
the ATM semantic representation:
name(x2,korea)
name(x1,spain)
o(open(rel(x1,x2)),0)
o(open(rel(x2,x1)),0)
h(ambassadorial(rel(x1,x2)),1)
h(ambassadorial(rel(x2,x1)),1)
[...]
The post-processing step gives for pair #21 the rules (Q(H)):
yes :- name(X1,spain), name(X2,korea),
o(open(rel(X1,X2)),0),
o(open(rel(X2,X1)),0),
h(ambassadorial(rel(X1,X2)),1),
h(ambassadorial(rel(X2,X1)),1).
no :- name(X1,spain), name(X2,korea),
-o(open(rel(X1,X2)),0).
no :- name(X1,spain), name(X2,korea),
-o(open(rel(X2,X1)),0).
[...]
unknown :- not yes, not no.
For pair #21, running the ASP solver on Th(T) + Q(H) produces answer "yes",
as expected.
We are attaching the A-Prolog files used in the various steps of the
translation. Please keep in mind that most of the files are at a very early
stage of development and still need to be substantially cleaned up.
ATM logic form of T: T.pl.
ATM logic form of H: H.pl.
Semantic Translator:
axioms.pl, sets.mod, interface.pl
Component of ASP theory for pair #21:
pair2.pl
Relation name(X,NAME) is employed in a rough form of anaphora resolution
between T and H (but not inside T). Among other things, the approach we
follow allows to resolve anaphora when "North" or "South" are dropped from
the name of a country (e.g. "North Korea" and "South Korea").
Please note that the representation of sets (among other things) is
tentative and may change.
We have developed a prototype of the architecture. The prototype is capable
of finding automatically the answer to pair #21, and we expect to make it
available to you soon.