public void addInstances (InstanceList training) { initializeForTypes (training.getDataAlphabet()); ArrayList<LabelSequence> topicSequences = new ArrayList<LabelSequence>(); for (Instance instance : training) { LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[instanceLength(instance)]); if (false) // This method not yet obeying its last "false" argument, and must be for this to work sampleTopicsForOneDoc((FeatureSequence)instance.getData(), topicSequence, false, false); else { Randoms r = new Randoms(); int[] topics = topicSequence.getFeatures(); for (int i = 0; i < topics.length; i++) topics[i] = r.nextInt(numTopics); } topicSequences.add (topicSequence); } addInstances (training, topicSequences); }
public void addInstances (InstanceList training) { initializeForTypes (training.getDataAlphabet()); ArrayList<LabelSequence> topicSequences = new ArrayList<LabelSequence>(); for (Instance instance : training) { LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[instanceLength(instance)]); if (false) // This method not yet obeying its last "false" argument, and must be for this to work sampleTopicsForOneDoc((FeatureSequence)instance.getData(), topicSequence, false, false); else { Randoms r = new Randoms(); int[] topics = topicSequence.getFeatures(); for (int i = 0; i < topics.length; i++) topics[i] = r.nextInt(numTopics); } topicSequences.add (topicSequence); } addInstances (training, topicSequences); }
public void addInstances (InstanceList training) { initializeForTypes (training.getDataAlphabet()); ArrayList<LabelSequence> topicSequences = new ArrayList<LabelSequence>(); for (Instance instance : training) { LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[instanceLength(instance)]); if (false) // This method not yet obeying its last "false" argument, and must be for this to work sampleTopicsForOneDoc((FeatureSequence)instance.getData(), topicSequence, false, false); else { Randoms r = new Randoms(); int[] topics = topicSequence.getFeatures(); for (int i = 0; i < topics.length; i++) topics[i] = r.nextInt(numTopics); } topicSequences.add (topicSequence); } addInstances (training, topicSequences); }