You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Norman Maurer <nm...@byteaction.de> on 2006/08/30 00:05:37 UTC

RE: [jira] Closed: (JAMES-514) Add Mailet that support jason for spamfiltering

Am Dienstag, den 29.08.2006, 17:58 -0400 schrieb Noel J. Bergman:
> > I think we will not do this until jasen will get published
> > under a acceptable license
> 
> We already have Bayesian support under a suitable license.  Wouldn't hurt to go to the same articles and add the improvements sugggested by Gary Robinson.
> 
> 	--- Noel

What for suggestions ?

bye
Norman

Re: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
Just found the following in Gary Robinson's blog 
(http://radio.weblogs.com/0101454/stories/2002/09/16/spamDetection.html):

<snip>
Note 2: In calculating p(w) Graham counts every instance of word w in 
every email in which it appears. Obviously, if a word appears once in an 
email, there is a greater probability that it will appear again in that 
same email than if it hadn't already appeared at all. So, the random 
variable is not really independent under Graham's technique which is one 
reason why, in the description above, we only count the first 
occurrence. However, we are pragmatic and whatever works best in 
practice is what we should do. There is some evidence at this point that 
using the Graham counting technique leads to slightly better results 
than using the "pure" technique above. This may because it is not 
ignoring any of the data. So, p(w) and n should simply be computed the 
way that gives the best results.
</snip>

It means that Gary endorses using the Graham counting technique as 
leading "to slightly better results" than the technique used in his paper.

It means that we can (and should) use our counters while using the rest 
of his approach (my second - and straightforward - suggested approach in 
this thread).

Do you agree, or I'm missing something :-) ?

If all the above is true, I'll definitely start looking more in the near 
future on how to implement the chi-square technique described by Gary in 
his paper (http://garyrob.blogs.com//handlingtokenredundancy94.pdf). As 
I said, it should be relatively easy.

Perhaps, as you suggest, I could doublecheck with Gary.

Advice!

Vincenzo

Noel J. Bergman wrote:

>Vincenzo,
>
>I have not looked deeply at the algorithms or implementation.  You and a few
>others have spent considerable time at it.  Therefore I will defer to your
>best judgement.
>
>Since you've clarified a specific difference in the computations, does it
>make sense to engage Gary Robinson and Paul Graham in discussion about the
>difference(s) you've noted?
>
>	--- Noel
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>For additional commands, e-mail: server-dev-help@james.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


RE: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by "Noel J. Bergman" <no...@devtech.com>.
Vincenzo,

I have not looked deeply at the algorithms or implementation.  You and a few
others have spent considerable time at it.  Therefore I will defer to your
best judgement.

Since you've clarified a specific difference in the computations, does it
make sense to engage Gary Robinson and Paul Graham in discussion about the
difference(s) you've noted?

	--- Noel



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
I took a deep look to our curent BayesianAnalyzer code and to Gary 
Robinson's blog and paper 
(http://garyrob.blogs.com//handlingtokenredundancy94.pdf).

I would be quite simple to change our current code to optionally support 
the proposed extensions (I have already available my own java code to 
efficiently compute the [inverse] chi-square function).

*But* there is a problem, in case we want to allow the use of the 
current corpus data. In spite of what Gary says in page 1 of his paper, 
when computing b(w) and g(w), Paul Graham's approach (both the original 
one - http://paulgraham.com/spam.html - and the enhanced one upon which 
our current code is based and the corpuses are built - 
http://paulgraham.com/better.html) collects different data:

for Gary: b(w) = (the number of spam e-mails containing the word w) / 
(the total number of spam e-mails),
while for Paul and us: b(w) = (the total count of occurrences of word w 
in the spam e-mails) / (the total number of spam e-mails).

Similarly for computing g(w), anf f(w), where m =  (the number of spam 
e-mails containing the word w) + (the number of ham e-mails containing 
the word w).

In fact, in http://paulgraham.com/spam.html  it may be read the following:
...
The especially observant will notice that while I consider each corpus 
to be a single long stream of text for purposes of counting occurrences, 
I use the number of emails in each, rather than their combined length, 
as the divisor in calculating spam probabilities. This adds another 
slight bias to protect against false positives.
...
and that's how I coded the current stuff.

To fully Support Gary's proposal we should collect a third field in the 
bayesiananalysis_ham and spam tables, containing his different counter, 
and the corpuses should be rebuilt from scratch.

A different (and straightforward) approach would be to continue to use 
our b(w) and g(w) formulas, and setting m = (total count of words) while 
using Gary's approach.
I feel that the result would be not so different from Gary's, but it 
should be carefully studied from a theorethical point of view, specially 
when computing the confidence tests, that is where Gary's approach is 
particularly interesting.

Personally I think that it would be more useful (for now) to keep our 
current approach, allowing to vary in config.xml the (currently 
hardcoded to Paul's suggestions) MAX_INTERESTING_TOKENS, 
INTERESTINGNESS_THRESHOLD and DEFAULT_TOKEN_PROBABILITY.

Let me know your thoughts.

Vincenzo

Noel J. Bergman wrote:

>Norman Maurer wrote:
>
>  
>
>>Noel J. Bergman:
>>    
>>
>>>>I think we will not do this until jasen will get published
>>>>under a acceptable license
>>>>        
>>>>
>>>We already have Bayesian support under a suitable license.  Wouldn't
>>>      
>>>
>hurt to
>  
>
>>>go to the same articles and add the improvements sugggested by Gary
>>>      
>>>
>Robinson.
>  
>
>>What for suggestions ?
>>    
>>
>
>Yes, to look for any suggestions that Gary Robinson made on how to improve
>the results of Bayesian analysis, e.g.,
>http://garyrob.blogs.com//handlingtokenredundancy94.pdf that aren't already
>in our code.
>
>	--- Noel
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>For additional commands, e-mail: server-dev-help@james.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
Norman Maurer wrote:

>Am Mittwoch, den 30.08.2006, 16:08 +0200 schrieb Vincenzo Gianferrari
>Pini:
>  
>
>>To fully Support Gary's proposal we should collect a third field in the 
>>bayesiananalysis_ham and spam tables, containing his different counter, 
>>and the corpuses should be rebuilt from scratch.
>>    
>>
>
>+1 That sounds like the "right" way.
>
>  
>
IMO in this case the problem would be for those (like me since 3 years) 
that have already built a corpus on the database with the current 
counters, and don't have a collection of mails to retrain from scratch. 
So for instance I would not like it as a user.

But perhaps there are not so many other James users in this situation...

Vincenzo


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by Norman Maurer <nm...@byteaction.de>.
Am Mittwoch, den 30.08.2006, 16:08 +0200 schrieb Vincenzo Gianferrari
Pini:
> I took a deep look to our curent BayesianAnalyzer code and to Gary 
> Robinson's blog and paper 
> (http://garyrob.blogs.com//handlingtokenredundancy94.pdf).
> 
> I would be quite simple to change our current code to optionally support 
> the proposed extensions (I have already available my own java code to 
> efficiently compute the [inverse] chi-square function).
> 
> *But* there is a problem, in case we want to allow the use of the 
> current corpus data. In spite of what Gary says in page 1 of his paper, 
> when computing b(w) and g(w), Paul Graham's approach (both the original 
> one - http://paulgraham.com/spam.html - and the enhanced one upon which 
> our current code is based and the corpuses are built - 
> http://paulgraham.com/better.html) collects different data:
> 
> for Gary: b(w) = (the number of spam e-mails containing the word w) / 
> (the total number of spam e-mails),
> while for Paul and us: b(w) = (the total count of occurrences of word w 
> in the spam e-mails) / (the total number of spam e-mails).
> 
> Similarly for computing g(w), anf f(w), where m =  (the number of spam 
> e-mails containing the word w) + (the number of ham e-mails containing 
> the word w).
> 
> In fact, in http://paulgraham.com/spam.html  it may be read the following:
> ...
> The especially observant will notice that while I consider each corpus 
> to be a single long stream of text for purposes of counting occurrences, 
> I use the number of emails in each, rather than their combined length, 
> as the divisor in calculating spam probabilities. This adds another 
> slight bias to protect against false positives.
> ...
> and that's how I coded the current stuff.
> 
> To fully Support Gary's proposal we should collect a third field in the 
> bayesiananalysis_ham and spam tables, containing his different counter, 
> and the corpuses should be rebuilt from scratch.

+1 That sounds like the "right" way.

> 
> A different (and straightforward) approach would be to continue to use 
> our b(w) and g(w) formulas, and setting m = (total count of words) while 
> using Gary's approach.
> I feel that the result would be not so different from Gary's, but it 
> should be carefully studied from a theorethical point of view, specially 
> when computing the confidence tests, that is where Gary's approach is 
> particularly interesting.
> 
> Personally I think that it would be more useful (for now) to keep our 
> current approach, allowing to vary in config.xml the (currently 
> hardcoded to Paul's suggestions) MAX_INTERESTING_TOKENS, 
> INTERESTINGNESS_THRESHOLD and DEFAULT_TOKEN_PROBABILITY.
> 
> Let me know your thoughts.
> 
> Vincenzo
> 
> Noel J. Bergman wrote:
> 
> >Norman Maurer wrote:
> >
> >  
> >
> >>Noel J. Bergman:
> >>    
> >>
> >>>>I think we will not do this until jasen will get published
> >>>>under a acceptable license
> >>>>        
> >>>>
> >>>We already have Bayesian support under a suitable license.  Wouldn't
> >>>      
> >>>
> >hurt to
> >  
> >
> >>>go to the same articles and add the improvements sugggested by Gary
> >>>      
> >>>
> >Robinson.
> >  
> >
> >>What for suggestions ?
> >>    
> >>
> >
> >Yes, to look for any suggestions that Gary Robinson made on how to improve
> >the results of Bayesian analysis, e.g.,
> >http://garyrob.blogs.com//handlingtokenredundancy94.pdf that aren't already
> >in our code.
> >
> >	--- Noel
> >
bye
Norman

RE: [jira] Closed: (JAMES-514) Add Mailet that support jason forspamfiltering

Posted by "Noel J. Bergman" <no...@devtech.com>.
Norman Maurer wrote:

> Noel J. Bergman:
> > > I think we will not do this until jasen will get published
> > > under a acceptable license
> > We already have Bayesian support under a suitable license.  Wouldn't
hurt to
> > go to the same articles and add the improvements sugggested by Gary
Robinson.
> What for suggestions ?

Yes, to look for any suggestions that Gary Robinson made on how to improve
the results of Bayesian analysis, e.g.,
http://garyrob.blogs.com//handlingtokenredundancy94.pdf that aren't already
in our code.

	--- Noel



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org