<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Machine Comprehension of Text Using Combinatory Categorial Grammar and Answer Set Programs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Piotr Chabierski</string-name>
          <email>piotr.chabierski13@imperial.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessandra Russo</string-name>
          <email>a.russo@imperial.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mark Law</string-name>
          <email>mark.law09@imperial.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Krysia Broda</string-name>
          <email>k.broda@imperial.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computing, Imperial College London</institution>
          ,
          <addr-line>SW7 2AZ</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present an automated method for generating Answer Set Programs from narratives written in English and demonstrate how such a representation can be used to answer questions about text. The proposed approach relies on a transparent interface between the syntax and semantics of natural language provided by Combinatory Categorial Grammars to translate text into Answer Set Programs, hence creating a knowledge base that, together with background knowledge, can be queried.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Machine comprehension of text is a long-term open
problem in Artificial Intelligence and can be assessed
by a machine’s ability to answer questions about
passages of text. One of the main challenges is the
capacity to automatically process the text and capture the
natural language semantics. Various approaches have
been proposed in the literature, e.g.
        <xref ref-type="bibr" rid="ref5">(Bos et al. 2004)</xref>
        ,
in particular for translating natural language sentences
into first-order logic sentences. More recently,
        <xref ref-type="bibr" rid="ref3">(Baral,
Dzifcak, and Son 2008)</xref>
        has followed a di↵erent
direction. Motivated by the need of expressing the (default)
semantics of normative statements, Baral et al. have
provided a first-step towards an automated way for
translating natural language statements into ASP
programs, by making use of an intermediate representation,
called -ASP, to construct the semantic representation
of sentences from its constituents. The -ASP
calculus relies on a combinatory categorial grammar (CCG)
derivation (Steedman 2000) to represent the syntactic
structure of a sentence. To the best of our knowledge,
although e↵ective in expressing normative statements,
this approach is mainly confined to a specific dataset
of sentences. Consequently, the -ASP representation
is limited to the generation of domain-specific semantic
representations, and, as also pointed out by the authors
in
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        , it does not support
more complex linguistic constructs such as adverbs or
conjunction.
      </p>
      <p>
        This paper addresses these limitations by presenting
a fully automated method for generating Answer Set
Programs (ASP) from narratives written in English in
a general and principled manner, demonstrating how
such a representation can be used to answer questions
about text. Similarly to
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        ,
the proposed approach relies on a transparent interface
between syntax and semantics of natural language
offered by Combinatory Categorial Grammars to
translate the text to ASP. The outcome of this translation
creates a form of knowledge base that, together with
background knowledge, can later be queried. However,
the generation of ASP representations from text uses
an intermediate representation, called -ASP⇤
calculus, that di↵ers from the -ASP calculus proposed in
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        in two ways. It is more
general and can handle more advanced grammatical and
linguistic constructions such as, among others,
relativisation, control and raising. It uses a general-purpose
ASP representation language designed with the
objective of making it suitable for ecient automated
learning of common sense knowledge relevant to a given
narrative, by means of current state-of-the-art systems for
learning ASP programs (Law, Russo, and Broda 2014).
Due to space limitations, this latter feature is outside
the scope of the paper. Our proposed fully automated
mechanism is also applicable to the generation of ASP
representation of a large class of questions, including
polar questions and “wh-word” questions that require
single word answers. The main contributions of this
paper are therefore:
• a general-purpose ASP representation for narratives
written in natural language
• a -ASP⇤ calculus that covers complex linguistic
phenomena such as coordination, relativisation, control
and raising
• a wide-coverage algorithm capable of performing
translation from natural language to ASP, and
• an automatic translation into ASP of questions
requiring one-word answers (what, where, who, which).
The e↵ectiveness of the approach is demonstrated by
using a publicly available dataset (Weston et al. 2015)
as well as an hand-crafted set of sentences, specifically
designed to capture the various complex linguistic
constructs supported by the approach.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>In what follows, we outline the two main background
formalisms used in our approach, namely answer set
programming and combinatory categorical grammars.
Answer Set Programming (ASP) is an expressive
language for knowledge representation and reasoning,
based on the stable model semantics (Gelfond and
Lifschitz 1988) and rooted in the field of non-monotonic
reasoning and logic programming (Lifschitz 2008). Within
the scope of this paper, Answer Set Programs are
restricted to normal logic programs. So, an ASP program
is a set of normal rules of the form:
r :</p>
      <p>h
