public Pipe getPipe() { return new Noop(dataAlphabet, targetAlphabet); }
Noop newPipe = new Noop (newAlphabet, instances.getTargetAlphabet()); InstanceList newInstanceList = new InstanceList (newPipe); newInstanceList.add(newPipe.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource()))); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); int numFeatures = oldAlphabet.size(); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); InfoGain ig = new InfoGain (instances); instances2.add(pipe2.instanceFrom(new Instance(fv2, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) { instances2.add(pipe2.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) {
/** * * @param inst input instance, with FeatureVectorSequence as data. * @param alphabetsPipe a Noop pipe containing the data and target alphabets for * the resulting InstanceList and AugmentableFeatureVectors * @return list of instances, each with one AugmentableFeatureVector as data */ public static InstanceList convert(Instance inst, Noop alphabetsPipe) { InstanceList ret = new InstanceList(alphabetsPipe); Object obj = inst.getData(); assert(obj instanceof FeatureVectorSequence); FeatureVectorSequence fvs = (FeatureVectorSequence) obj; LabelSequence ls = (LabelSequence) inst.getTarget(); assert(fvs.size() == ls.size()); Object instName = (inst.getName() == null ? "NONAME" : inst.getName()); for (int j = 0; j < fvs.size(); j++) { FeatureVector fv = fvs.getFeatureVector(j); int[] indices = fv.getIndices(); FeatureVector data = new AugmentableFeatureVector (alphabetsPipe.getDataAlphabet(), indices, fv.getValues(), indices.length); Labeling target = ls.getLabelAtPosition(j); String name = instName.toString() + "_@_POS_" + (j + 1); Object source = inst.getSource(); Instance toAdd = alphabetsPipe.pipe(new Instance(data, target, name, source)); ret.add(toAdd); } return ret; }
Noop newPipe = new Noop (newAlphabet, instances.getTargetAlphabet()); InstanceList newInstanceList = new InstanceList (newPipe); newInstanceList.add(newPipe.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource()))); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); int numFeatures = oldAlphabet.size(); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); InfoGain ig = new InfoGain (instances); instances2.add(pipe2.instanceFrom(new Instance(fv2, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) { instances2.add(pipe2.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) {
/** * * @param inst input instance, with FeatureVectorSequence as data. * @param alphabetsPipe a Noop pipe containing the data and target alphabets for * the resulting InstanceList and AugmentableFeatureVectors * @return list of instances, each with one AugmentableFeatureVector as data */ public static InstanceList convert(Instance inst, Noop alphabetsPipe) { InstanceList ret = new InstanceList(alphabetsPipe); Object obj = inst.getData(); assert(obj instanceof FeatureVectorSequence); FeatureVectorSequence fvs = (FeatureVectorSequence) obj; LabelSequence ls = (LabelSequence) inst.getTarget(); assert(fvs.size() == ls.size()); Object instName = (inst.getName() == null ? "NONAME" : inst.getName()); for (int j = 0; j < fvs.size(); j++) { FeatureVector fv = fvs.getFeatureVector(j); int[] indices = fv.getIndices(); FeatureVector data = new AugmentableFeatureVector (alphabetsPipe.getDataAlphabet(), indices, fv.getValues(), indices.length); Labeling target = ls.getLabelAtPosition(j); String name = instName.toString() + "_@_POS_" + (j + 1); Object source = inst.getSource(); Instance toAdd = alphabetsPipe.pipe(new Instance(data, target, name, source)); ret.add(toAdd); } return ret; }
public Pipe getPipe() { return new Noop(dataAlphabet, targetAlphabet); }
Noop newPipe = new Noop (newAlphabet, instances.getTargetAlphabet()); InstanceList newInstanceList = new InstanceList (newPipe); newInstanceList.add(newPipe.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource()))); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); int numFeatures = oldAlphabet.size(); Noop pipe2 = new Noop (alpha2, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); InfoGain ig = new InfoGain (instances); instances2.add(pipe2.instanceFrom(new Instance(fv2, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) { instances2.add(pipe2.instanceFrom(new Instance(fs, instance.getTarget(), instance.getName(), instance.getSource())), instances.getInstanceWeight(ii)); Noop pipe2 = new Noop (alpha, instances.getTargetAlphabet()); InstanceList instances2 = new InstanceList (pipe2); for (int ii = 0; ii < instances.size(); ii++) {
/** * * @param inst input instance, with FeatureVectorSequence as data. * @param alphabetsPipe a Noop pipe containing the data and target alphabets for * the resulting InstanceList and AugmentableFeatureVectors * @return list of instances, each with one AugmentableFeatureVector as data */ public static InstanceList convert(Instance inst, Noop alphabetsPipe) { InstanceList ret = new InstanceList(alphabetsPipe); Object obj = inst.getData(); assert(obj instanceof FeatureVectorSequence); FeatureVectorSequence fvs = (FeatureVectorSequence) obj; LabelSequence ls = (LabelSequence) inst.getTarget(); assert(fvs.size() == ls.size()); Object instName = (inst.getName() == null ? "NONAME" : inst.getName()); for (int j = 0; j < fvs.size(); j++) { FeatureVector fv = fvs.getFeatureVector(j); int[] indices = fv.getIndices(); FeatureVector data = new AugmentableFeatureVector (alphabetsPipe.getDataAlphabet(), indices, fv.getValues(), indices.length); Labeling target = ls.getLabelAtPosition(j); String name = instName.toString() + "_@_POS_" + (j + 1); Object source = inst.getSource(); Instance toAdd = alphabetsPipe.pipe(new Instance(data, target, name, source)); ret.add(toAdd); } return ret; }
public Pipe getPipe() { return new Noop(dataAlphabet, targetAlphabet); }
public CRFExtractor (CRF crf) { this (crf, new Noop ()); }
public CRFExtractor (CRF crf) { this (crf, new Noop ()); }
public CRFExtractor (CRF crf) { this (crf, new Noop ()); }
/** * Construct an InstanceList with initial capacity of 10, with a Noop default pipe. * Used in those infrequent circumstances when Instances typically would not have further * processing, and objects containing vocabularies are entered * directly into the <code>InstanceList</code>; for example, the creation of a * random <code>InstanceList</code> using <code>Dirichlet</code>s and * <code>Multinomial</code>s.</p> * * @param dataAlphabet The vocabulary for added instances' data fields * @param targetAlphabet The vocabulary for added instances' targets */ public InstanceList (Alphabet dataAlphabet, Alphabet targetAlphabet) { this (new Noop(dataAlphabet, targetAlphabet), 10); this.dataAlphabet = dataAlphabet; this.targetAlphabet = targetAlphabet; }
/** * Construct an InstanceList with initial capacity of 10, with a Noop default pipe. * Used in those infrequent circumstances when Instances typically would not have further * processing, and objects containing vocabularies are entered * directly into the <code>InstanceList</code>; for example, the creation of a * random <code>InstanceList</code> using <code>Dirichlet</code>s and * <code>Multinomial</code>s.</p> * * @param dataAlphabet The vocabulary for added instances' data fields * @param targetAlphabet The vocabulary for added instances' targets */ public InstanceList (Alphabet dataAlphabet, Alphabet targetAlphabet) { this (new Noop(dataAlphabet, targetAlphabet), 10); this.dataAlphabet = dataAlphabet; this.targetAlphabet = targetAlphabet; }
/** * Construct an InstanceList with initial capacity of 10, with a Noop default pipe. * Used in those infrequent circumstances when Instances typically would not have further * processing, and objects containing vocabularies are entered * directly into the <code>InstanceList</code>; for example, the creation of a * random <code>InstanceList</code> using <code>Dirichlet</code>s and * <code>Multinomial</code>s.</p> * * @param dataAlphabet The vocabulary for added instances' data fields * @param targetAlphabet The vocabulary for added instances' targets */ public InstanceList (Alphabet dataAlphabet, Alphabet targetAlphabet) { this (new Noop(dataAlphabet, targetAlphabet), 10); this.dataAlphabet = dataAlphabet; this.targetAlphabet = targetAlphabet; }
public CRFExtractor (File crfFile) throws IOException { this (loadCrf(crfFile), new Noop ()); }
public CRFExtractor (File crfFile) throws IOException { this (loadCrf(crfFile), new Noop ()); }
public CRFExtractor (File crfFile) throws IOException { this (loadCrf(crfFile), new Noop ()); }
public CRF (Alphabet inputAlphabet, Alphabet outputAlphabet) { super (new Noop(inputAlphabet, outputAlphabet), null); inputAlphabet.stopGrowth(); logger.info ("CRF input dictionary size = "+inputAlphabet.size()); //xxx outputAlphabet.stopGrowth(); this.inputAlphabet = inputAlphabet; this.outputAlphabet = outputAlphabet; }
public CRF (Alphabet inputAlphabet, Alphabet outputAlphabet) { super (new Noop(inputAlphabet, outputAlphabet), null); inputAlphabet.stopGrowth(); logger.info ("CRF input dictionary size = "+inputAlphabet.size()); //xxx outputAlphabet.stopGrowth(); this.inputAlphabet = inputAlphabet; this.outputAlphabet = outputAlphabet; }