public class Document extends Object implements Comparable<Document>
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.
| Modifier and Type | Class and Description |
|---|---|
class |
Document.Queue |
class |
Document.UpperBoundQueue |
class |
Document.ValueQueue |
| Modifier and Type | Field and Description |
|---|---|
TreeSet<INeuron> |
activatedNeurons |
int |
activationIdCounter |
static Comparator<NodeActivation> |
ACTIVATIONS_OUTPUT_COMPARATOR |
TreeMap<NodeActivation.Key,Activation> |
activationsByRid |
TreeSet<Node> |
addedNodes |
static boolean |
APPLY_DEBUG_OUTPUT |
List<InterpretationNode> |
bestInterpretation |
InterpretationNode |
bottom |
ArrayList<Candidate> |
candidates |
static int |
CLEANUP_INTERVAL |
TreeSet<INeuron> |
finallyActivatedNeurons |
int |
id |
TreeSet<Activation> |
inputNeuronActivations |
int |
interpretationIdCounter |
static int |
MAX_ROUND |
Model |
model |
TreeMap<INeuron,Set<Synapse>> |
modifiedWeights |
static boolean |
OPTIMIZE_DEBUG_OUTPUT |
Document.Queue |
queue |
List<InterpretationNode> |
rootRefs |
SearchNode |
rootSearchNode |
int |
searchNodeIdCounter |
int |
searchStepCounter |
SearchNode |
selectedSearchNode |
SupervisedTraining |
supervisedTraining |
int |
threadId |
Document.UpperBoundQueue |
ubQueue |
long |
visitedCounter |
Document.ValueQueue |
vQueue |
| Constructor and Description |
|---|
Document(int id,
String content,
Model model,
int threadId) |
| Modifier and Type | Method and Description |
|---|---|
String |
bestInterpretationToString() |
void |
clearActivations()
Removes the activations of this document from the model again.
|
void |
commit()
Updates the model after the training step.
|
int |
compareTo(Document doc) |
void |
dumpDebugCandidateStatistics() |
void |
generateCandidates() |
String |
generateOutputText() |
Collection<NodeActivation> |
getAllNodeActivations() |
String |
getContent() |
Stream<Activation> |
getFinalActivations() |
String |
getText(Range r) |
int |
length() |
String |
neuronActivationsToString(boolean withWeights) |
String |
neuronActivationsToString(boolean withWeights,
boolean withTextSnipped,
boolean withLogic) |
String |
neuronActivationsToString(SearchNode sn,
boolean withWeights,
boolean withTextSnipped,
boolean withLogic) |
void |
notifyWeightsModified(INeuron n,
Collection<Synapse> inputSynapses) |
void |
process()
The method
process needs to be called after all the input activations have been added to the
network. |
void |
propagate() |
String |
toString() |
public static boolean APPLY_DEBUG_OUTPUT
public static boolean OPTIMIZE_DEBUG_OUTPUT
public static int CLEANUP_INTERVAL
public static int MAX_ROUND
public final int id
public long visitedCounter
public int interpretationIdCounter
public int activationIdCounter
public int searchNodeIdCounter
public int searchStepCounter
public InterpretationNode bottom
public Model model
public int threadId
public Document.Queue queue
public Document.ValueQueue vQueue
public Document.UpperBoundQueue ubQueue
public TreeSet<Activation> inputNeuronActivations
public SupervisedTraining supervisedTraining
public TreeMap<NodeActivation.Key,Activation> activationsByRid
public SearchNode rootSearchNode
public SearchNode selectedSearchNode
public List<InterpretationNode> rootRefs
public List<InterpretationNode> bestInterpretation
public static Comparator<NodeActivation> ACTIVATIONS_OUTPUT_COMPARATOR
public String getContent()
public int length()
public Stream<Activation> getFinalActivations()
public String bestInterpretationToString()
public int compareTo(Document doc)
compareTo in interface Comparable<Document>public void propagate()
public void generateCandidates()
public void process()
process needs to be called after all the input activations have been added to the
network. It performs the search for the best interpretation.public void dumpDebugCandidateStatistics()
public void notifyWeightsModified(INeuron n, Collection<Synapse> inputSynapses)
public void commit()
public Collection<NodeActivation> getAllNodeActivations()
public void clearActivations()
public String generateOutputText()
public String neuronActivationsToString(boolean withWeights)
public String neuronActivationsToString(boolean withWeights, boolean withTextSnipped, boolean withLogic)
public String neuronActivationsToString(SearchNode sn, boolean withWeights, boolean withTextSnipped, boolean withLogic)
Copyright © 2018. All rights reserved.