h|ea{dz(}r)
b1, b2, . . . , bm, not bm+1, . . . not bm+k
| }
bod{yz(r)
where h, b1, b2, . . . , bm and not bm+1, . . . not bm+k are
positive and negated atoms respectively with not
denoting negation-as-failure. A fact is a rule whose body is
empty (m = k = 0).</p>
      <p>The Herbrand Base HB(P ) of an ASP program P
is the set of all ground atoms constructed using
predicate symbols, constants and function symbols in P . An
Herbrand interpretation of P assigns a truth value to
every atom in HB(P ) and is a model of P if for every
ground rule r in P such that body(r) is satisfied head(r)
is true. An Herbrand model M of P is minimal if no
proper subset of M is a model of P . Given an ASP
program P and a set M of ground atoms, the reduct P M
of P is the logic program obtained from P by removing
every:
• rule that has a literal not p in its body, where p 2 M
• negated literal in the bodies of the remaining rules
M is an answer set of P if it coincides with the minimal
Herbrand model of P M .</p>
      <p>Combinatory Categorial Grammar (CCG) is
an eciently parsable grammar that enables semantic
analysis of natural language by providing a transparent
interface between syntax and semantics. In CCG, words
are assigned syntactic categories defining their
syntactic behaviour. The set of CCG categories comprises
of atomic categories and complex categories, recursively
constructed from the atomic categories. Examples of
atomic categories include: N (bare noun), N P (noun
phrase) and S (sentence). Complex categories are of the
forms X/Y and X\Y and define functors that, when
applied to an argument of category Y , produce a
result of category X. Directionality of the slash indicates
whether the argument has to occur immediately to the
left “/” or to the right “\” of the functor. For example,
(S\N P )/N P is the category of a transitive verb buy in
a sentence Jack bought a car.</p>
      <p>CCG provides a surface-compositional interface
between syntax and semantics in which there is
one-toone mapping between the rules of syntactic and
semantic composition (Hockenmaier and Steedman 2007). A
set of syntactic combinatory rules specifies how
adjacent constituents are combined. The most basic rules
are forward (FA) and backward (BA) application:
FA (&gt;): X/Y : f
BA (&lt;): Y : a</p>
      <p>Y : a =)
X\Y : f =)</p>
      <p>X : f (a)
X : f (a)
Composition combinatory rules allow two functor
categories to combine and produce another functor.
Example of a composition rule is forward composition (FC):
FC (&gt; B): X/Y : f Y /Z : g =)
X/Z : x.f (g(x))
Type-raising combinatory rules allow an argument
category Y to become a functor category X/(X\Y ) or
X\(X/Y ). Forward type-raising rule (FT) is given by:
FT (&gt; T): Y : a =)</p>
      <p>X/(X\Y ) : f.f (a)
Composition together with type-raising rules are used
to handle coordination and non-local dependencies
introduced, for example, by relative clauses, which is
illustrated by the following syntactic derivation for a
relative clause: that Jack wanted, from a sentence: The
car that Jack wanted was expensive.</p>
      <p>that
(N \N )/(S/N P )</p>
      <p>J ack</p>
      <p>N P</p>
      <p>S/(S\N P )
N \N
&gt; T
S\N P</p>
      <p>wanted
(S\N P )/N P
&gt;
&gt; B
The predicate structure can be obtained directly from
the syntactic derivation, provided that the semantics of
lexical items, assigned by the lexicon, is known. Using
a CCG syntactic derivation and first-order logic
augmented with -calculus, for a sentence: Jack buys cars
derivation of a first-order representation can be
performed as follows:</p>
      <sec id="sec-2-1">
        <title>Jack</title>
        <p>N P : jack
buys
(S\N P )/N P : x.y.buy</p>
      </sec>
      <sec id="sec-2-2">
        <title>S : buy(jack, cars)</title>
        <p>(S\N P ) : y.buy (y, cars)
&lt;
cars
(y, x) N P : cars
&gt;</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Representing Natural Language in ASP</title>
      <p>The signature of the ASP logical representation used in
our approach, to express sentences written in English,
consists of four classes of predicates: nominals, events,
modifiers and prepositions. The name of each
predicate is composed of an arity prefix, which indicates the
number of arguments taken by the corresponding word,
and a class sux, which takes one of the four
aforementioned values. For example, a transitive verb buy is
represented by the predicate: binaryEvent(e1, buy, c1, n0)
where the first argument e1 serves as an identifier, buy
is a lemma of the corresponding word and c1, n0 are
arguments of the verb (agent and theme respectively).
For the sake of conciseness, throughout this paper the
arity prefixes are skipped and nominals, events,
modifiers and prepositions are abbreviated in the predicate
names as nom, ev, mod and prep respectively.</p>
    </sec>
    <sec id="sec-4">
      <title>Preliminary Text Analysis</title>
      <p>First, the input text is split into sentences and tokens.
