本文整理汇总了Java中org.galagosearch.core.types.DocumentWordProbability类的典型用法代码示例。如果您正苦于以下问题:Java DocumentWordProbability类的具体用法?Java DocumentWordProbability怎么用?Java DocumentWordProbability使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DocumentWordProbability类属于org.galagosearch.core.types包,在下文中一共展示了DocumentWordProbability类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.galagosearch.core.types.DocumentWordProbability; //导入依赖的package包/类
public void process(DocumentLengthWordCount object) throws IOException {
double background = backgrounds.get(object.word);
double foreground = 0;
if (object.length > 0) {
foreground = (double) object.count / (double) object.length;
}
double probability = lambda * foreground + (1 - lambda) * background;
processor.process(new DocumentWordProbability(object.document,
Utility.makeBytes(object.word), probability));
}
示例2: process
import org.galagosearch.core.types.DocumentWordProbability; //导入依赖的package包/类
public void process(DocumentLengthWordCount object) throws IOException {
double probability = smooth(object.word, object.count, object.length);
processor.process(new DocumentWordProbability(object.document,
Utility.makeBytes(object.word), probability));
}
示例3: getOutputClass
import org.galagosearch.core.types.DocumentWordProbability; //导入依赖的package包/类
public Class<DocumentWordProbability> getOutputClass() {
return DocumentWordProbability.class;
}