# US 2023/0055188 A1 · Systems and methods for knowledge base question answering using generation augmented ranking

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0055188 A1
- Document ID: US20230055188A1
- Status: Published application
- Kind: A1
- Application number: 17/565,215
- Filed: 2021-12-29
- Published: 2023-02-23
- Earliest claimed: 2021-08-20
- Applicants: salesforce.com, inc.
- Inventors: Xi Ye; Semih Yavuz; Kazuma Hashimoto; Yingbo Zhou
- Web page: https://patentgrep.com/patent/US20230055188A1

## CPC

- G06N 5/04: Inference or reasoning models
- G06F 16/24578: {using ranking}
- G06N 3/042: Knowledge-based neural networks; Logical representations of neural networks
- G06N 3/045: Combinations of networks
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 5/02: Knowledge representation; Symbolic representation
- G06V 30/19147: {Obtaining sets of training patterns; Bootstrap methods, e.g. bagging or boosting}
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Embodiments described herein provide a question answering approach that answers a question by generating an executable logical form. First, a ranking model is used to select a set of good logical forms from a pool of logical forms obtained by searching over a knowledge graph. The selected logical forms are good in the sense that they are close to (or exactly match, in some cases) the intents in the question and final desired logical form. Next, a generation model is adopted conditioned on the question as well as the selected logical forms to generate the target logical form and execute it to obtain the final answer. For example, at inference stage, when a question is received, a matching logical form is identified from the question, based on which the final answer can be generated based on the node that is associated with the matching logical form in the knowledge base.

## Claims

### Claim 1

A method of knowledge base question answering, the method comprising:
receiving, via a communication interface, a question that mentions a set of entities;
generating, by accessing a knowledge base, a set of candidate logical forms based on the question;
ranking, by a ranking model, the set of candidate logical forms based on similarity scores between the question and the set of candidate logical forms, respectively;
generating, by a generation model, a target logical form conditioned on the question and a subset of the ranked set of candidate logical forms; and
generating an answer to the question by applying the target logical form on the knowledge base.

### Claim 2 (depends on 1)

The method of claim 1, wherein the set of candidate logical forms is generated by:
querying the knowledge base for paths reachable within two hops from each entity detected in the question; and
converting relation labels along the paths to the set of candidate logical forms.

### Claim 3 (depends on 1)

The method of claim 1, wherein the ranking model comprises a language model based bi-encoder and a linear projection layer.

### Claim 4 (depends on 1)

The method of claim 1, wherein the ranking, by the ranking model, the set of candidate logical forms further comprises:
forming an input for the ranking model by concatenating the question and a first candidate logical form from the set of candidate logical forms; and
generating, by the ranking model, a first logit representing a similarity score between the question and the first candidate logical form.

### Claim 5 (depends on 1)

The method of claim 1, wherein the generation model is a transformer-based sequence-to-sequence model.

### Claim 6 (depends on 1)

The method of claim 1, wherein the generating, by the generation model, the target logical form further comprises:
constructing an input to the generation model by concatenating the question and the subset of the ranked set of candidate logical forms; and
generating by the generation model the target logical form based on the constructed input.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
decoding the subset of candidate logical forms using beam search; and
querying the knowledge base using each candidate logical form from the subset until a valid answer is returned.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
in response to determining that no valid answer is returned after exhausting the subset of candidate logical forms, determining that a top-ranked candidate logical form in the subset is the target logical form.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
determining, for a first entity mentioned in the question, a first set of candidate entities in the knowledge base that match the first entity; and
determining linking relations between a second entity mentioned in the question and the first set of candidate entities.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
concatenating, for a first candidate entity from the first set of candidate entities, the question with a corresponding linking relations to form a first input to the ranking model;
generating, by the ranking model, a first similarity score between the question and the first candidate entity based on the first input;
ranking the first set of candidate entities based on generated similarity scores; and
selecting a top-ranked candidate entity from the first set as a matching entity for the first entity mentioned in the question.

### Claim 11

A system for knowledge base question answering, the system comprising:
a communication interface receiving a question that mentions a set of entities;
a memory storing a plurality of processor-executable instructions; and
a processor reading and executing the instructions from the memory to perform operations comprising:
generating, by accessing a knowledge base, a set of candidate logical forms based on the question;
ranking, by a ranking model, the set of candidate logical forms based on similarity scores between the question and the set of candidate logical forms, respectively;
generating, by a generation model, a target logical form conditioned on the question and a subset of the ranked set of candidate logical forms; and
generating an answer to the question by applying the target logical form on the knowledge base.

### Claim 12 (depends on 11)

The system of claim 11, wherein the set of candidate logical forms is generated by:
querying the knowledge base for paths reachable within two hops from each entity detected in the question; and
converting relation labels along the paths to the set of candidate logical forms.

### Claim 13 (depends on 11)

The system of claim 11, wherein the ranking model comprises a language model based bi-encoder and a linear projection layer.

### Claim 14 (depends on 11)

The system of claim 11, wherein the ranking, by the ranking model, the set of candidate logical forms further comprises:
forming an input for the ranking model by concatenating the question and a first candidate logical form from the set of candidate logical forms; and
generating, by the ranking model, a first logit representing a similarity score between the question and the first candidate logical form.

### Claim 15 (depends on 11)

The system of claim 11, wherein the generation model is a transformer-based sequence-to-sequence model.

### Claim 16 (depends on 11)

The system of claim 11, wherein the operation of generating, by the generation model, the target logical form further comprises:
constructing an input to the generation model by concatenating the question and the subset of the ranked set of candidate logical forms; and
generating by the generation model the target logical form based on the constructed input.

### Claim 17 (depends on 16)

The system of claim 16, wherein the operations further comprise:
decoding the subset of candidate logical forms using beam search; and
querying the knowledge base using each candidate logical form from the subset until a valid answer is returned.

### Claim 18 (depends on 17)

The system of claim 17, wherein the operations further comprise:
in response to determining that no valid answer is returned after exhausting the subset of candidate logical forms, determining that a top-ranked candidate logical form in the subset is the target logical form.

### Claim 19 (depends on 11)

The system of claim 11, wherein the operations further comprise:
determining, for a first entity mentioned in the question, a first set of candidate entities in the knowledge base that match the first entity;
determining linking relations between a second entity mentioned in the question and the first set of candidate entities;
concatenating, for a first candidate entity from the first set of candidate entities, the question with a corresponding linking relations to form a first input to the ranking model;
generating, by the ranking model, a first similarity score between the question and the first candidate entity based on the first input;
ranking the first set of candidate entities based on generated similarity scores; and
selecting a top-ranked candidate entity from the first set as a matching entity for the first entity mentioned in the question.

### Claim 20

A processor-readable non-transitory storage medium storing a plurality of processor-executable instructions for knowledge base question answering, the instructions being executed by one or more processors to perform operations comprising:
receiving, via a communication interface, a question that mentions a set of entities;
generating, by accessing a knowledge base, a set of candidate logical forms based on the question;
ranking, by a ranking model, the set of candidate logical forms based on similarity scores between the question and the set of candidate logical forms, respectively;
generating, by a generation model, a target logical form conditioned on the question and a subset of the ranked set of candidate logical forms; and
generating an answer to the question by applying the target logical form on the knowledge base.