Subsequently, every word in the input text is tagged
with the following set of annotations:
• Lemma - inflection-free form of the word, used as an
argument of the corresponding predicate
• Part-of-speech (POS) tag - used by the lexicon to
perform coarse division of words into classes
• Named entity tag - enriches the predicate structure
and allows to treat multi-word proper names as single
entities, e.g. Ei↵el Tower as eiffel_tower rather
than a nominal and a modifier
• Coreference cluster - groups mentions of the same
entity in the text. Cluster identifiers are used to form
identifiers of nominal predicates corresponding to
entity mentions, hence embedding coreference
information in the predicate structure
• Semantic role - derived for predicate (verb)
arguments. PropBank sense IDs (Kingsbury and
Palmer 2002) are used to order predicate
arguments when generating predicate structure for verbs.
For example, in a sentence: [Jack]ARG0 kicked [the
ball]ARG1 the transitive verb kicked is translated as:
ev(e1, kick, c0, n0), were c0 and n0 are identifiers of
Jack and the ball and they are ordered according to
their sense IDs (0 and 1 respectively)</p>
      <p>After annotating the text, a CCG parse tree is
derived for each sentence. The CCG parse tree is a binary
tree whose leaf nodes correspond to lexical items and
internal nodes to phrases, clauses or sentences. Leaves
are identified by L as the first argument in the node’s
descriptor, followed by the CCG category, POS tag and
the word itself. Descriptors of the internal nodes begin
with the identifier T, followed by the CCG category.
Listing 1: CCG parse tree for a sentence A new and
safe car that Jack wanted to buy was really expensive.
1 &lt;T S[ dcl ]&gt;
2 &lt;T NP &gt;
3 &lt;L (NP/N) DT A&gt;
4 &lt;T N&gt;
5 &lt;T N&gt;
6 &lt;T (N/N)&gt;
7 &lt;L (N/N) JJ new &gt;
8 &lt;T ((N/N )\( N/N))&gt;
9 &lt;L CONJ CC and &gt;
10 &lt;L (N/N) JJ safe &gt;
11 &lt;L N NN car &gt;
12 &lt;T (N\N)&gt;
13 &lt;L ((N\N )/( S[ dcl ]/ NP )) WDT that &gt;
14 &lt;T (S[ dcl ]/ NP)&gt;
15 &lt;T (S[x ]/( S[x]\ NP ))&gt;
16 &lt;T NP &gt;
17 &lt;L N NNP Jack &gt;
18 &lt;T ((S[ dcl ]\ NP )/ NP)&gt;
19 &lt;L ((S\NP )/( S\NP )) RB really &gt;
20 &lt;T ((S[ dcl ]\ NP )/ NP)&gt;
21 &lt;L ((S[ dcl ]\ NP )/( S[to ]\ NP )) VBD wanted &gt;
22 &lt;T ((S[to ]\ NP )/ NP)&gt;
23 &lt;L ((S[to ]\ NP )/( S[b]\ NP )) TO to &gt;
24 &lt;L ((S[b]\ NP )/ NP) VB buy &gt;
25 &lt;T (S[ dcl ]\ NP)&gt;
26 &lt;L ((S[ dcl ]\ NP )/( S[ adj ]\ NP )) VBD was &gt;
27 &lt;L (S[ adj ]\ NP) JJ expensive &gt;</p>
      <p>Splitting text into sentences, tokenisation,
lemmatisation, POS tagging, named entity recognition and
coreference resolution is performed using Stanford
CoreNLP (Manning et al. 2014). For syntactic parsing
and semantic role labeling EasySRL (Lewis, He, and
Zettlemoyer 2015) is used.</p>
      <p>-ASP⇤ Calculus
