コード例 #1
0
ファイル: index.php プロジェクト: msooon/hubzilla
            echo "<tr><td>Classification before learning:</td><td>" . formatRating($ratingBefore) . "</td></tr>\n";
            echo "<tr><td>Classification after learning:</td><td>" . formatRating($ratingAfter) . "</td></tr>\n";
            echo "</table></div>\n\n";
            break;
        case "Save as Ham":
            $ratingBefore = $b8->classify($text);
            $b8->learn($text, b8::HAM);
            $ratingAfter = $b8->classify($text);
            echo "<p>Saved the text as Ham</p>\n\n";
            echo "<div><table>\n";
            echo "<tr><td>Classification before learning:</td><td>" . formatRating($ratingBefore) . "</td></tr>\n";
            echo "<tr><td>Classification after learning:</td><td>" . formatRating($ratingAfter) . "</td></tr>\n";
            echo "</table></div>\n\n";
            break;
        case "Delete from Spam":
            $b8->unlearn($text, b8::SPAM);
            echo "<p style=\"color:green\">Deleted the text from Spam</p>\n\n";
            break;
        case "Delete from Ham":
            $b8->unlearn($text, b8::HAM);
            echo "<p style=\"color:green\">Deleted the text from Ham</p>\n\n";
            break;
    }
    $mem_used = round(memory_get_usage() / 1048576, 5);
    $peak_mem_used = round(memory_get_peak_usage() / 1048576, 5);
    $time_taken = round(microtimeFloat() - $time_start, 5);
}
echo <<<END
<div>
<form action="{$_SERVER['PHP_SELF']}" method="post">
<div>