|
|
@ -80,7 +80,11 @@
|
|
|
|
$scores[$category] = $data['probability'];
|
|
|
|
$scores[$category] = $data['probability'];
|
|
|
|
// small probability for a word not in the category
|
|
|
|
// small probability for a word not in the category
|
|
|
|
// maybe putting 1.0 as a 'no effect' word can also be good
|
|
|
|
// maybe putting 1.0 as a 'no effect' word can also be good
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($data['word_count'] > 0)
|
|
|
|
$small_proba = 1.0 / ($data['word_count'] * 2);
|
|
|
|
$small_proba = 1.0 / ($data['word_count'] * 2);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
$small_proba = 0;
|
|
|
|
|
|
|
|
|
|
|
|
reset($tokens);
|
|
|
|
reset($tokens);
|
|
|
|
|
|
|
|
|
|
|
|