public Object getObjectAtPosition (int pos) { return dictionary.lookupObject (features[pos]); }
public String getWeightsName (int weightIndex) { return (String) weightAlphabet.lookupObject (weightIndex); }
private Object objectAtLocation (int loc) { return dictionary.lookupObject (loc); }
public String getWeightsName (int weightIndex) { return (String) weightAlphabet.lookupObject (weightIndex); }
public String[] getWeightNames (int index) { int[] indices = this.weightsIndices[index]; String[] ret = new String[indices.length]; for (int i=0; i < ret.length; i++) ret[i] = crf.weightAlphabet.lookupObject(indices[i]).toString(); return ret; }
public void print () { if (alphas != null) throw new IllegalStateException ("foo"); System.out.println ("Dirichlet:"); for (int j = 0; j < alphas.length; j++) System.out.println (dict!= null ? dict.lookupObject(j).toString() : j + "=" + alphas[j]); }
public Object getObjectAtRank (int rank) { setRankOrder (rank); return dictionary.lookupObject (rankOrder[rank]); }
public Object randomObject (Random r) { if (dictionary == null) throw new IllegalStateException ("This Multinomial has no dictionary."); return dictionary.lookupObject (randomIndex (r)); }
public Object getMaxValuedObject () { return dictionary.lookupObject (getMaxValuedIndex()); }
public Object getMaxValuedObjectIn (FeatureSelection fs) { return dictionary.lookupObject (getMaxValuedIndexIn(fs)); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { logger.info ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { logger.info ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { System.out.println ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { logger.info ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { logger.info("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addSelfTransitioningStateForAllLabels (String name) { String[] labels = new String[outputAlphabet.size()]; String[] destinationNames = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { logger.info ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); destinationNames[i] = name; } addState (name, 0.0, 0.0, destinationNames, labels); }
public void addSelfTransitioningStateForAllLabels (String name) { String[] labels = new String[outputAlphabet.size()]; String[] destinationNames = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { System.out.println ("CRF: outputAlphabet.lookup class = "+ outputAlphabet.lookupObject(i).getClass().getName()); labels[i] = (String) outputAlphabet.lookupObject(i); destinationNames[i] = name; } addState (name, 0.0, 0.0, destinationNames, labels); }
public void addFullyConnectedStatesForLabels () { String[] labels = new String[outputAlphabet.size()]; // This is assuming the the entries in the outputAlphabet are Strings! for (int i = 0; i < outputAlphabet.size(); i++) { labels[i] = (String) outputAlphabet.lookupObject(i); } addFullyConnectedStates (labels); }
public void addSelfTransitioningStateForAllLabels (String name) { String[] labels = new String[outputAlphabet.size()]; String[] destinationNames = new String[outputAlphabet.size()]; for (int i = 0; i < outputAlphabet.size(); i++) { labels[i] = outputAlphabet.lookupObject(i).toString(); destinationNames[i] = name; } addState (name, 0.0, 0.0, destinationNames, labels); }
public void selectFeaturesForAllLabels (InstanceList ilist, InstanceList validationList) { RankedFeatureVector ranking = ranker.newRankedFeatureVector (ilist); FeatureSelection fs = new FeatureSelection (ilist.getDataAlphabet()); int nf = Math.min (numFeatures, ranking.singleSize()); for (int i = 0; i < nf; i++) { logger.info ("adding feature "+i+" word="+ilist.getDataAlphabet().lookupObject(ranking.getIndexAtRank(i))); fs.add (ranking.getIndexAtRank(i)); } ilist.setPerLabelFeatureSelection (null); ilist.setFeatureSelection (fs); }