Package network.aika

Class Document

  • All Implemented Interfaces:
    Comparable<Document>

    public class Document
    extends Object
    implements Comparable<Document>
    The Document class 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 clearActivations must be called, since Aika only supports a single document per thread and model.

    Author:
    Lukas Molzberger
    • 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
      • selectedSearchNode

        public SearchNode selectedSearchNode
      • createV

        public long createV
    • Constructor Detail

      • Document

        public Document​(int id,
                        String content,
                        Model model,
                        int threadId)
    • 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()
      • getNodeQueue

        public NodeQueue getNodeQueue()
      • lookupFinalPosition

        public Position lookupFinalPosition​(int pos)
      • addActivation

        public void addActivation​(Activation act)
      • getActivationsByPosition

        public Collection<Activation> getActivationsByPosition​(int fromSlot,
                                                               Position fromPos,
                                                               boolean fromInclusive,
                                                               int toSlot,
                                                               Position toPos,
                                                               boolean toInclusive)
      • getNumberOfActivations

        public int getNumberOfActivations()
      • propagate

        public void propagate()
      • generateCandidates

        public void generateCandidates()
      • process

        public void process()
        The method process needs to be called after all the input activations have been added to the network. It performs the search for the best interpretation.
      • 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()