public class SearchNode extends Object implements Comparable<SearchNode>
SearchNode class represents a node in the binary search tree that is used to find the optimal
interpretation for a given document. Each search node possess a refinement (simply a set of interpretation nodes).
The two options that this search node examines are that the refinement will either part of the final interpretation or not.
During each search step the activation values in all the neuron activations adjusted such that they reflect the interpretation of the current search path.
When the search reaches the maximum depth of the search tree and no further refinements exists, a weight is computed evaluating the current search path.
The search path with the highest weight is used to determine the final interpretation.
Before the search is started a set of initial refinements is generated from the conflicts within the document. In other words, if there are no conflicts in a given document, then no search is needed. In this case the final interpretation will simply be the set of all interpretation nodes. The initial refinements are then expanded, meaning all interpretation nodes that are consistent with this refinement are added to the refinement. The initial refinements are then propagated along the search path as refinement candidates.
| Modifier and Type | Class and Description |
|---|---|
static class |
SearchNode.DebugState |
| Modifier and Type | Field and Description |
|---|---|
SearchNode |
excludedParent |
int |
id |
static int |
MAX_SEARCH_STEPS |
List<Activation.StateChange> |
modifiedActs |
SearchNode |
selectedParent |
long |
visited |
| Constructor and Description |
|---|
SearchNode(Document doc,
SearchNode selParent,
SearchNode exclParent,
Candidate c,
int level,
Collection<InterpretationNode> changed,
boolean cached) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeState(Activation.Mode m) |
void |
collectResults(Collection<InterpretationNode> results) |
boolean |
compareNewState(SearchNode cachedNode) |
int |
compareTo(SearchNode sn) |
void |
dumpDebugState() |
SearchNode |
getParent() |
String |
pathToString(Document doc) |
void |
reconstructSelectedResult(Document doc) |
static void |
search(Document doc,
SearchNode root)
Searches for the best interpretation for the given document.
|
INeuron.NormWeight |
searchRecursive(Document doc)
This algorithm is the recursive version of the interpretation search.
|
String |
toString(Document doc) |
public static int MAX_SEARCH_STEPS
public int id
public SearchNode excludedParent
public SearchNode selectedParent
public long visited
public List<Activation.StateChange> modifiedActs
public SearchNode(Document doc, SearchNode selParent, SearchNode exclParent, Candidate c, int level, Collection<InterpretationNode> changed, boolean cached)
public void collectResults(Collection<InterpretationNode> results)
public void reconstructSelectedResult(Document doc)
public void dumpDebugState()
public INeuron.NormWeight searchRecursive(Document doc)
public static void search(Document doc, SearchNode root)
doc - root - public void changeState(Activation.Mode m)
public int compareTo(SearchNode sn)
compareTo in interface Comparable<SearchNode>public boolean compareNewState(SearchNode cachedNode)
public SearchNode getParent()
Copyright © 2018. All rights reserved.