本文整理汇总了Java中cc.mallet.extract.LatticeViewer.extraction2html方法的典型用法代码示例。如果您正苦于以下问题:Java LatticeViewer.extraction2html方法的具体用法?Java LatticeViewer.extraction2html怎么用?Java LatticeViewer.extraction2html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cc.mallet.extract.LatticeViewer
的用法示例。
在下文中一共展示了LatticeViewer.extraction2html方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSpaceViewer
import cc.mallet.extract.LatticeViewer; //导入方法依赖的package包/类
public void testSpaceViewer () throws FileNotFoundException
{
Pipe pipe = TestMEMM.makeSpacePredictionPipe ();
String[] data0 = { TestCRF.data[0] };
String[] data1 = { TestCRF.data[1] };
InstanceList training = new InstanceList (pipe);
training.addThruPipe (new ArrayIterator (data0));
InstanceList testing = new InstanceList (pipe);
testing.addThruPipe (new ArrayIterator (data1));
CRF crf = new CRF (pipe, null);
crf.addFullyConnectedStatesForLabels ();
CRFTrainerByLabelLikelihood crft = new CRFTrainerByLabelLikelihood (crf);
crft.trainIncremental (training);
CRFExtractor extor = hackCrfExtor (crf);
Extraction extration = extor.extract (new ArrayIterator (data1));
PrintStream out = new PrintStream (new FileOutputStream (htmlFile));
LatticeViewer.extraction2html (extration, extor, out);
out.close();
out = new PrintStream (new FileOutputStream (latticeFile));
LatticeViewer.extraction2html (extration, extor, out, true);
out.close();
}
示例2: ignoretestSpaceViewer
import cc.mallet.extract.LatticeViewer; //导入方法依赖的package包/类
public void ignoretestSpaceViewer () throws FileNotFoundException
{
Pipe pipe = TestMEMM.makeSpacePredictionPipe ();
String[] data0 = { TestCRF.data[0] };
String[] data1 = { TestCRF.data[1] };
InstanceList training = new InstanceList (pipe);
training.addThruPipe (new ArrayIterator (data0));
InstanceList testing = new InstanceList (pipe);
testing.addThruPipe (new ArrayIterator (data1));
CRF crf = new CRF (pipe, null);
crf.addFullyConnectedStatesForLabels ();
CRFTrainerByLabelLikelihood crft = new CRFTrainerByLabelLikelihood (crf);
crft.trainIncremental (training);
CRFExtractor extor = hackCrfExtor (crf);
Extraction extration = extor.extract (new ArrayIterator (data1));
PrintStream out = new PrintStream (new FileOutputStream (htmlFile));
LatticeViewer.extraction2html (extration, extor, out);
out.close();
out = new PrintStream (new FileOutputStream (latticeFile));
LatticeViewer.extraction2html (extration, extor, out, true);
out.close();
}