Package network.aika
Class Document
- java.lang.Object
-
- network.aika.Document
-
- All Implemented Interfaces:
Comparable<Document>
public class Document extends Object implements Comparable<Document>
TheDocumentclass represents a single document which may be either used for processing a text or as training input. A document consists of the raw text, the interpretations and the activations.When the document is not needed any more, the method
clearActivationsmust be called, since Aika only supports a single document per thread and model.- Author:
- Lukas Molzberger
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Activation>ACTIVATIONS_OUTPUT_COMPARATORArrayList<NodeActivation>addedNodeActivationsTreeSet<Node>addedNodesArrayList<Candidate>candidatesstatic intCLEANUP_INTERVALlongcreateVstatic booleanINCREMENTAL_MODEExperimental code: not working yet!static intMAX_ROUNDintpositionIdCounterstatic intROUND_LIMITintsearchNodeIdCounterintsearchStepCounterSearchNodeselectedSearchNode
-
Method Summary
-
-
-
Field Detail
-
CLEANUP_INTERVAL
public static int CLEANUP_INTERVAL
-
MAX_ROUND
public static int MAX_ROUND
-
ROUND_LIMIT
public static int ROUND_LIMIT
-
INCREMENTAL_MODE
public static boolean INCREMENTAL_MODE
Experimental code: not working yet!
-
searchNodeIdCounter
public int searchNodeIdCounter
-
searchStepCounter
public int searchStepCounter
-
positionIdCounter
public int positionIdCounter
-
addedNodeActivations
public ArrayList<NodeActivation> addedNodeActivations
-
selectedSearchNode
public SearchNode selectedSearchNode
-
createV
public long createV
-
ACTIVATIONS_OUTPUT_COMPARATOR
public static Comparator<Activation> ACTIVATIONS_OUTPUT_COMPARATOR
-
-
Method Detail
-
getId
public int getId()
-
getModel
public Model getModel()
-
getLinker
public Linker getLinker()
-
getValueQueue
public ValueQueue getValueQueue()
-
getNewVisitedId
public long getNewVisitedId()
-
getNewActivationId
public int getNewActivationId()
-
getNewNodeActivationId
public int getNewNodeActivationId()
-
addActivatedNode
public void addActivatedNode(Node n)
-
addInputNeuronActivation
public void addInputNeuronActivation(Activation act)
-
addFinallyActivatedNeuron
public void addFinallyActivatedNeuron(INeuron n)
-
addActivatedNeuron
public void addActivatedNeuron(INeuron n)
-
getThreadId
public int getThreadId()
-
append
public void append(String txt)
-
charAt
public char charAt(int i)
-
getContent
public String getContent()
-
length
public int length()
-
getUpperBoundQueue
public UpperBoundQueue getUpperBoundQueue()
-
getNodeQueue
public NodeQueue getNodeQueue()
-
lookupFinalPosition
public Position lookupFinalPosition(int pos)
-
addActivation
public void addActivation(Activation act)
-
getActivations
public Collection<Activation> getActivations(boolean onlyFinal)
-
getActivationsByPosition
public Collection<Activation> getActivationsByPosition(int fromSlot, Position fromPos, boolean fromInclusive, int toSlot, Position toPos, boolean toInclusive)
-
getActivationsByPosition
public Collection<Activation> getActivationsByPosition(Position fromPos, boolean fromInclusive, Position toPos, boolean toInclusive)
-
getNextActivation
public Activation getNextActivation(Activation currentAct)
-
getNumberOfActivations
public int getNumberOfActivations()
-
compareTo
public int compareTo(Document doc)
- Specified by:
compareToin interfaceComparable<Document>
-
propagate
public void propagate()
-
generateCandidates
public void generateCandidates()
-
process
public void process()
The methodprocessneeds to be called after all the input activations have been added to the network. It performs the search for the best interpretation.
-
process
public void process(Long timeoutInMilliSeconds) throws SearchNode.TimeoutException
- Throws:
SearchNode.TimeoutException
-
dumpDebugCandidateStatistics
public void dumpDebugCandidateStatistics()
-
notifyWeightModified
public void notifyWeightModified(Synapse synapse)
-
commit
public void commit()
Updates the model after the training step. It applies the weight and bias delta values and reflects the changes in the logic node structure.
-
clearActivations
public void clearActivations()
Removes the activations of this document from the model again.
-
generateOutputText
public String generateOutputText()
-
activationsToString
public String activationsToString()
-
dumpOscillatingActivations
public void dumpOscillatingActivations()
-
-