Joint Relational Embeddings for Knowledge-based Question Answering

Transforming a natural language (NL) question into a corresponding logical form (LF) is central to the knowledge-based question answering (KB-QA) task. Unlike most previous methods that achieve this goal based on mappings between lex-icalized phrases and logical predicates, this paper goes one step further and proposes a novel embedding-based approach that maps NL-questions into LFs for KB-QA by leveraging semantic associations between lexical representations and KB-properties in the latent space. Experimental results demonstrate that our proposed method outperforms three KB-QA base-line methods on two publicly released QA data sets.


Introduction
Knowledge-based question answering (KB-QA) involves answering questions posed in natural language (NL) using existing knowledge bases (KBs). As most KBs are structured databases, how to transform the input question into its corresponding structured query for KB (KB-query) as a logical form (LF), also known as semantic parsing, is the central task for KB-QA systems. Previous works (Mooney, 2007;Liang et al., 2011;Cai and Yates, 2013;Fader et al., 2013;Berant et al., 2013;Bao et al., 2014) usually leveraged mappings between NL phrases and logical predicates as lexical triggers to perform transformation tasks in semantic parsing, but they had to deal with two limitations: (i) as the meaning of a logical predicate often has different natural language expression (NLE) forms, the lexical triggers extracted for a predicate may at times are limited in size; (ii) entities detected by the named entity recognition (NER) component will be used to compose the logical forms together with the logical predicates, so their types should be consistent with the predicates as well. However, most NER components used in existing KB-QA systems are independent from the NLE-to-predicate mapping procedure.
We present a novel embedding-based KB-QA method that takes all the aforementioned limitations into account, and maps NLE-to-entity and NLE-to-predicate simultaneously using simple vector operations for structured query construction. First, low-dimensional embeddings of n-grams, entity types, and predicates are jointly learned from an existing knowledge base and from entries <entity subj , NL relation phrase, entity obj > that are mined from NL texts labeled as KBproperties with weak supervision. Each such entry corresponds to an NL expression of a triple <entity subj , predicate, entity obj > in the KB. These embeddings are used to measure the semantic associations between lexical phrases and two properties of the KB, entity type and logical predicate. Next, given an NL-question, all possible structured queries as candidate LFs are generated and then they are ranked by the similarity between the embeddings of observed features (n-grams) in the NL-question and the embeddings of logical features in the structured queries. Last, answers are retrieved from the KB using the selected LFs.
The contributions of this work are two-fold: (1) as a smoothing technique, the low-dimensional embeddings can alleviate the coverage issues of lexical triggers; (2) our joint approach integrates entity span selection and predicate mapping tasks for KB-QA. For this we built independent entity embeddings as the additional component, solving the entity disambiguation problem.

Related Work
Supervised semantic parsers (Zelle and Mooney, 1996;Zettlemoyer and Collins, 2005;Mooney, 2007) heavily rely on the <sentence, semantic an-notation> pairs for lexical trigger extraction and model training. Due to the data annotation requirement, such methods are usually restricted to specific domains, and struggle with the coverage issue caused by the limited size of lexical triggers.
Studies on weakly supervised semantic parsers have tried to reduce the amount of human supervision by using question-answer pairs (Liang et al., 2011) or distant supervision (Krishnamurthy and Mitchell, 2012) instead of full semantic annotations. Still, for KB-QA, the question of how to leverage KB-properties and analyze the question structures remains. Bordes et al. (2012) and Weston et al. (2013) designed embedding models that connect free texts with KBs using the relational learning method (Weston et al., 2010). Their inputs are often statement sentences which include subject and object entities for a given predicate, whereas NLquestions lack either a subject or object entity that is the potential answer. Hence, we can only use the information of a subject or object entity, which leads to a different training instance generation procedure and a different training criterion.
Recently, researchers have developed open domain systems based on large scale KBs such as FREEBASE 1 (Cai and Yates, 2013;Fader et al., 2013;Berant et al., 2013;Kwiatkowski et al., 2013;Bao et al., 2014;Berant and Liang, 2014;Yao and Van Durme, 2014). Their semantic parsers for Open QA are unified formal and scalable: they enable the NL-question to be mapped into the appropriate logical form. Our method obtains similar logical forms, but using only lowdimensional embeddings of n-grams, entity types, and predicates learned from texts and KB.

