public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
public void test (ACRF acrf, InstanceList data, String description) { List ret = acrf.getBestLabels (data); test (data, ret, description); }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
public List getBestLabels (InstanceList lst) { List ret = new ArrayList (lst.size()); for (int i = 0; i < lst.size(); i++) { ret.add (getBestLabels (lst.get (i))); } return ret; }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
public void test (ACRF acrf, InstanceList testing, ACRFEvaluator[] evals) { List pred = acrf.getBestLabels (testing); for (int i = 0; i < evals.length; i++) { evals[i].setOutputPrefix (outputPrefix); evals[i].test (testing, pred, "Testing"); } }
public List getBestLabels (InstanceList lst) { List ret = new ArrayList (lst.size()); for (int i = 0; i < lst.size(); i++) { ret.add (getBestLabels (lst.get (i))); } return ret; }
public List getBestLabels (InstanceList lst) { List ret = new ArrayList (lst.size()); for (int i = 0; i < lst.size(); i++) { ret.add (getBestLabels (lst.get (i))); } return ret; }
Instance unprocessedInstance = new Instance(data, null, "", null); Instance instance = pipe.newIteratorFrom(Arrays.asList(unprocessedInstance).iterator()).next(); LabelsSequence bestLabels = acrf.getBestLabels(instance); List<String[]> returnValues = new ArrayList<String[]>(features.size()); for (int i = 0; i < bestLabels.size(); i++) {
Instance unprocessedInstance = new Instance(data, null, "", null); Instance instance = pipe.newIteratorFrom(Arrays.asList(unprocessedInstance).iterator()).next(); LabelsSequence bestLabels = acrf.getBestLabels(instance); List<String[]> returnValues = new ArrayList<String[]>(features.size()); for (int i = 0; i < bestLabels.size(); i++) {
public Extraction extract (InstanceList testing) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); for (int i = 0; i < testing.size(); i++) { Instance instance = testing.get (i); Tokenization tok = (Tokenization) instance.getProperty ("TOKENIZATION"); if (tok == null) throw new IllegalArgumentException ("To use extract(InstanceList), must save the Tokenization!"); String name = instance.getName ().toString (); Sequence target = (Sequence) instance.getTarget (); Sequence output = acrf.getBestLabels (instance); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, output, target, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }
public Extraction extract (InstanceList testing) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); for (int i = 0; i < testing.size(); i++) { Instance instance = testing.get (i); Tokenization tok = (Tokenization) instance.getProperty ("TOKENIZATION"); if (tok == null) throw new IllegalArgumentException ("To use extract(InstanceList), must save the Tokenization!"); String name = instance.getName ().toString (); Sequence target = (Sequence) instance.getTarget (); Sequence output = acrf.getBestLabels (instance); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, output, target, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }
public Extraction extract (InstanceList testing) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); for (int i = 0; i < testing.size(); i++) { Instance instance = testing.get (i); Tokenization tok = (Tokenization) instance.getProperty ("TOKENIZATION"); if (tok == null) throw new IllegalArgumentException ("To use extract(InstanceList), must save the Tokenization!"); String name = instance.getName ().toString (); Sequence target = (Sequence) instance.getTarget (); Sequence output = acrf.getBestLabels (instance); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, output, target, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }
public Extraction extract (Iterator<Instance> source) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); // Put all the instances through both pipes, then get viterbi path InstanceList tokedList = new InstanceList (tokPipe); tokedList.addThruPipe (source); InstanceList pipedList = new InstanceList (getFeaturePipe ()); pipedList.addThruPipe (tokedList.iterator()); Iterator<Instance> it1 = tokedList.iterator (); Iterator<Instance> it2 = pipedList.iterator (); while (it1.hasNext()) { Instance toked = it1.next(); Instance piped = it2.next(); Tokenization tok = (Tokenization) toked.getData(); String name = piped.getName().toString(); Sequence target = (Sequence) piped.getTarget (); LabelsSequence output = acrf.getBestLabels (piped); LabelSequence ls = SliceLabelsSequence.sliceLabelsSequence (output, slice); LabelSequence lsTarget = SliceLabelsSequence.sliceLabelsSequence ((LabelsSequence) target, slice); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, ls, lsTarget, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }
public Extraction extract (Iterator<Instance> source) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); // Put all the instances through both pipes, then get viterbi path InstanceList tokedList = new InstanceList (tokPipe); tokedList.addThruPipe (source); InstanceList pipedList = new InstanceList (getFeaturePipe ()); pipedList.addThruPipe (tokedList.iterator()); Iterator<Instance> it1 = tokedList.iterator (); Iterator<Instance> it2 = pipedList.iterator (); while (it1.hasNext()) { Instance toked = it1.next(); Instance piped = it2.next(); Tokenization tok = (Tokenization) toked.getData(); String name = piped.getName().toString(); Sequence target = (Sequence) piped.getTarget (); LabelsSequence output = acrf.getBestLabels (piped); LabelSequence ls = SliceLabelsSequence.sliceLabelsSequence (output, slice); LabelSequence lsTarget = SliceLabelsSequence.sliceLabelsSequence ((LabelsSequence) target, slice); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, ls, lsTarget, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }
public Extraction extract (Iterator<Instance> source) { Extraction extraction = new Extraction (this, getTargetAlphabet ()); // Put all the instances through both pipes, then get viterbi path InstanceList tokedList = new InstanceList (tokPipe); tokedList.addThruPipe (source); InstanceList pipedList = new InstanceList (getFeaturePipe ()); pipedList.addThruPipe (tokedList.iterator()); Iterator<Instance> it1 = tokedList.iterator (); Iterator<Instance> it2 = pipedList.iterator (); while (it1.hasNext()) { Instance toked = it1.next(); Instance piped = it2.next(); Tokenization tok = (Tokenization) toked.getData(); String name = piped.getName().toString(); Sequence target = (Sequence) piped.getTarget (); LabelsSequence output = acrf.getBestLabels (piped); LabelSequence ls = SliceLabelsSequence.sliceLabelsSequence (output, slice); LabelSequence lsTarget = SliceLabelsSequence.sliceLabelsSequence ((LabelsSequence) target, slice); DocumentExtraction docseq = new DocumentExtraction (name, getTargetAlphabet (), tok, ls, lsTarget, backgroundTag, filter); extraction.addDocumentExtraction (docseq); } return extraction; }