Classifier4J是一个轻量级的分类工具,支持贝叶斯分类、向量空间模型、信息摘要等。
简单实例代码:
SimpleClassifier classifier = new SimpleClassifier(); classifier.setSearchWord( "java" ); String sentance = "This is a sentance about java"; System.out.println( "The string " + sentance + " contains the word java:" + classifier.isMatch(sentance) );