{
  "attachments": [],
  "comments_archived": true,
  "date": "2003-08-16T04:28:41.000Z",
  "layout": "post",
  "title": "Issues in using SpamBayes to filter news items",
  "wordpress_id": 462,
  "wordpress_slug": "bayes-agg-one",
  "wordpress_url": "http://www.decafbad.com/blog/?p=462",
  "year": "2003",
  "month": "08",
  "day": "16",
  "isDir": false,
  "slug": "bayes-agg-one",
  "type": "entry",
  "postName": "2003-08-16-bayes-agg-one",
  "html": "<p>Despite a reading <a href=\"http://www.srijith.net/trinetre/archives/2003/08/11/index.shtml#000373\">an entry by Srijith</a>\ndiscussing Bayes-based classification as unsuitable\nfor use in news aggregators, I tied <a href=\"http://www.spambayes.org\">SpamBayes</a>\ninto my <a href=\"http://www.decafbad.com/viewcvs.cgi/dbagg/\">homebrew news aggregator</a>\nand have been trying it out this week.  I know I’ve been <a href=\"http://www.decafbad.com/blog/geek/syndicated_whuffie.phtml\">talking about it</a>\nfor awhile, but procrastination and being busy all round kept me from getting\nto it.  Funny thing is, when I finally got a chance to really check things out,\nthe integration was a snap.  I’d anticipated a bit of work, but was pleasantly\nsurprised.  I doubt that any other aggregator written in\nPython would have a hard time with it.</p>\n\n<pre><code>&lt;p&gt;If, that is, anyone else wants to do it.  I already knew it wasn&amp;#8217;t\n</code></pre>\n<p><a href=\"http://diveintomark.org/archives/2003/07/07/linkdumps_are_like_sex\">magic pixy dust</a>\nbut I figured it might be worth a try.  I will be eating my dogfood\nfor awhile with this, but I’m thinking already that what’s good for spam\nmight not be so good for news aggregators.</p><p></p>\n<pre><code>&lt;p&gt;Srijith&amp;#8217;s &lt;a href=\"http://www.srijith.net/trinetre/archives/2003/08/11/index.shtml#000373\"&gt;post&lt;/a&gt;\n</code></pre>\n<p>mentions some snags in ignoring some of the semantics of a news item,\nsuch as whether a word appears in the item’s title or information about\nthe item’s source.  I don’t think that this completely\napplies to how I’m doing classification, since SpamBayes appears to\ndifferentiate between words found in email headers and the body itself.\nWhen I feed an item to SpamBayes for training and scoring, I represent\nit as something like an email message, with headers like date, subject,\nfrom, and an “X-Link” header for the link.  However, even with this,\nI think Srijith’s got a point when he writes that this method will miss\na lot of available clues for classification.</p><p></p>\n<pre><code>&lt;p&gt;Unlike Srijith&amp;#8217;s examples, though, I&amp;#8217;m not trying to train my\n</code></pre>\n<p>aggregator to sift entries into any specific categories.  So far, I’ve\nbeen trying to get it to discriminate between what I really want to\nread, and what I’m not so interested in.  So, I figured that something\nwhich can learn the difference between spam and normal email could help.\nBut, although it’s early, I’m noticing a few things about the results and\nI’ve had a few things occur to me.</p><p></p>\n<pre><code>&lt;p&gt;See, in the case of ham vs spam, I really want all the ham and none of\n</code></pre>\n<p>the spam.  A method to differentiate between these two should be\noptimized toward one answer or the other.  SpamBayes offers “I don’t\nknow” as a third answer, but it’s not geared toward anything else\nin-between.  However, in measuring something like “interest“,\ninbetween answers are useful.  I want all of the interesting stuff,\nsome of the sort-of interesting stuff, and a little of the rest.</p><p></p>\n<pre><code>&lt;p&gt;This is also a problem for me in deciding to what I\n</code></pre>\n<p>should give a thumbs up and what gets the thumbs down.  Even though\nI’ve subscribed to a little over 300 feeds, every item from each of\nthem is somewhat interesting to me.  I wouldn’t have subscribed to the\nfeed if there wasn’t anything of interest there, so I’ve already\nbiased the content of what I receive.  Some items are more interesting\nthan others, but the difference between them is nowhere near the\ndifference of wanted ham vs unsolicited spam.  So, I find myself\ngiving the nod to lots of items, but only turning down a few.\nSpamBayes would like equal examples of both, if possible.</p><p></p>\n<pre><code>&lt;p&gt;I&amp;#8217;ll still be playing with this for awhile, but I need to look\n</code></pre>\n<p>around at other machine learning tech.  I’m just hacking around,\nbut the important thing is to try to understand the algorithms\nbetter and know how they work and why.  Bayes is in vogue right now,\nbut as Mark Pilgrim intimated, it’s not magic.  It’s just “advanced” :)</p><p></p>\n<pre><code>&lt;p&gt;In the immortal words of &lt;a href=\"http://www.spidereyeballs.com/os6/set3/small_os6_d3_3596_sm.html\"&gt;Mark Jason Dominus&lt;/a&gt;: &amp;#8220;You can&amp;#8217;t just make shit\n</code></pre>\n<p>up and expect the computer to know what you mean, retardo!” </p><p></p>\n<!--more-->\n\n\n<p>shortname=bayes_agg_one</p>\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221088958\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://philringnalda.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e68e9944f50a481a64b5a32fdfc02e0d&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://philringnalda.com\">Phil Ringnalda</a>\n</div>\n\n\n<p><a href=\"#comment-221088958\" class=\"permalink\"><time datetime=\"2003-08-16T00:54:54\">2003-08-16T00:54:54</time></a></p>\n</div>\n\n\n<div class=\"content\">If you want to train a spam classifier quick, you've got to feed it spam. If you want to train an aggregator classifier, you've got to subscribe to more crap. I do my best to throw you a really stupid post once a week or so, but you need a bunch of feeds yammering on and on about nothing much.\nI'd recommend using MyRSS or Blogstreet (or your own scraper  if you've got one) on a random selection of Blog*Spot blogs: my RandomFreshBlog bookmarklet seems to turn up an unending supply of training material.</div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": "<p>Despite a reading <a href=\"http://www.srijith.net/trinetre/archives/2003/08/11/index.shtml#000373\">an entry by Srijith</a>\r\ndiscussing Bayes-based classification as unsuitable\r\nfor use in news aggregators, I tied <a href=\"http://www.spambayes.org\">SpamBayes</a>\r\ninto my <a href=\"http://www.decafbad.com/viewcvs.cgi/dbagg/\">homebrew news aggregator</a>\r\nand have been trying it out this week.  I know I&#8217;ve been <a href=\"http://www.decafbad.com/blog/geek/syndicated_whuffie.phtml\">talking about it</a>\r\nfor awhile, but procrastination and being busy all round kept me from getting\r\nto it.  Funny thing is, when I finally got a chance to really check things out,\r\nthe integration was a snap.  I&#8217;d anticipated a bit of work, but was pleasantly\r\nsurprised.  I doubt that any other aggregator written in\r\nPython would have a hard time with it.</p>\r\n\r\n\t<p>If, that is, anyone else wants to do it.  I already knew it wasn&#8217;t\r\n<a href=\"http://diveintomark.org/archives/2003/07/07/linkdumps_are_like_sex\">magic pixy dust</a>\r\nbut I figured it might be worth a try.  I will be eating my dogfood\r\nfor awhile with this, but I&#8217;m thinking already that what&#8217;s good for spam\r\nmight not be so good for news aggregators.</p>\r\n\r\n\t<p>Srijith&#8217;s <a href=\"http://www.srijith.net/trinetre/archives/2003/08/11/index.shtml#000373\">post</a>\r\nmentions some snags in ignoring some of the semantics of a news item,\r\nsuch as whether a word appears in the item&#8217;s title or information about\r\nthe item&#8217;s source.  I don&#8217;t think that this completely\r\napplies to how I&#8217;m doing classification, since SpamBayes appears to\r\ndifferentiate between words found in email headers and the body itself.\r\nWhen I feed an item to SpamBayes for training and scoring, I represent\r\nit as something like an email message, with headers like date, subject,\r\nfrom, and an &#8220;X-Link&#8221; header for the link.  However, even with this,\r\nI think Srijith&#8217;s got a point when he writes that this method will miss\r\na lot of available clues for classification.</p>\r\n\r\n\t<p>Unlike Srijith&#8217;s examples, though, I&#8217;m not trying to train my\r\naggregator to sift entries into any specific categories.  So far, I&#8217;ve\r\nbeen trying to get it to discriminate between what I really want to\r\nread, and what I&#8217;m not so interested in.  So, I figured that something\r\nwhich can learn the difference between spam and normal email could help.\r\nBut, although it&#8217;s early, I&#8217;m noticing a few things about the results and\r\nI&#8217;ve had a few things occur to me.</p>\r\n\r\n\t<p>See, in the case of ham vs spam, I really want all the ham and none of\r\nthe spam.  A method to differentiate between these two should be\r\noptimized toward one answer or the other.  SpamBayes offers &#8220;I don&#8217;t\r\nknow&#8221; as a third answer, but it&#8217;s not geared toward anything else\r\nin-between.  However, in measuring something like &#8220;interest&#8220;,\r\ninbetween answers are useful.  I want all of the interesting stuff,\r\nsome of the sort-of interesting stuff, and a little of the rest.</p>\r\n\r\n\t<p>This is also a problem for me in deciding to what I\r\nshould give a thumbs up and what gets the thumbs down.  Even though\r\nI&#8217;ve subscribed to a little over 300 feeds, every item from each of\r\nthem is somewhat interesting to me.  I wouldn&#8217;t have subscribed to the\r\nfeed if there wasn&#8217;t anything of interest there, so I&#8217;ve already\r\nbiased the content of what I receive.  Some items are more interesting\r\nthan others, but the difference between them is nowhere near the\r\ndifference of wanted ham vs unsolicited spam.  So, I find myself\r\ngiving the nod to lots of items, but only turning down a few.\r\nSpamBayes would like equal examples of both, if possible.</p>\r\n\r\n\t<p>I&#8217;ll still be playing with this for awhile, but I need to look\r\naround at other machine learning tech.  I&#8217;m just hacking around,\r\nbut the important thing is to try to understand the algorithms\r\nbetter and know how they work and why.  Bayes is in vogue right now,\r\nbut as Mark Pilgrim intimated, it&#8217;s not magic.  It&#8217;s just &#8220;advanced&#8221; :)</p>\r\n\r\n\t<p>In the immortal words of <a href=\"http://www.spidereyeballs.com/os6/set3/small_os6_d3_3596_sm.html\">Mark Jason Dominus</a>: &#8220;You can&#8217;t just make shit\r\nup and expect the computer to know what you mean, retardo!&#8221; </p>\r\n<!--more-->\r\nshortname=bayes_agg_one\r\n\r\n<div id=\"comments\" class=\"comments archived-comments\">\r\n            <h3>Archived Comments</h3>\r\n            \r\n        <ul class=\"comments\">\r\n            \r\n        <li class=\"comment\" id=\"comment-221088958\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://philringnalda.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=e68e9944f50a481a64b5a32fdfc02e0d&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://philringnalda.com\">Phil Ringnalda</a>\r\n                </div>\r\n                <a href=\"#comment-221088958\" class=\"permalink\"><time datetime=\"2003-08-16T00:54:54\">2003-08-16T00:54:54</time></a>\r\n            </div>\r\n            <div class=\"content\">If you want to train a spam classifier quick, you've got to feed it spam. If you want to train an aggregator classifier, you've got to subscribe to more crap. I do my best to throw you a really stupid post once a week or so, but you need a bunch of feeds yammering on and on about nothing much.\r\n\r\nI'd recommend using MyRSS or Blogstreet (or your own scraper  if you've got one) on a random selection of Blog*Spot blogs: my RandomFreshBlog bookmarklet seems to turn up an unending supply of training material.</div>\r\n            \r\n        </li>\r\n    \r\n        </ul>\r\n    \r\n        </div>\r\n    ",
  "parentPath": "./content/posts/archives/2003",
  "path": "2003/08/16/bayes-agg-one",
  "summary": "Despite a reading an entry by Srijith\ndiscussing Bayes-based classification as unsuitable\nfor use in news aggregators, I tied SpamBayes\ninto my homebrew news aggregator\nand have been trying it out this week.  I know I’ve been talking about it\nfor awhile, but procrastination and being busy all round kept me from getting\nto it.  Funny thing is, when I finally got a chance to really check things out,\nthe integration was a snap.  I’d anticipated a bit of work, but was pleasantly\nsurprised.  I doubt that any other aggregator written in\nPython would have a hard time with it.\n\n<p>If, that is, anyone else wants to do it.  I already knew it wasn&#8217;t\n\nmagic pixy dust\nbut I figured it might be worth a try.  I will be eating my dogfood\nfor awhile with this, but I’m thinking already that what’s good for spam\nmight not be so good for news aggregators.\n<p>Srijith&#8217;s <a href=\"http://www.srijith.net/trinetre/archives/2003/08/11/index.shtml#000373\">post</a>\n\nmentions some snags in ignoring some of the semantics of a news item,\nsuch as whether a word appears in the item’s title or information about\nthe item’s source.  I don’t think that this completely\napplies to how I’m doing classification, since SpamBayes appears to\ndifferentiate between words found in email headers and the body itself.\nWhen I feed an item to SpamBayes for training and scoring, I represent\nit as something like an email message, with headers like date, subject,\nfrom, and an “X-Link” header for the link.  However, even with this,\nI think Srijith’s got a point when he writes that this method will miss\na lot of available clues for classification.\n<p>Unlike Srijith&#8217;s examples, though, I&#8217;m not trying to train my\n\naggregator to sift entries into any specific categories.  So far, I’ve\nbeen trying to get it to discriminate between what I really want to\nread, and what I’m not so interested in.  So, I figured that something\nwhich can learn the difference between spam and normal email could help.\nBut, although it’s early, I’m noticing a few things about the results and\nI’ve had a few things occur to me.\n<p>See, in the case of ham vs spam, I really want all the ham and none of\n\nthe spam.  A method to differentiate between these two should be\noptimized toward one answer or the other.  SpamBayes offers “I don’t\nknow” as a third answer, but it’s not geared toward anything else\nin-between.  However, in measuring something like “interest“,\ninbetween answers are useful.  I want all of the interesting stuff,\nsome of the sort-of interesting stuff, and a little of the rest.\n<p>This is also a problem for me in deciding to what I\n\nshould give a thumbs up and what gets the thumbs down.  Even though\nI’ve subscribed to a little over 300 feeds, every item from each of\nthem is somewhat interesting to me.  I wouldn’t have subscribed to the\nfeed if there wasn’t anything of interest there, so I’ve already\nbiased the content of what I receive.  Some items are more interesting\nthan others, but the difference between them is nowhere near the\ndifference of wanted ham vs unsolicited spam.  So, I find myself\ngiving the nod to lots of items, but only turning down a few.\nSpamBayes would like equal examples of both, if possible.\n<p>I&#8217;ll still be playing with this for awhile, but I need to look\n\naround at other machine learning tech.  I’m just hacking around,\nbut the important thing is to try to understand the algorithms\nbetter and know how they work and why.  Bayes is in vogue right now,\nbut as Mark Pilgrim intimated, it’s not magic.  It’s just “advanced” :)\n<p>In the immortal words of <a href=\"http://www.spidereyeballs.com/os6/set3/small_os6_d3_3596_sm.html\">Mark Jason Dominus</a>: &#8220;You can&#8217;t just make shit\n\nup and expect the computer to know what you mean, retardo!”",
  "needsBuild": true,
  "prevPostPath": "2003/08/14/tree-files-too",
  "prevPostTitle": "Tree files too (the prequel)",
  "nextPostPath": "2003/08/19/cookies-are-yummy",
  "nextPostTitle": "Cookies are yummy"
}