| k h{ezads } l|abst{rzactor}s |
-ASP⇤ calculus serves as an intermediate
representation between natural language and ASP. It follows
the syntax of ASP but extends it with abstraction and
application as known from -calculus, which enables
compositional derivation of semantic representations of
phrases and sentences from their constituents. -ASP⇤
expressions have the following general form:
[h1, . . . hk] v 1 . . . v l . p1(a11, . . . ar11 ), . . . pm(a1m, . . . armm ),
m pre{dzicates
}
}
|</p>
      <p>n appl{iczations
where vi and wj are bound variables, arguments ayx are
bound variables or constants and pt are predicate names
included in the previously defined signature. Arities of
predicates and applications are denoted by r1, . . . rm+n.
Every predicate has a non-zero arity; however,
applications can take no arguments. In case of applications,
bound variables wj are referred to as function
placeholders and are replaced by other -ASP⇤ expressions
to which arguments ajm+j , . . . armm++jj are applied.
Predicates and applications constitute the body of a -ASP⇤
expression. Every -ASP⇤ expression has a non-empty
set H of bound variables or constants, called
expression heads, which corresponds to the linguistic head of
a phrase and can have more than one element to
account for coordination. As an example, let us consider
a -ASP⇤ expression for a transitive verb buy, given by:
[e0]v 1.v 0.ev(e0, buy, v0, v1), (v1), (v0)
Constant e0 is an identifier of the verb buy and also
a head of the expression. Bound variables v0, v1 can
be replaced, via the process of application (described
further in this section), by constants and variables –
when the bound variable occurs as a predicate or
application argument, or by other -ASP⇤ expression –
when the bound variable is a function placeholder in
an application. The list of bound variables is followed
by an event predicate and two applications with no
arguments, which act as placeholders for the subject and
object of the verb buy.</p>
      <p>For -ASP⇤ expression e, preds(e) and apps(e)
denote the sets of all predicates and applications in e
respectively and abs(e) denotes the ordered list of bound
variables. The set of heads of e is denoted by He. For
p 2 preds(e), args(p) denotes the ordered list of
arguments of p; the same notation is used for applications.
Given two -ASP⇤ expressions e and f , the application
g = e@f , where v denotes the first bound variable in e,
is computed as follows:
• for every a 2 apps(e) of the form w@(b1, b2, . . . bk),
if v = w, compute recursively f 0 = f @(b1, b2, . . . bk),
which is equivalent to (((f @b1)@b2) . . .)@bk, include
preds(f 0) and apps(f 0) in g, and set f = f 0. If v 2
args(a), |Hf | copies of a are included in g and v in
the ith copy is replaced by the ith head of f . If v 6= w
and v 62 args(a), unmodified a is included in g
• for every p 2 preds(e), if v 2 args(p), |Hf | copies of
p are included in g and v in the ith copy is replaced
by the ith head of f . If v 62 p, p is included in g
unmodified
• bound variables of g are given by: abs(g) = (abs(e)
{v}) + abs(f ), where ‘ ’ denotes removal of an
element from a list and ‘+’ denotes list concatenation
• if v 2 He, Hg = (He\{v}) [ Hf . Otherwise, Hg = He
Constant c is represented by an expression e such that
preds(e) = apps(e) = ; , abs(e) = [ ] and He = { }
c . For
variable v, expression e is modified so that abs(e) = [v].</p>
    </sec>
    <sec id="sec-5">
      <title>Lexicon</title>
      <p>In our approach, lexicon is an algorithm, which given
an input word together with the relevant annotations
(CCG category, POS tag, lemma, coreference cluster)
derives the corresponding -ASP⇤ expression. -ASP⇤
expressions for content words and some prepositions
consist of a single predicate and a di↵erent number
of bound variables and applications. Each word is
assigned to one of five sub-lexicons (nominal, event,
modifier, preposition, wh-word) based on the POS tag and
CCG category, which in turn determines the class of the
corresponding predicate. The arity of a predicate, for
all cases other than adverbs and some function words, is
equal to the number of arguments of the CCG category
of the corresponding word.</p>
      <p>
        Co-indexation is performed for the relevant CCG
categories, such as the ones corresponding to raising and
control verbs or relative pronouns. Our approach
performs co-indexation for all categories listed in
        <xref ref-type="bibr" rid="ref4">(Hockenmaier and Steedman 2005)</xref>
        and it is realised via
application primitive of -ASP⇤ expressions. For example,
for a control verb wanted with a co-indexed CCG
category: (S[dcl]\N Pi)/(S[to]\N Pi) the -ASP⇤ expression
is: v 1.v 2.ev(e1, want, v2, v1), v1@v2. Cases when
coindexation has to be performed are identified by pattern
matching on CCG categories.
      </p>
      <p>Application primitive is also used to translate
coordinate sentences whose constituents have the same
CCG category. For example, in case of an adjective
phrase new and safe the -ASP⇤ expression for
coordinator and is: [v2, v1]v 2.v 1.v 0.(v2)@(v0), (v1)@(v0),
which is inferred from the CCG categories of the
conjuncts, namely (N/N ). In case of conjuncts that
take more than one argument, such as transitive
verbs buy and sell in the sentence: Jack buys and
sells oil, the number of arguments of applications
occurring in the -ASP⇤ expression is set accordingly:
[v3, v2]v 3.v 2.v 1.v 0.(v3)@(v1, v0), (v2)@(v1, v0).</p>
      <p>To ensure the same ordering of verb arguments for
di↵erent grammatical constructions (for example
passive vs. active voice) the arguments are ordered
according to their PropBank semantic role labels.</p>
      <p>Word</p>
      <p>a
new
and
safe
car
that
Jack
really
wanted
to
buy
was
expensive
-ASP Expression
[v0]v 0.(v0)@(n0)
[v0]v 0.mod(new, v0), (v0)
[v2, v1]v 2.v 1.v 0.(v2)@(v0), (v1)@(v0)
[v0]v 0.mod(saf e, v0), (v0)
[v0]v 0.nom(v0, car), (v0)
[v0]v 1.v 0.(v1)@(v0)</p>
      <p>[c0]nom(c0, jack)
[v0]v 0.mod(really, v0), (v0)
[e0]v 1.v 0.ev(e0, want, v0, v1), (v1)@(v0)</p>
      <p>[v0]v 0.v0
[e1]v 1.v 0.ev(e1, buy, v0, v1), (v1), (v0)</p>
      <p>[v0]v 0.(v0)
[expensive]v 0.mod(expensive, v0), (v0)</p>
    </sec>
    <sec id="sec-6">
      <title>Semantic Composition</title>
      <p>The -ASP⇤ expression for a given phrase or sentence
is constructed bottom-up following the structure of the
CCG parse tree. For each leaf node, a -ASP⇤
expression is assigned by the lexicon. For internal nodes, the
relevant CCG combinatory rule is identified, based on
the categories of the child nodes and used to derive
the -ASP⇤ expression compositionally. All
combinatory rules are realised using the -ASP⇤ expression:
v 0.v 1.(v1)@(v0). In case of type-raising rules, child
node’s -ASP⇤ expression is assigned to v0. For
application and composition rules child nodes’ -ASP⇤
expressions are identified as function and argument based
on their CCG categories, the former is assigned to v1
and the latter to v0.</p>
      <p>In our running example, the -ASP⇤ expression for a
noun phrase new and safe car is derived in three steps.
Referring to Table 1, semantic representation for node
in line 9 in Listing 1 is derived as follows:
[v3]v 3.mod(saf e, v3), (v3)}
For the node in line 7, we get the following expression:
[v2]v 2.mod(new, v2), (v2)}
⌘ [v0]v 0.mod(saf e, v0), mod(new, v0), (v0)
Finally, for the node in line 5, we get:
{[v0]v 0.mod(saf e, v0), mod(new, v0), (v0)}@{
[v1]v 1.nom(v1, car), (v1)}
⌘ [v1]v 1.mod(saf e, v1), mod(new, v1),
nom(v1, car), (v1)</p>
    </sec>
    <sec id="sec-7">
      <title>Translation of Questions</title>
      <p>Our approach for generating ASP representations from
