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 posses 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.RefMarker |
static class |
SearchNode.StateChange |
| Modifier and Type | Field and Description |
|---|---|
TreeSet<SearchNode> |
candidates |
int |
id |
static boolean |
INCOMPLETE_OPTIMIZATION
This optimization may miss some cases and will not always return the best interpretation.
|
static int |
MAX_SEARCH_STEPS |
List<SearchNode.StateChange> |
modifiedActs |
| Constructor and Description |
|---|
SearchNode(SearchNode parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeState(SearchNode.StateChange.Mode m) |
static List<InterprNode> |
collectConflicts(Document doc) |
int |
compareTo(SearchNode c) |
Neuron.NormWeight |
computeAccumulatedWeight() |
void |
computeSelectedOption(Document doc) |
boolean |
containedInSelectedBranch(long v,
InterprNode n) |
static SearchNode |
createCandidate(Document doc,
List<InterprNode> changed,
SearchNode parent,
SearchNode selectedParent,
SearchNode excludedParent,
List<InterprNode> ref,
SearchNode.RefMarker marker) |
static SearchNode |
createInitialExpandNode(Document doc) |
void |
generateInitialCandidates(Document doc) |
void |
generateNextLevelCandidates(Document doc,
SearchNode selectedParent,
SearchNode excludedParent) |
boolean |
isCovered(long g) |
String |
toString() |
public static boolean INCOMPLETE_OPTIMIZATION
public static int MAX_SEARCH_STEPS
public int id
public List<SearchNode.StateChange> modifiedActs
public TreeSet<SearchNode> candidates
public SearchNode(SearchNode parent)
public static SearchNode createInitialExpandNode(Document doc)
public void computeSelectedOption(Document doc)
public void generateInitialCandidates(Document doc)
public void generateNextLevelCandidates(Document doc, SearchNode selectedParent, SearchNode excludedParent)
public static List<InterprNode> collectConflicts(Document doc)
public Neuron.NormWeight computeAccumulatedWeight()
public boolean isCovered(long g)
public boolean containedInSelectedBranch(long v,
InterprNode n)
public static SearchNode createCandidate(Document doc, List<InterprNode> changed, SearchNode parent, SearchNode selectedParent, SearchNode excludedParent, List<InterprNode> ref, SearchNode.RefMarker marker)
public void changeState(SearchNode.StateChange.Mode m)
public int compareTo(SearchNode c)
compareTo in interface Comparable<SearchNode>Copyright © 2017. All rights reserved.