# US 2022/0284326 A1 · Using functions to annotate a syntax tree with real data used to generate an answer to a question

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

- Number: US 2022/0284326 A1
- Document ID: US20220284326A1
- Status: Published application
- Kind: A1
- Application number: 17/664,220
- Filed: 2022-05-19
- Published: 2022-09-08
- Earliest claimed: 2019-09-18
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Oleg Sidorkin; Sergey Batin
- Web page: https://patentgrep.com/patent/US20220284326A1

## CPC

- G06N 5/022: Knowledge engineering; Knowledge acquisition
- G06N 5/04: Inference or reasoning models
- G06F 16/3344: {using natural language analysis}
- G06F 40/169: Annotation, e.g. comment data or footnotes
- G06F 40/205: Parsing
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 5/041: {Abduction}
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are a computer program product, system, and method for using higher order actions to annotate a syntax tree. An information space of the syntax tree is annotated with concepts corresponding to tokens in the syntax tree. A concept comprises an object in a domain of the question and relates to other concepts in an ontology of the domain. A higher order action specifies an input, action parameters, and an output. A determination is made of an element in the information space corresponding to the input of the higher order action. A determination is made of an action of in the domain of the question having parameters matching the action parameters. The determined element is input to the determined action to produce output. The information space of the syntax tree is annotated with the output from the higher order action to use to provide an answer to the question.

## Claims

### Claim at position 1

1-25. (canceled)

### Claim 26

A computer program product for processing language statements in a computing system, wherein the computer program product comprises a computer readable storage medium having computer readable program instructions executed by a processor to perform operations, the operations comprising:
generating a syntax tree with tokens from a question to process;
producing an annotated syntax tree with concepts for the tokens, wherein the concepts are in a domain of the question;
determining whether there is an element in the annotated syntax tree matching input of a function, wherein the function has code to generate real data from input of the function corresponding to the concepts in the annotated syntax tree;
executing the code for the function to produce the real data for the element in response to determining the element in the annotated syntax tree matching the input of the function; and
annotating the syntax tree with the real data for the determined element in the syntax tree to use to provide an answer to the question.

### Claim 27 (depends on 26)

The computer program product of claim 26, wherein the function further includes a constraint, wherein the determining whether there is an element in the annotated syntax tree comprises determining an element in the annotated syntax tree matching the input of the function and satisfying the constraint of the function.

### Claim 28 (depends on 26)

The computer program product of claim 26, wherein the operations further comprise:
determining whether there are multiple functions having an input matching the element in the annotated syntax tree;
selecting one of the multiple functions having the input matching the element in the annotated syntax tree having a syntax that has a closest match to the question in response to determining that there are the multiple functions; and
selecting the one function having the input matching the element in the annotated syntax tree in response to determining there is only one function, wherein the code is executed for the selected function to produce the real data.

### Claim 29 (depends on 26)

The computer program product of claim 26, wherein the function comprises an action having a constraint, the input, and the code, wherein there are a plurality of higher order actions each having an input and constraint, wherein the determining whether there is an element in the annotated syntax tree matching input of an action comprises:
determining whether there is an element in the annotated syntax tree matching input and satisfying a constraint of a higher order action of the higher order actions; and
in response to determining that there is an element matching the input and satisfying the constraint of the higher order action, determining whether the constraint and input of the higher order action matching the input and satisfying the constraint of the element also matches a a constraint and input of an action.

### Claim 30 (depends on 29)

The computer program product of claim 29, wherein the operations further comprise:
executing code for the higher order action for which the action is determined in response to the higher order action providing the code.

### Claim 31 (depends on 26)

The computer program product of claim 26, wherein the operations further comprise:
process the functions to output real data for input nodes in the annotated syntax tree to provide further real data to answer the question; and
determining at least one candidate answers to the question from the real data added to the annotated syntax tree by processing the functions.

### Claim 32 (depends on 31)

The computer program product of claim 31, wherein the operations further comprise:
in response to determining multiple candidate answers to the question, determining a sense metric for each of the candidate answers indicating a degree to which the candidate answer is a response to the question; and
returning the candidate answer having the best sense metric as a final answer to the question.

### Claim 33

A system for processing language statements, comprising:
a processor; and
a computer readable storage medium having computer readable program instructions executed by the processor to perform operations, the operations comprising:
generating a syntax tree with tokens from a question to process;
producing an annotated syntax tree with concepts for the tokens, wherein the concepts are in a domain of the question;
determining whether there is an element in the annotated syntax tree matching input of a function, wherein the function has code to generate real data from input of the function corresponding to the concepts in the annotated syntax tree;
executing the code for the function to produce the real data for the element in response to determining the element in the annotated syntax tree matching the input of the function; and
annotating the syntax tree with the real data for the determined element in the syntax tree to use to provide an answer to the question.