text is also applicable to polar questions and questions
that require one word answer, such as questions starting
with wh-words: what, where, who and which.</p>
      <p>For polar questions, the same translation approach,
described so far, is used to derive the corresponding
ASP⇤ expressions with the only di↵erences being that
(inflected) auxiliary verbs: be, do and have are
discarded (translated as the identity -ASP⇤ expression:
[v0]v 0.v0) and constants in the body of the -ASP⇤
expression which do not correspond to definite noun
phrases are replaced with variables. The generated
predicates of -ASP⇤ expression form the body of an
ASP query rule: q body. Two additional rules of the
form ans(yes) q and ans(no) not q are included
to capture the yes and no answers respectively. If all
answer sets of the generated ASP program include the
same ground instance of the fact ans, then the
corresponding value (namely yes or no) is returned as an
answer. Otherwise the answer UNKNOWN is returned.</p>
      <p>In case of wh-questions requiring a one-word answer,
a query predicate is added, whose purpose is to map
the identifier to the actual word corresponding to the
answer. A rule, similar as to the case of polar
questions, is also included, but this time with an additional
literal: ans(W ) nom(I, W ), body. In case the ans(·)
predicate is not in any model of the program, UNKNOWN
answer is returned.</p>
      <p>-ASP⇤ to ASP Conversion
A -ASP⇤ representation, generated from a given text,
may or may not contain bound variables. Hence, the
conversion of a -ASP⇤ into an ASP representations has
to consider two cases.</p>
      <p>In the first case, no bound variables are present.
Hence, the resultant -ASP⇤ expression consists
exclusively of instantiated predicates - ones for which all
predicate arguments are constants. Therefore, each
predicate is converted directly to an ASP fact. The
ASP⇤ expression derived for our running example falls
under this category, hence the following ASP program
is generated:
{nom(c1, jack). nom(n0, car). mod(expensive, n0).
mod(saf e, n0). mod(new, n0). mod(really, e0).
ev(e0, want, c1, e1). ev(e1, buy, c1, n0).}</p>
      <p>In the second case, the list of bound variables in the
resultant -ASP⇤ expression is non-empty, the
expression is converted to a set of normal rules and a set
of facts, which corresponds to universal and existential
quantification of the given sentence. For each rule the
head is the predicate whose identifier is equal to one
of the heads of the -ASP⇤ expression. The body of
each rule is composed incrementally by including every
predicate from the -ASP⇤ expression (di↵erent from
the head predicate) which has a variable among its
arguments that is also an argument of either the head of
the given rule or some other predicate already included
in the body. A set of facts, corresponding to the
existential quantification, is also derived by applying Skolem
constants to the -ASP⇤ expression. As an example,
let us consider a sentence: Jack and Jim enjoy opera,
with the -ASP⇤ expression given by:
[e0]v 1.nom(c1, jack), nom(c2, jim), nom(v1, opera),
ev(e0, enjoy, c1, v1), ev(e0, enjoy, c2, v1)
Using the previously described procedure, the -ASP⇤
expression is converted to the following ASP program:
{ev(e0, enjoy, c1, X)
ev(e0, enjoy, c2, X)
nom(X, opera).</p>
      <p>nom(X, opera).
nom(c1, jack). nom(c2, jim). nom(f1, opera).
ev(e0, enjoy, c1, f1). ev(e0, enjoy, c2, f1).}
The first two rules of the above program can be
intuitively read as: Jack (Jim) enjoys everything that is an
opera. The last two facts state that: there exists an
opera that Jack and Jim enjoy and they allow us to
answer questions such as: What does Jack (Jim) enjoy?</p>
    </sec>
    <sec id="sec-8">
      <title>Exceptions and Default Persistence</title>
      <p>Natural language expressions are often associated with
