function get_tfidf($word, $count) { if ($count < 1000) $count = 21000 - $count * 18; $tf = log($count); $tf = pow($tf, 5) * log(strlen($word)); $tf = log($tf); $idf = log(5000000000/$count); //if ($tf > 13) $idf *= 1.4; return array($...
function get_tfidf($word, $count) { if ($count < 1000) $count = 21000 - $count * 18; $tf = log($count); $tf = pow($tf, 5) * log(strlen($word)); $tf = log($tf); $idf = log(5000000000/$count); //if ($tf > 13) $idf *= 1.4; return array($...
...武英雄 [off] => 0 [len] => 12 [idf] => 1 [attr] => tf ) ) 字典变了。读出来没变
...http://www.ftphp.com/scws/demo/v4.php[/url](含自定词汇功能) TF/IDF简易查询计算器:[url=http://www.ftphp.com/scws/demo/v4.php]http://www.ftphp.com/scws/demo/get_tfidf.php [/url](用于新词添加时不知怎么设tf,idf的话) 基于SCWS自动分类演示:[url=http://www.ftphp...
...http://www.ftphp.com/scws/demo/v4.php[/url](含自定词汇功能) TF/IDF简易查询计算器:[url=http://www.ftphp.com/scws/demo/v4.php]http://www.ftphp.com/scws/demo/get_tfidf.php [/url](用于新词添加时不知怎么设tf,idf的话) 基于SCWS自动分类演示:[url=http://www.ftphp...
a.txt文档内容: # WORD TF IDF ATTR 印第安那 13.30 15.98 ns 印第安那州 12.72 11.56 ns 印第安那波利斯 12.31 12.68 ns [php] $txt = '我名字叫印第安那,我的家乡是印第安那州的印第安那波利斯!'; $so = scws_open(); scws_set_charset($so, 'gbk'); s...
...http://www.ftphp.com/scws/demo/v4.php[/url](含自定词汇功能) TF/IDF简易查询计算器:[url=http://www.ftphp.com/scws/demo/get_tfidf.php]http://www.ftphp.com/scws/demo/get_tfidf.php [/url](用于新词添加时不知怎么设tf,idf的话) 基于SCWS自动分类演示:[url=http://ww...