Monday, December 31, 2007

Defensio: smarter than the average troll.

So, I've been using the Defensio API lately. There's a "Defensio on Rails" plugin that I've had success implementing (with a few hacks specifically for the site using it, thank God for open source).

I've always been meaning to integrate Defensio into the anonymous blogging site I run, since I figured that sooner or later someone was going to target it for spam.

And I was right.

But the spam that eventually came wasn't your every-day automated "buy viagra now" spam. What the site got hit with was curious hybridization of trolling and spam; it was spam, no doubt, but it was clearly posted by actual people attempting to troll the site. Let's call the phenomenon "Troll Spam" for now.

After swatting away the first few posts by hand, I quickly looked into Akismet and Defensio's APIs. I was on a "short schedule" since I hadn't planned on spending my entire day implementing an anti-spam filter or doing the filtering by hand.

I eventually chose Defensio, and had it up and running in less than 2 hours. Why?

* Good API documentation: even though I was using the Defensio on Rails plugin (see above), I still needed to know the mechanics. Going through the Defensio API page was a breeze.

* RSS feed for "innocent" and "spam" pages. This was incredibly convenient for checking the results of the Defensio on the production site. I have my own little admin section that looks like it came out from a cracker-jack box, but Defensio's RSS feeds make it much better to monitor, real-time, what's ham and what's spam on the production site.

* Statistics. Tells me how the system is working. Not useful now, but fun to watch!

But by far the most important feature was that Defensio learns. The Troll Spam all had a similar theme, but different content. If you've ever seen a "raid" by 4chan or Something Awful goons, you'll know what I mean. Certain words, phrases, etc, repeated together. After training Defensio to HULK-SMASH the next few bursts of Troll Spam it's caught on to my intentions and started filtering out the bull-shit while still letting in the good-shit.

Meanwhile, the site continues to operate normally, the regulars not even realizing there's a Secret War happening!

Now, I know I could have spent 20 minutes creating my own filter that would have whacked posts that had these phrases in them, but this is so much better: Defensio has even started marking other posts by these trolls as spam as well. One of them thought they were going to be clever and posted an entire 3-page "ABC REPORTS" article. Never hit the front-page.

At the time of this writing they've basically just given up and started posting a long stream of obscenities (which is easier for them I guess), but none of it is getting through...

Statistically, Defensio has about a 50% accuracy, but it's been implemented less than 24 hours and its learning very, very quickly.

Smells like victory to me.

My only regret is that I didn't get Defensio implemented sooner -- I missed out on a lot of good learning data.

3 comments:

Nick said...

In response to: http://www.techcrunch.com/2008/01/01/australian-government-equates-freedom-of-speech-to-liking-kiddie-porn/#comment-1910710

AW wrote..

"As an American, I find this incredibly useful: the next time I hear smack talk by some Australian guy lol-ing because he thinks his government / country is better than mine, well…

I’m just going to point him to “The Internet is Kiddy Porn” Conroy and keep moving."

Riiight. So an idiot Labor Senator (and floundering 'New Leadership') makes up for a century of avaricious war-mongering by your social and economic elites, political and military meddling in the affairs of countries who are only linked to yours via "free trade", a completely shoddy election system and an apathetic public too busy consulting Dr. Phil rather than getting off their butts and voting, a constituency that is content to let a moronic marionet act as their President, a media that purports to merely 'follow' the election but effectively decides it before polling day even arrives... not to mention your crap health care system, selective education system (lets pay half a million dollars for college!), a really disturbing identity crisis, environmental degradation not only to your own country but also to the rest of the planet... gah I'm running out of breath here.

Look. Rudd is a stooge, I didn't vote for that smarmy pigeon but unfortunately enough people were sucked in to his US-style electioneering campaign and now he's PM. Furthermore, Australia is far from perfect, we have many many problems. But you need your logic checked out if you believe that this "policy" (if it can so be called) somehow equates to a political or public system as lacking as yours. I'm not anti-American as an absolute, but I think certain things are important in a society, and a country that doesn't have these things I view as developing or merely deficient.

In any event, this move by Rudd is another blunder, and will possibly alienate even his own voters - which is good, with luck Labor wont last long, Liberal will have learned their lesson, and we can get back to rational government.

I hope you find this "useful".

Bet's On said...

Man, you really went the distance if you came all the way here just to reply to that age old comment.

First off, it was a joke, and secondly, you need to chill out a little. Maybe take a vacation. Might do you good.

Nick said...

Really? I just clicked your name on your TechCrunch; you linked this site to it.

Whatever. Cool joke..