implicit information that does not follow directly from
their literal meaning and requires background
knowledge to be interpreted correctly. To associate words in
the text with their interpretations, a semantic predicate
is introduced for each predicate in the chosen signature.
For example, for the binary event predicate, the
semantic predicate is defined as: {sem ev(E, L, X, Y )
ev(E, L, X, Y ), not ab ev(E, L, X, Y )}. Definitions of
semantic predicates specify an exception structure.
Consider for instance the implicit negation introduced
by the verb forget, like in the sentence: Jim forgot
to take an umbrella. This implicit negation can be
captured by the following rule: {ab ev(E0, L, X, Y )
sem ev(E1, f orget, X, E0), ev(E0, L, X, Y )}. When
applied to the above example sentence, the rule has
the following grounding: {ab ev(e0, take, c1, n1)
sem ev(e1, f orget, c1, e0), ev(e0, take, c1, n1)}, where c1
and n1 correspond to Jim and umbrella respectively.</p>
      <p>Understanding and keeping track of persistence of
fluents over time plays an important role in text
comprehension. In our approach we assume a linear time
structure in the narratives. Verbs occurring in the text
are associated with implicit time points which are
represented in the generated ASP program by ground
instances of the predicate time(T, E). The argument T
is a positive number equal to the position of the verb,
identified by E, in the text relative to the other verbs.
Persistence is captured using a set of rules motivated
by Event Calculus (Kowalski and Sergot 1986), and
formalised as follows:
sem ev(E, L, X, Y )</p>
      <p>f luent(T, L, X, Y ), time(T, E)
f luent(T, L, X, Y )</p>
      <p>initiate(E, L, X, Y ), time(T, E)
f luent(T1, L, X, Y ) f luent(T2, L, X, Y ),
previous(T2, T1), time(T1, E),
not terminate(E, L, X, Y )
The truth value of the predicate f luent(T, L, X, Y )
persists and can change over timepoints. It is
parametrised by the timepoint T , lemma L of the
corresponding word, which is the name of the fluent, and
arguments of the word. For example, f luent(2, be, c1, n2),
where c1 and n2 are identifiers of Jim and kitchen
means that Jim is in the kitchen at time 2 and he will
continue to be there until termination. Words that are
treated as fluents are specified by providing initiation
and termination rules in the background knowledge.</p>
    </sec>
    <sec id="sec-9">
      <title>Discussion</title>
      <p>
        The dataset used for evaluating our approach consists
of 22 sentences and short stories, 10 of which were
handcrafted, 5 were taken from
        <xref ref-type="bibr" rid="ref1">(Baral and Dzifcak 2012)</xref>
        , 5
from online news articles and 2 from STEP 2008 shared
tasks dataset
        <xref ref-type="bibr" rid="ref6">(Bos 2008a)</xref>
        . Regarding the hand-crafted
examples, correct representations were generated for 9
out of 10. The remaining 12 examples consist of 18
sentences and a correct predicate structure was generated
for 14 of them and for the other 4 the main source of
errors was the CCG parser. Among the 14 sentences,
the representations were fully correct for 9 of them
and for the other 5 some predicates were incorrectly
parametrised due to errors in coreference resolution,
interpretation of noun phrases (distributive vs
collective), semantics of prepositions and lack of support for
expletive sentences and di↵erent types of elliptical
constructions. The results of the evaluation confirm that
our approach can correctly represent sentences with
coordination and non-local dependencies, use coreference
information to resolve personal and possessive pronouns
and capture the semantics of di↵erent parts of speech.
      </p>
      <p>The question answering functionality of the system
was evaluated on The (20) QA bAbI tasks (Weston et
al. 2015) that we also used for learning common sense
knowledge using Inductive Logic Programming, which
is however outside the scope of this paper. Our system
was evaluated on 10 tasks (tasks number: 1, 2, 5, 6, 8,
9, 12, 15, 16, 18) which, among others, required correct
representation of conjunction and generic sentences as
well as temporal and default reasoning to be answered
correctly. Using general (non task-specific) background
knowledge our system achieved 100.0% accuracy for 9
tasks and 93.6% for the other task, which was task 16.
The lower accuracy on that task was due to its
requirement for task specific background knowledge.</p>
    </sec>
    <sec id="sec-10">
      <title>Related Work</title>
      <p>
        The two approaches most related to out work are the
