experiment: switch to 3-gram tokens

This commit is contained in:
Andrew Dolgov 2015-06-18 09:42:20 +03:00
parent ef7395f170
commit e0940bfc4f
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Af_Sort_Bayes extends Plugin {
$dst_category = "UGLY"; $dst_category = "UGLY";
$nbs = new NaiveBayesianStorage($_SESSION["uid"]); $nbs = new NaiveBayesianStorage($_SESSION["uid"]);
$nb = new NaiveBayesian($nbs); $nb = new NaiveBayesianNgram($nbs, 3);
$result = $this->dbh->query("SELECT score, guid, title, content FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND id = " . $result = $this->dbh->query("SELECT score, guid, title, content FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND id = " .
$article_id . " AND owner_uid = " . $_SESSION["uid"]); $article_id . " AND owner_uid = " . $_SESSION["uid"]);
@ -264,7 +264,7 @@ class Af_Sort_Bayes extends Plugin {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
$nbs = new NaiveBayesianStorage($owner_uid); $nbs = new NaiveBayesianStorage($owner_uid);
$nb = new NaiveBayesian($nbs); $nb = new NaiveBayesianNgram($nbs, 3);
$ref = $nbs->getReference($article["guid"], false); $ref = $nbs->getReference($article["guid"], false);
@ -336,7 +336,7 @@ class Af_Sort_Bayes extends Plugin {
$this->dbh->query("COMMIT"); $this->dbh->query("COMMIT");
$nbs = new NaiveBayesianStorage($_SESSION["uid"]); $nbs = new NaiveBayesianStorage($_SESSION["uid"]);
$nb = new NaiveBayesian($nbs); $nb = new NaiveBayesianNgram($nbs, 3);
$nb->updateProbabilities(); $nb->updateProbabilities();
} }