public Instance shallowCopy () { Instance ret = new Instance (data, target, name, source); ret.pipe = pipe; ret.locked = locked; ret.properties = properties; return ret; }
public Instance nextInstance () { assert (nextLineGroup != null); // Instance carrier = new Instance (nextLineGroup, null, "linegroup"+groupIndex++, null); Instance carrier = null; if(clusterNo_true != null) carrier = new Instance (nextLineGroup, null, referenceNo + ":" + clusterNo + ":" + clusterNo_true, null); else carrier = new Instance (nextLineGroup, null, referenceNo + ":" + clusterNo, null); nextLineGroup = getNextLineGroup (); return carrier; }
public Instance nextInstance () { URI uri = null; try { uri = new URI ("array:" + index++); } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException(); } return new Instance (subIterator.next(), target, uri, null); }
public Instance nextInstance () { if (subIterator.hasNext()) { NodeClusterPair p = (NodeClusterPair)subIterator.next(); return new Instance (p, p.getLabel() ? "yes" : "no", null, null); } else return null; }
public Instance nextInstance () { assert (nextLineGroup != null); Instance carrier = new Instance (nextLineGroup, null, "linegroup"+groupIndex++, null); nextLineGroup = getNextLineGroup (); return carrier; }
public Instance nextInstance () { Instance carrier = new Instance (nextGroup, null, "parengroup"+(groupIdx++), null); nextGroup = getNextGroup (); return carrier; }
/** Constructs and appends an instance to this list, passing it through this * list's pipe and assigning it the specified weight. * @return <code>true</code> */ public boolean add (Object data, Object target, Object name, Object source, double instanceWeight) { return add (new Instance (data, target, name, source, pipe), instanceWeight); }
public Instance nextInstance () { Segment nextSegment = (Segment) subIterator.next(); return new Instance (nextSegment, nextSegment.getTruth (), null, null); }
public Instance nextInstance () { assert (nextElement != null); Instance carrier = new Instance (nextElement, null, "element"+elementIndex++, null); nextElement = getNextElement (); return carrier; }
public double weightOfConfig (int [] indexList, List instList) { double score = 0.0; for (int i=0; i<indexList.length; i++) { for (int j=i; j > 0; j--) { NodePair p = new NodePair((Citation)instList.get(i),(Citation)instList.get(j)); Instance inst = new Instance(p, "yes", null, p, this.pipe); score += computeScore_NBest(meClassifier, inst, indexList[i], indexList[j]); } } return score; }
private Tokenization doTokenize (Object obj) { Instance toked = new Instance (obj, null, null, null); tokenizationPipe.pipe (toked); return (Tokenization) toked.getData (); }
public Sequence transduce (Object unpipedInput) { Instance inst = new Instance (unpipedInput, null, null, null, inputPipe); return transduce ((FeatureVectorSequence) inst.getData ()); }
public ViterbiPathBeamFB viterbiPathBeamFB (Object unpipedObject) { Instance carrier = new Instance (unpipedObject, null, null, null, inputPipe); return viterbiPathBeamFB ((Sequence)carrier.getData()); }
public Classification classify (Object obj) { if (obj instanceof Instance) return classify ((Instance)obj); return classify (new Instance (obj, null, null, null, instancePipe)); }
public ViterbiPath viterbiPath (Object unpipedObject) { Instance carrier = new Instance (unpipedObject, null, null, null, inputPipe); return viterbiPath ((Sequence)carrier.getData()); }
public void testOldCrf () { CRF4 crf = (CRF4) FileUtils.readObject (new File (oldCrfFile)); Instance inst = new Instance (testString, null, null, null, crf.getInputPipe ()); Sequence output = crf.transduce ((Sequence) inst.getData ()); String std = output.toString (); assertEquals (" B-PER I-PER O O", std); }
/** Calculates the confidence in the tagging of a {@link Segment}. */ public double estimateConfidenceFor (Segment segment, Transducer.Lattice cachedLattice) { Classification c = this.meClassifier.classify (new Instance ( segment, segment.getTruth(), null, null, pipe)); return c.getLabelVector().value (this.correct); } }
public void testOneFromSerialized () throws IOException, ClassNotFoundException { SerialPipes.setSuppressExceptions (false); Pipe p = createIteratingPipe (); Pipe clone = (Pipe) TestSerializable.cloneViaSerialization (p); InstanceList ilist = (InstanceList) new Instance (data, null, null, null, clone).getData(); assertTrue (ilist.size() == 3); }
/** Adds to this list every instance generated by the iterator, * passing each one through this list's pipe. */ public void add (PipeInputIterator pi) { int i=0; while (pi.hasNext()) { Instance carrier = pi.nextInstance(); // xxx Perhaps try to arrange this so that a new Instance does not have to allocated. add (new Instance (carrier.getData(), carrier.getTarget(), carrier.name, carrier.getSource(), this.pipe)); } }
public Instance nextInstance () { final Instance instance = iter.nextInstance (); Instance ret = new Instance (instance.getData(), instance.getTarget(), instance.getName(), instance.getSource()); ret.setPropertyList (instance.getPropertyList ()); return ret; }