发布时间:2022-06-29 文章分类:编程知识 投稿人:王小丽 字号: 默认 | | 超大 打印

// inverse document frequency quotient between the number of docs in corpus and number of docs the
// term appears Normalize the value in case the number of appearances is 0.
double idf =Math.log10((double) numberOfDocumentsInCorpus /
(double)((numberOfDocumentsInCorpusWhereKeyAppears ==0?1:0)+
numberOfDocumentsInCorpusWhereKeyAppears
));