Relational Components for KB-QA
Our method learns semantic mappings between NLEs and the KB 2 based on the paired relationships of the following three components: C denotes a set of bag-of-words (or n-grams) as context features (c) for NLEs that are the lexical representations of a logical predicate (p) in KB; T denotes a set of entity types (t) in KB and each type can be used as the abstract expression of a subject entity (s) that occurs in the input question; P denotes a set of logical predicates (p) in KB, each of which is the canonical form of different NLEs sharing an identical meaning (bag-of-words; c).
Based on the components defined above, the paired relationships are described as follows: T -P can investigate the relationship between subject entity and logical predicate, as object entity is always missing in KB-QA; C-T can scrutinize subject entity's attributes for the entity span selection such as its positional information and relevant entity types to the given context, which may solve the entity disambiguation problem in KB-QA; C-P can leverage the semantic overlap between question contexts (n-gram features) and logical predicates, which is important for mapping NL-questions to their corresponding predicates.

NLE-KB Pair Extraction
This section describes how we extract the semantic associated pairs of NLE-entries and KB-triples to learn the relational embeddings (Section 4.1).
<Relation Mention, Predicate> Pair (MP) Each relation mention denotes a lexical phrase of an existing KB-predicate. Following information extraction methods, such as PATTY (Nakashole et al., 2012), we extracted the <relation mention, logical predicate> pairs from English WIKIPEDIA 3 , which is closely connected to our KB, as follows: Given a KB-triple <entity subj , logical predicate, entity obj >, we extracted NLEentries <entity subj , relation mention, entity obj > where relation mention is the shortest path between entity subj and entity obj in the dependency tree of sentences. The assumption is that any relation mention (m) in the NLE-entry containing such entity pairs that occurred in the KB-triple is likely to express the predicate (p) of that triple.
With obtaining high-quality MP pairs, we kept only relation mentions that were highly associated with a predicate measured by the scoring function: where e x is the set of total pairs of both-side entities of entry x (m or p) and u x is the set of unique (distinct) pairs of both-side entities of entry x. In this case, the both-side entities indicate entity subj and entity obj . For a frequencybased probability, PMI(x; y) = log P (x,y) (Church and Hanks, 1990) can be re-written as PMI(x; y) = log |x y|·C |x|·|y| , where C denotes the total number of items shown in the corpus. The function is partially derived from the support score (Gerber and Ngonga Ngomo, 2011), but we focus on the correlation of shared entity pairs between relation mentions and predicates using the PMI computation.
<Question Pattern, Predicate> Pair (QP) Since WIKIPEDIA articles have no information to leverage interrogative features which highly depend on the object entity (answer), it is difficult to distinguish some questions that are composed of only different 5W1H words, e.g., {When|Where} was Barack Obama born? Hence, we used the method of collecting question patterns with human labeled predicates that are restricted by the set of predicates used in MP (Bao et al., 2014).

Embedding-based KB-QA
Our task is as follows. First, our model learns the semantic associations of C-T , C-P, and T -P (Section 3.1) based on NLE-KB pairs (Section 3.2), and then predicts the semantic-related KB-query which can directly find the answer to a given NLquestion.
For our feature space, given an NLE-KB pair, the NLE (relation mention in MP or question pattern in QP) is decomposed into n-gram features: C = {c | c is a segment of NLE}, and the KB-properties are represented by entity type t of entity subj and predicate p. Then we can obtain a training triplet w = [C, t, p]. Each feature (c ∈ C, t ∈ T , p ∈ P) is encoded in the distributed representation which is n-dimensional embedding vectors (E n ): ∀x, x encode ⇒ E(x) ∈ E n . All n-gram features (C) for an NLE are merged into one embedding vector to help speed up the learning process: E(C) = c∈C E(c)/|C|. This feature representation is inspired by previous work in embedding-based relation extraction (Weston et al., 2013), but differs in the following ways: (1) entity information is represented on a separate embedding, but its positional information remains as symbol entity ; (2) when the vectors are combined, we use the average of each index to normalize features.
For our joint relational approach, we focus on the set of paired relationships R = {C-t, C-p, t-p} that can be semantically leveraged. Formally, these features are embedded into the same latent space (E n ) and their semantic similarities can be computed by a dot product operation: where r ab denotes a paired relationship a-b (or (a, b)) in the above set R. We believe that our joint relational learning can smooth the surface (lexical) features for semantic parsing using the aligned entity and predicate.