### Claim 34 (depends on 33)

The system of claim 33, wherein the function further includes a constraint, wherein the determining whether there is an element in the annotated syntax tree comprises determining an element in the annotated syntax tree matching the input of the function and satisfying the constraint of the function.

### Claim 35 (depends on 33)

The system of claim 33, wherein the operations further comprise:
determining whether there are multiple functions having an input matching the element in the annotated syntax tree;
selecting one of the multiple functions having the input matching the element in the annotated syntax tree having a syntax that has a closest match to the question in response to determining that there are the multiple functions; and
selecting the one function having the input matching the element in the annotated syntax tree in response to determining there is only one function, wherein the code is executed for the selected function to produce the real data.

### Claim 36 (depends on 33)

The system of claim 33, wherein the function comprises an action having a constraint, the input, and the code, wherein there are a plurality of higher order actions each having an input and constraint, wherein the determining whether there is an element in the annotated syntax tree matching input of an action comprises:
determining whether there is an element in the annotated syntax tree matching input and satisfying a constraint of a higher order action of the higher order actions; and
in response to determining that there is an element matching the input and satisfying the constraint of the higher order action, determining whether the constraint and input of the higher order action matching the input and satisfying the constraint of the element also matches a a constraint and input of an action.

### Claim 37 (depends on 36)

The system of claim 36, wherein the operations further comprise:
executing code for the higher order action for which the action is determined in response to the higher order action providing the code.

### Claim 38 (depends on 33)

The system of claim 33, wherein the operations further comprise:
process the functions to output real data for input nodes in the annotated syntax tree to provide further real data to answer the question; and
determining at least one candidate answers to the question from the real data added to the annotated syntax tree by processing the functions.

### Claim 39 (depends on 38)

The system of claim 38, wherein the operations further comprise:
in response to determining multiple candidate answers to the question, determining a sense metric for each of the candidate answers indicating a degree to which the candidate answer is a response to the question; and
returning the candidate answer having the best sense metric as a final answer to the question.

### Claim 40

A method for processing language statements, comprising:
generating a syntax tree with tokens from a question to process;
producing an annotated syntax tree with concepts for the tokens, wherein the concepts are in a domain of the question;
determining whether there is an element in the annotated syntax tree matching input of a function, wherein the function has code to generate real data from input of the function corresponding to the concepts in the annotated syntax tree;
executing the code for the function to produce the real data for the element in response to determining the element in the annotated syntax tree matching the input of the function; and
annotating the syntax tree with the real data for the determined element in the syntax tree to use to provide an answer to the question.

### Claim 41 (depends on 40)

The method of claim 40, wherein the function further includes a constraint, wherein the determining whether there is an element in the annotated syntax tree comprises determining an element in the annotated syntax tree matching the input of the function and satisfying the constraint of the function.

### Claim 42 (depends on 40)

The method of claim 40, further comprising:
determining whether there are multiple functions having an input matching the element in the annotated syntax tree;
selecting one of the multiple functions having the input matching the element in the annotated syntax tree having a syntax that has a closest match to the question in response to determining that there are the multiple functions; and
selecting the one function having the input matching the element in the annotated syntax tree in response to determining there is only one function, wherein the code is executed for the selected function to produce the real data.

### Claim 43 (depends on 40)

The method of claim 40, wherein the function comprises an action having a constraint, the input, and the code, wherein there are a plurality of higher order actions each having an input and constraint, wherein the determining whether there is an element in the annotated syntax tree matching input of an action comprises:
determining whether there is an element in the annotated syntax tree matching input and satisfying a constraint of a higher order action of the higher order actions; and
in response to determining that there is an element matching the input and satisfying the constraint of the higher order action, determining whether the constraint and input of the higher order action matching the input and satisfying the constraint of the element also matches a a constraint and input of an action.

### Claim 44 (depends on 43)

The method of claim 43, further comprising:
executing code for the higher order action for which the action is determined in response to the higher order action providing the code.

### Claim 45 (depends on 40)

The method of claim 40, further comprising:
process the functions to output real data for input nodes in the annotated syntax tree to provide further real data to answer the question; and
determining at least one candidate answers to the question from the real data added to the annotated syntax tree by processing the functions.