Boxer system
        <xref ref-type="bibr" rid="ref5">(Bos et al. 2004)</xref>
        and the -ASP calculus
described in
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        . The Boxer
system relies on C&amp;C syntactic parser, which uses CCG
and Discourse Representation Theory (DRT) to
generate first-order logic representations from texts written
in English. The system achieves more than 95%
coverage of English newspaper texts
        <xref ref-type="bibr" rid="ref6">(Bos 2008b)</xref>
        and the
generated logical representations are used as an input
to a theorem prover for recognising textual entailment
        <xref ref-type="bibr" rid="ref4">(Bos and Markert 2005)</xref>
        . The Boxer system uses
DRS (Discourse Representation Structure) formalism
to derive semantic representation compositionally. The
first step of the translation algorithm is assignment of
-DRS expressions to the leaf nodes of the parse tree
generated for the sentence by the C&amp;C parser. The
lexicon is derived by manually specifying -DRS
expressions for the majority of the 409 CCG categories
used by the C&amp;C parser. Then, the combinatory rules,
expressed in terms of -DRS expressions are used to
derive the semantics for the internal nodes in a bottom-up
manner as dictated by the structure of the parse tree.
The method for constructing semantic representations
used by the system is a general-purpose one and can be
applied to formalisms other than DRT. Finally, the
DRS is translated into first-order logic. Our approach
uses instead a di↵erent formalism, namely ASP rather
than first-order logic, which makes it arguably easier
to perform inferences necessary in the task of question
answering. With regards to the translation algorithm,
both our approach and the Boxer system generate the
lexicon based on a set of hand-crafted rules which rely
on the CCG category, part-of-speech tag, and lemma of
the given word.
      </p>
      <p>
        The -ASP calculus described in
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and
Son 2008)</xref>
        is used to translate English sentences with
normatives and exceptions into ASP. -ASP
expressions, similarly -DRS used by Boxer, extend the
underlying formalism with application and abstraction as
known from -calculus. Then, -ASP expressions are
used to build semantic representation of phrases and
sentences compositionally. The -ASP expressions, as
presented in
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        , is
constrained to a small subset of English consisting of nouns,
verbs and adjectives and does not support, among
others, adverbs, prepositions and conjunctions. In the
subsequent work (Baral et al. 2011), a method for
automatic generation of lexicon entries from training data
specified as pairs (Si, Li) where Si is the sentence and
Li the corresponding logical representation has been
proposed. Although the approach achieves favorable
results on Geoquery database querying dataset and on
a dataset of logical puzzles
        <xref ref-type="bibr" rid="ref1">(Baral and Dzifcak 2012)</xref>
        ,
the generated logical representations are still
domainspecific and the proposed translation algorithm does
not handle binding and linguistic phenomena such as
coreference or non-local dependencies. In comparison,
our approach o↵ers a systematic treatment of adverbs,
coordination and non-local dependencies, which to the
best of our knowledge,
        <xref ref-type="bibr" rid="ref3">(Baral, Dzifcak, and Son 2008)</xref>
        is not capable of. Di↵erent from -ASP, our approach
does not use a domain-specific logical representation,
bur rather a wide-coverage semantic parser, similarly
to the Boxer system.
      </p>
    </sec>
    <sec id="sec-11">
      <title>Conclusion</title>
      <p>In summary, we have presented a novel approach for
automatically generating ASP representation from text
and questions with single word answers, which makes
use of the CCG’s transparent interface between syntax
and semantics of natural language. To support a
widecoverage semantic parsing of text, we have generalised
the existing formalism of -ASP calculus into a
generalpurpose -ASP⇤ calculus capable of handling additional
complex linguistic constructs. We have also shown how
additional common-sense background knowledge about
persistence and exceptions can be represented and
related with the generated ASP representation of the text
in order to support the answers to questions that are
not directly expressed in text. We are currently
exploring the integration into our approach of current
stateof-the-art systems for learning ASP programs (Law,
Russo, and Broda 2016) in order to automatically learn,
instead of hand-crafting, relevant common sense
knowledge from examples of question-answer pairs. Our
preliminary results on this line of current work have been
very promising.</p>
      <p>Bos, J.</p>
      <p>2008b.</p>
      <p>Wide-coverage semantic analysis
with Boxer. In Proceedings of the 2008 Conference
on Semantics in Text Processing, STEP ’08, 277–286.
Stroudsburg, PA, USA: Association for Computational
Linguistics.</p>
      <p>Gelfond, M., and Lifschitz, V. 1988. The stable model
semantics for logic programming. In Logic
Programming: Proceedings of the 5th International Conference,
1070–1080. MIT Press.</p>
      <p>Hockenmaier, J., and Steedman, M. 2005. CCGbank:
