use of com.hankcs.hanlp.model.crf.FeatureFunction in project HanLP by hankcs.
the class TestCRF method testLoadModelWithBiGramFeature.
public void testLoadModelWithBiGramFeature() throws Exception {
String path = HanLP.Config.CRFSegmentModelPath + Predefine.BIN_EXT;
CRFModel model = new CRFModel(new BinTrie<FeatureFunction>());
model.load(ByteArray.createByteArray(path));
Table table = new Table();
String text = "人民生活进一步改善了";
table.v = new String[text.length()][2];
for (int i = 0; i < text.length(); i++) {
table.v[i][0] = String.valueOf(text.charAt(i));
}
model.tag(table);
System.out.println(table);
}
Aggregations