eta.core.reasoning
The core process responsible for inferring new facts and possible actions to take from previous facts/observations.
Functions
Infer new facts in a "bottom-up" manner, using relevant facts in memory. |
|
Infer new facts in a "top-down" manner, using the current expected/intended plan step as context. |
|
Infer new facts and possible actions from previous facts/observations. |
|
Suggest possible actions to take in reaction to a list of observations. |
- reasoning_loop(ds)[source]
Infer new facts and possible actions from previous facts/observations.
First, all recent inferences are popped from the
inferences
buffer, and from these inferences, the system attempts to infer new facts in both a top down and a bottom up manner.A depth limit is imposed, such that only facts which are below some number of inference steps away from a direct observation are considered for further inference. Any inferred facts are added back to the
inferences
buffer, with a depth that is one greater than the minimum depth of the facts used to infer them.In the top down approach, the current state of the dialogue plan is used as the context for making inferences from each fact.
In the bottom up approach, a set of relevant facts are retrieved from memory and used to make inferences from each fact.
Second, all direct observations are popped from the
observations
buffer, and used to suggest possible actions that the system can take in reaction to those observations.- Parameters:
ds (DialogueState) –
- infer_top_down(facts, ds)[source]
Infer new facts in a “top-down” manner, using the current expected/intended plan step as context.
- Parameters:
facts (list[Eventuality]) – A list of facts to use for inference.
ds (DialogueState) –
- Returns:
A list of inferred facts.
- Return type:
- infer_bottom_up(facts, ds)[source]
Infer new facts in a “bottom-up” manner, using relevant facts in memory.
- Parameters:
facts (list[Eventuality]) – A list of facts to use for inference.
ds (DialogueState) –
- Returns:
A list of inferred facts.
- Return type:
Notes
TODO: still need to implement retrieval of relevant facts from memory (and generic knowledge?).
- suggest_possible_actions(observations, ds)[source]
Suggest possible actions to take in reaction to a list of observations.
- Parameters:
observations (list[Eventuality]) – A list of observed events to use for reaction.
ds (DialogueState) –
- Returns:
A list of possible actions (as natural language strings or LISP-formatted S-expression strings).
- Return type:
Notes
- TODO: some possible future improvements:
Reconsider previous failed plan steps as possible actions to retry.
Consider the system’s desires, and/or obligations placed on the system, as well as observations, in considering possible actions.
Allow urgency scores to be included in the transducer results, allowing for differential priority for different kinds of possible actions (e.g., even in a simple chit-chat domain, we may wish for answering a question to have a higher urgency than responding to a statement.)