User’s manual. Technical report, Department of
Computer and Information Science, University of
Pennsylvania.</p>
      <p>Hockenmaier, J., and Steedman, M. 2007. CCGbank: A
corpus of CCG derivations and dependency structures
extracted from the Penn Treebank. Comput. Linguist.
33(3):355–396.</p>
      <p>Kingsbury, P., and Palmer, M. 2002. From TreeBank
to PropBank. In Third International Conference on
Language Resources and Evaluation, LREC-02.
Kowalski, R., and Sergot, M. 1986. A logic-based
calculus of events. New Generation Computing 4(1):67–95.
Law, M.; Russo, A.; and Broda, K. 2014. Inductive
learning of answer set programs. In European Workshop
on Logics in Artificial Intelligence, 311–325. Springer.
Law, M.; Russo, A.; and Broda, K. 2016. Iterative
learning of answer set programs from context dependent
examples. arXiv preprint arXiv:1608.01946.
Lewis, M.; He, L.; and Zettlemoyer, L. 2015. Joint A*
CCG parsing and semantic role labelling. In Empirical
Methods in Natural Language Processing.</p>
      <p>Lifschitz, V. 2008. What is Answer Set Programming?
In Proceedings of the 23rd National Conference on
Artificial Intelligence - Volume 3, AAAI ’08, 1594–1597.
AAAI Press.</p>
      <p>Manning, C. D.; Surdeanu, M.; Bauer, J.; Finkel, J.;
Bethard, S. J.; and McClosky, D. 2014. The Stanford
CoreNLP natural language processing toolkit. In
Association for Computational Linguistics (ACL) System
Demonstrations, 55–60.</p>
      <p>Steedman, M. 2000. The Syntactic Process. Cambridge,
MA, USA: MIT Press.</p>
      <p>Weston, J.; Bordes, A.; Chopra, S.; Rush, A. M.; van
Merri¨enboer, B.; Joulin, A.; and Mikolov, T. 2015.
Towards AI-complete question answering: A set of
prerequisite toy tasks. arXiv preprint arXiv:1502.05698.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Dzifcak</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Solving puzzles described in English by automated translation to answer set programming and learning how to do that translation</article-title>
          .
          <source>In Proceedings of the Thirteenth International Conference on Principles of Knowledge Representation and Reasoning</source>
          ,
          <volume>573</volume>
          -
          <fpage>577</fpage>
          . AAAI Press.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2011.
          <article-title>Using inverse lambda and generalization to translate English to formal languages</article-title>
          .
          <source>In Proceedings of the Ninth International Conference on Computational Semantics</source>
          , IWCS '
          <volume>11</volume>
          ,
          <fpage>35</fpage>
          -
          <lpage>44</lpage>
          . Stroudsburg, PA, USA: Association for Computational Linguistics.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Dzifcak</surname>
            , J.; and Son,
            <given-names>T. C.</given-names>
          </string-name>
          <year>2008</year>
          .
          <article-title>Using Answer Set Programming and lambda calculus to characterize natural language sentences with normatives and exceptions</article-title>
          .
          <source>In Proceedings of the 23rd National Conference on Artificial Intelligence</source>
          , volume
          <volume>2</volume>
          <source>of AAAI '08</source>
          ,
          <fpage>818</fpage>
          -
          <lpage>823</lpage>
          . AAAI Press.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Bos</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Markert</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <year>2005</year>
          .
          <article-title>Recognising textual entailment with logical inference</article-title>
          .
          <source>In Proceedings of the Conference on Human Language Technology and Empirical Methods in Natural Language Processing</source>
          , HLT '
          <volume>05</volume>
          ,
          <fpage>628</fpage>
          -
          <lpage>635</lpage>
          . Stroudsburg, PA, USA: Association for Computational Linguistics.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Bos</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Clark</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Steedman,
          <string-name>
            <given-names>M.</given-names>
            ;
            <surname>Curran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. R.</given-names>
            ; and
            <surname>Hockenmaier</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <year>2004</year>
          .
          <article-title>Wide-coverage semantic representations from a CCG parser</article-title>
          .
          <source>In Proceedings of the 20th International Conference on Computational Linguistics</source>
          , COLING '
          <fpage>04</fpage>
          .
          <string-name>
            <surname>Stroudsburg</surname>
          </string-name>
          , PA, USA: Association for Computational Linguistics.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Bos</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2008a</year>
          .
          <article-title>Introduction to the shared task on comparing semantic representations</article-title>
          .
          <source>In Proceedings of the 2008 Conference on Semantics in Text Processing</source>
          , STEP '
          <volume>08</volume>
          ,
          <fpage>257</fpage>
          -
          <lpage>261</lpage>
          . Stroudsburg, PA, USA: Association for Computational Linguistics.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>