Joint Relational Embedding Learning
Our ranking-based relational learning is based on a ranking loss (Weston et al., 2010) that supports the idea that the similarity scores of observed pairs in the training set (positive instances) should be larger than those of any other pairs (negative instances): under the soft ranking criterion, which conducts Stochastic Gradient Descent (SGD). We thus aim to minimize the following: (4) Our learning strategy is as follows. First, we initialize embedding space E n by randomly giving mean 0 and standard deviation 1/n to each vector. Then for each training triplet w i , we select the negative pairs against positive pairs (C i -t i , C i -p i , and t i -p i ) in the triplet. Last, we make a stochastic gradient step to minimize Equation 4 and update E n at each step.

KB-QA using Embedding Models
Our goal for KB-QA is to translate a given NLquestion to a KB-query with the form <subject entity, predicate, ?>, where ? denotes the answer entity we are looking for. The decoding process consists of two stages. The first stage involves generating all possible KB-queries (K q ) for an NL-question q. We first extract n-gram features (C q ) from the NL-question q. Then for a KB-query k q , we find all available entity types (t q ) of the identified subject entities (s q ) using the dictionary-based entity detection on the NLquestion q (all of spans can be candidate entities), and assign all items of predicate set (P) as the candidate predicates (p q ). Like the training triplets, q where is the city of david? k(q) [The City of David, contained by, ?] C q n-grams of "where is entity ?" t q location p q contained by Table 1: The corresponding KB-queryk(q) for a NL-question q and its decoding triplet w q .
we also represent the above features as the triplet ]. The second stage involves ranking candidate KB-queries based on the similarity scores between the following paired relationships from the triplet w q i : Unlike in the training step, the similarities of C q i -t q i and C q i -p q i are computed by summation of all pairwise elements (each context embedding E(c), not E(C), with each paired E(t) or E(p)) for a more precise measurement. Since similarites of R q are calculated on different scales, we normalize each value using Z-score (Z(x) = x−µ σ ) (Kreyszig, 1979). The final score is measured by: Then, given any NL-question q, we can predict the corresponding KB-queryk(q): Last, we can retrieve an answer from the KB using a structured queryk(q). Table 1 shows an example of our decoding process.
Multi-related Question Some questions include two-subject entities, both of which are crucial to understanding the question. For the question who plays gandalf in the lord of the rings? Gandalf (character) and The Lord Of The Rings (film) are explicit entities that should be joined to a pair of the two entities (implicit entity). More precisely, the two entities can be combined into one concatenated entity (character-in-film) using our manual rule, which compares the possible pairs of entity types in the question with the list of pre-defined entity type pairs that can be merged into a concatenated entity. Our solution enables a multi-related question to be transformed to a single-related question which can be directly translated to a KB-query. Then, the two entity # Entries Accuracy MP pairs 291,585 89% QP pairs 4,764 98% Table 2: Statistics of NLE-KB pairs mentions are replaced with the symbol entity (who play entity in entity ?). We regard the result of this transformation as one of the candidate KB-queries in the decoding step.

