| Next: Yawns::Date | Previous: Yawns::Comments | [Table of Contents] |
Yawns::CommentTest - Test a comment for troll properties, using a filter.
#!/usr/bin/perl -w
use Yawns::CommentTest;
use strict;
my $tester = Yawns::CommentTest->new( text => "Test" );
if ( $tester->isTroll() )
{
# ...
}
This module contains code for testing comment properties.
Create a new instance of this object.
Return true if this comment text is a troll
Train the bayasian model against all the bad comments ever reported and a random selection of 20 "good" comments. Return the number of trollish comments we learnt from.
Select some comment bodies from the database and apply the given label to them in our bayasian filter. Return the number of comments we successfully trained against.
Steve Kemp
http://www.steve.org.uk/
Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.