1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/">
<xi:include href="admin.html" />
<head>
<title>Bayes</title>
<script type="text/javascript">
$(document).ready(function() {
$("#reset").enable(${nham + nspam > 0 and 'true' or 'false'});
});
</script>
</head>
<body>
<h2>Spam Filtering: Bayes</h2>
<form class="mod" id="spamconfig" method="post">
<fieldset>
<legend>Configuration</legend>
<p>The bayesian filter requires training before it can effectively
differentiate between spam and ham. The training database currently
contains <strong>${nspam} spam</strong> and
<strong>${nham} ham</strong> submissions.</p>
<div class="field">
<label><input type="checkbox" id="reset" name="reset"
disabled="${nham + nspam == 0 or None}" />
Clear training database
</label>
<p class="hint">
Resetting the training database can help when training was incorrect
and is producing bad results.
</p>
</div>
<div class="field">
<label>Minimum training required:
<input type="text" id="min_training" name="min_training" size="3"
value="${min_training}" />
</label>
<p class="hint">
The minimum number of spam and ham in the training database before
the filter starts affecting the karma of submissions.
</p>
</div>
<div class="buttons">
<input type="submit" value="Apply changes" />
</div>
</fieldset>
<fieldset>
<legend>Training</legend>
<p class="hint">
While you can train the spam filter from the “<em>Spam
Filtering → Monitoring</em>” panel in the web
administration interface, you can also manually train the filter by
entering samples here, or check what kind of spam probabilty
currently gets assigned to the content.
</p>
<div class="field">
<label for="content">Content:</label><br />
<textarea id="content" name="content" rows="10" cols="60">
${content}</textarea>
</div>
<div py:if="content" class="field" py:choose="">
<strong py:when="error">Error: ${error}</strong>
<strong py:otherwise="">Score: ${round(score * 100, 2)}%</strong>
</div>
<div class="buttons">
<input type="submit" name="test" value="Test"
disabled="${(not nham or not nspam) or None}" />
<input type="submit" name="train" value="Train as Spam" />
<input type="submit" name="train" value="Train as Ham" />
</div>
</fieldset>
</form>
</body>
</html>
|