Experiments
Experimental Setting We first performed preprocessing, including lowercase transformation, lemmatization and tokenization, on NLE-KB pairs and evaluation data. We used 71,310 n-grams (uni-, bi-, tri-), 990 entity types, and 660 predicates as relational components shown in Section 3.1. The sum of these three numbers (72,960) equals the size of the embeddings we are going to learn. In Table 2, we evaluated the quality of NLE-KB pairs (MP and QP) described in Section 3.2. We can see that the quality of QP pairs is good, mainly due to human efforts. Also, we obtained MP pairs that have an acceptable quality using threshold 3.0 for Equation 1, which leverages the redundancy information in the large-scale data (WIKIPEDIA). For our embedding learning, we set the embedding dimension n to 100, the learning rate (λ) for SGD to 0.0001, and the iteration number to 30. To make the decoding procedure computable, we kept only the popular KB-entity in the dictionary to map different entity mentions into a KB-entity. We used two publicly released data sets for QA evaluations: Free917 (Cai and Yates, 2013) includes the annotated lambda calculus forms for each question, and covers 81 domains and 635 Freebase relations; WebQ. (Berant et al., 2013) provides 5,810 question-answer pairs that are built by collecting common questions from Web-query logs and by manually labeling answers. We used the previous three approaches (Cai and Yates, 2013;Berant et al., 2013;Bao et al., 2014) as our baselines. Table 3 reports the overall performances of our proposed KB-QA method on the two evaluation data sets and compares them with those of the three baselines. Note that we did not re-implement the baseline systems, but just borrowed the evaluation results reported in their Methods Free917 WebQ. Cai and Yates (2013) 59.00% N/A Berant et al. (2013) 62.00% 31.40% Bao et al. (2014) N/A 37.50% Our method 71.38% 41.34%   Table 3 shows that our method outperforms the baselines on both Free917 and WebQ. data sets. We think that using the low-dimensional embeddings of n-grams rather than the lexical triggers greatly improves the coverage issue. Unlike the previous methods which perform entity disambiguation and predicate prediction separately, our method jointly performs these two tasks. More precisely, we consider the relationships C-T and C-P simultaneously to rank candidate KB-queries. In Table 1, the most independent NER in KB-QA systems may detect David as the subject entity, but our joint approach can predict the appropriate subject entity The City of David by leveraging not only the relationships with other components but also other relationships at once. The syntaxbased (grammar formalism) approaches such as Combinatory Categorial Grammar (CCG) may experience errors if a question has grammatical errors. However, our bag-of-words model-based approach can handle any question as long as the question contains keywords that can help in understanding it. Table 4 shows the contributions of the relationships (R) between relational components C, T , and P. For each row, we remove the similarity from each of the relationship types described in Section 3.1. We can see that the C-P relationship plays a crucial role in translating NL-questions to KB-queries, while the other two relationships are slightly helpful.

Experimental Results
Result Analysis Since the majority of questions in WebQ. tend to be more natural and diverse, our method cannot find the correct answers to many questions. The errors can be caused by any of the following reasons. First, some NLEs cannot be easily linked to existing KB-predicates, making it difficult to find the answer entity. Second, some entities can be mentioned in several different ways, e.g., nickname (shaq→Shaquille O'neal) and family name (hitler→Adolf Hitler). Third, in terms of KB coverage issues, we cannot detect the entities that are unpopular. Last, feature representation for a question can fail when the question consists of rare n-grams.
The two training sets shown in Section 3.2 are complementary: QP pairs provide more opportunities for us to learn the semantic associations between interrogative words and predicates. Such resources are especially important for understanding NL-questions, as most of them start with such 5W1H words; on the other hand, MP pairs enrich the semantic associations between context information (n-gram features) and predicates.

Conclusion
In this paper, we propose a novel method that transforms NL-questions into their corresponding logical forms using joint relational embeddings. We also built a simple and robust KB-QA system based on only the learned embeddings. Such embeddings learn the semantic associations between natural language statements and KB-properties from NLE-KB pairs that are automatically extracted from English WIKIPEDIA using KB-triples with weak supervision. Then, we generate all possible structured queries derived from latent logical features of the given NL-question, and rank them based on the similarity scores between those relational attributes. The experimental results show that our method outperforms the latest three KB-QA baseline systems. For our future work, we will build concept-level context embeddings by leveraging latent meanings of NLEs rather than their surface n-grams with the aligned logical features on KB.