<s>
Naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
are	O
a	O
popular	O
statistical	O
technique	O
of	O
e-mail	O
filtering	O
.	O
</s>
<s>
They	O
typically	O
use	O
bag-of-words	B-General_Concept
features	O
to	O
identify	O
email	O
spam	O
,	O
an	O
approach	O
commonly	O
used	O
in	O
text	B-Algorithm
classification	I-Algorithm
.	O
</s>
<s>
Naive	B-General_Concept
Bayes	I-General_Concept
classifiers	I-General_Concept
work	O
by	O
correlating	O
the	O
use	O
of	O
tokens	O
(	O
typically	O
words	O
,	O
or	O
sometimes	O
other	O
things	O
)	O
,	O
with	O
spam	O
and	O
non-spam	O
e-mails	O
and	O
then	O
using	O
Bayes	O
 '	O
theorem	O
to	O
calculate	O
a	O
probability	O
that	O
an	O
email	O
is	O
or	O
is	O
not	O
spam	O
.	O
</s>
<s>
Naive	B-Application
Bayes	I-Application
spam	I-Application
filtering	I-Application
is	O
a	O
baseline	O
technique	O
for	O
dealing	O
with	O
spam	O
that	O
can	O
tailor	O
itself	O
to	O
the	O
email	O
needs	O
of	O
individual	O
users	O
and	O
give	O
low	O
false	O
positive	O
spam	O
detection	O
rates	O
that	O
are	O
generally	O
acceptable	O
to	O
users	O
.	O
</s>
<s>
Although	O
naive	O
Bayesian	B-Application
filters	I-Application
did	O
not	O
become	O
popular	O
until	O
later	O
,	O
multiple	O
programs	O
were	O
released	O
in	O
1998	O
to	O
address	O
the	O
growing	O
problem	O
of	O
unwanted	O
email	O
.	O
</s>
<s>
The	O
first	O
scholarly	O
publication	O
on	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
was	O
by	O
Sahami	O
et	O
al	O
.	O
</s>
<s>
Variants	O
of	O
the	O
basic	O
technique	O
have	O
been	O
implemented	O
in	O
a	O
number	O
of	O
research	O
works	O
and	O
commercial	O
software	B-Application
products	I-Application
.	O
</s>
<s>
Many	O
modern	O
mail	O
clients	B-Protocol
implement	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
.	O
</s>
<s>
Server-side	B-Application
email	O
filters	O
,	O
such	O
as	O
DSPAM	O
,	O
SpamAssassin	B-Language
,	O
SpamBayes	O
,	O
Bogofilter	B-Protocol
and	O
ASSP	B-Language
,	O
make	O
use	O
of	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
techniques	O
,	O
and	O
the	O
functionality	O
is	O
sometimes	O
embedded	O
within	O
mail	B-Protocol
server	I-Protocol
software	B-Application
itself	O
.	O
</s>
<s>
For	O
instance	O
,	O
Bayesian	B-Application
spam	I-Application
filters	I-Application
will	O
typically	O
have	O
learned	O
a	O
very	O
high	O
spam	O
probability	O
for	O
the	O
words	O
"	O
Viagra	O
"	O
and	O
"	O
refinance	O
"	O
,	O
but	O
a	O
very	O
low	O
spam	O
probability	O
for	O
words	O
seen	O
only	O
in	O
legitimate	O
email	O
,	O
such	O
as	O
the	O
names	O
of	O
friends	O
and	O
family	O
members	O
.	O
</s>
<s>
Some	O
software	B-Application
implement	O
quarantine	B-Application
mechanisms	O
that	O
define	O
a	O
time	O
frame	O
during	O
which	O
the	O
user	O
is	O
allowed	O
to	O
review	O
the	B-Application
software	I-Application
's	O
decision	O
.	O
</s>
<s>
The	O
initial	O
training	O
can	O
usually	O
be	O
refined	O
when	O
wrong	O
judgements	O
from	O
the	B-Application
software	I-Application
are	O
identified	O
(	O
false	O
positives	O
or	O
false	O
negatives	O
)	O
.	O
</s>
<s>
That	O
allows	O
the	B-Application
software	I-Application
to	O
dynamically	O
adapt	O
to	O
the	O
ever-evolving	O
nature	O
of	O
spam	O
.	O
</s>
<s>
Some	O
spam	O
filters	O
combine	O
the	O
results	O
of	O
both	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
and	O
other	O
heuristics	B-Algorithm
(	O
pre-defined	O
rules	O
about	O
the	O
contents	O
,	O
looking	O
at	O
the	O
message	O
's	O
envelope	O
,	O
etc	O
.	O
</s>
<s>
Let	O
's	O
suppose	O
the	O
suspected	O
message	O
contains	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
.	O
</s>
<s>
The	O
spam	O
detection	O
software	B-Application
,	O
however	O
,	O
does	O
not	O
"	O
know	O
"	O
such	O
facts	O
;	O
all	O
it	O
can	O
do	O
is	O
compute	O
probabilities	O
.	O
</s>
<s>
is	O
the	O
probability	O
that	O
a	O
message	O
is	O
a	O
spam	O
,	O
knowing	O
that	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
is	O
in	O
it	O
;	O
</s>
<s>
is	O
the	O
probability	O
that	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
appears	O
in	O
spam	O
messages	O
;	O
</s>
<s>
is	O
the	O
probability	O
that	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
appears	O
in	O
ham	O
messages	O
.	O
</s>
<s>
However	O
,	O
most	O
bayesian	O
spam	O
detection	O
software	B-Application
makes	O
the	O
assumption	O
that	O
there	O
is	O
no	O
a	O
priori	O
reason	O
for	O
any	O
incoming	O
message	O
to	O
be	O
spam	O
rather	O
than	O
ham	O
,	O
and	O
considers	O
both	O
cases	O
to	O
have	O
equal	O
probabilities	O
of	O
50%	O
:	O
</s>
<s>
This	O
is	O
functionally	O
equivalent	O
to	O
asking	O
,	O
"	O
what	O
percentage	O
of	O
occurrences	O
of	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
appear	O
in	O
spam	O
messages	O
?	O
"	O
</s>
<s>
This	O
quantity	O
is	O
called	O
"	O
spamicity	O
"	O
(	O
or	O
"	O
spaminess	O
"	O
)	O
of	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
,	O
and	O
can	O
be	O
computed	O
.	O
</s>
<s>
The	O
number	O
used	O
in	O
this	O
formula	O
is	O
approximated	O
to	O
the	O
frequency	O
of	O
messages	O
containing	O
"	O
replica	B-Operating_System
"	O
in	O
the	O
messages	O
identified	O
as	O
spam	O
during	O
the	O
learning	O
phase	O
.	O
</s>
<s>
Similarly	O
,	O
is	O
approximated	O
to	O
the	O
frequency	O
of	O
messages	O
containing	O
"	O
replica	B-Operating_System
"	O
in	O
the	O
messages	O
identified	O
as	O
ham	O
during	O
the	O
learning	O
phase	O
.	O
</s>
<s>
Of	O
course	O
,	O
determining	O
whether	O
a	O
message	O
is	O
spam	O
or	O
ham	O
based	O
only	O
on	O
the	O
presence	O
of	O
the	O
word	O
"	O
replica	B-Operating_System
"	O
is	O
error-prone	O
,	O
which	O
is	O
why	O
bayesian	O
spam	O
software	B-Application
tries	O
to	O
consider	O
several	O
words	O
and	O
combine	O
their	O
spamicities	O
to	O
determine	O
a	O
message	O
's	O
overall	O
probability	O
of	O
being	O
spam	O
.	O
</s>
<s>
Most	O
bayesian	B-Application
spam	I-Application
filtering	I-Application
algorithms	O
are	O
based	O
on	O
formulas	O
that	O
are	O
strictly	O
valid	O
(	O
from	O
a	O
probabilistic	O
standpoint	O
)	O
only	O
if	O
the	O
words	O
present	O
in	O
the	O
message	O
are	O
independent	O
events	O
.	O
</s>
<s>
is	O
the	O
probability	O
that	O
the	O
first	O
word	O
(	O
for	O
example	O
"	O
replica	B-Operating_System
"	O
)	O
appears	O
,	O
given	O
that	O
the	O
message	O
is	O
spam	O
;	O
</s>
<s>
Spam	O
filtering	O
software	B-Application
based	O
on	O
this	O
formula	O
is	O
sometimes	O
referred	O
to	O
as	O
a	O
naive	B-General_Concept
Bayes	I-General_Concept
classifier	I-General_Concept
,	O
as	O
"	O
naive	O
"	O
refers	O
to	O
the	O
strong	O
independence	O
assumptions	O
between	O
the	O
features	O
.	O
</s>
<s>
Usually	O
p	O
is	O
not	O
directly	O
computed	O
using	O
the	O
above	O
formula	O
due	O
to	O
floating-point	B-Algorithm
underflow	I-Algorithm
.	O
</s>
<s>
The	B-Application
software	I-Application
can	O
decide	O
to	O
discard	O
such	O
words	O
for	O
which	O
there	O
is	O
no	O
information	O
available	O
.	O
</s>
<s>
Applying	O
again	O
Bayes	O
 '	O
theorem	O
,	O
and	O
assuming	O
the	O
classification	O
between	O
spam	O
and	O
ham	O
of	O
the	O
emails	O
containing	O
a	O
given	O
word	O
(	O
"	O
replica	B-Operating_System
"	O
)	O
is	O
a	O
random	O
variable	O
with	O
beta	O
distribution	O
,	O
some	O
programs	O
decide	O
to	O
use	O
a	O
corrected	O
probability	O
:	O
</s>
<s>
Some	O
software	B-Application
products	I-Application
take	O
into	O
account	O
the	O
fact	O
that	O
a	O
given	O
word	O
appears	O
several	O
times	O
in	O
the	O
examined	O
message	O
,	O
others	O
do	O
n't	O
.	O
</s>
<s>
Some	O
software	B-Application
products	I-Application
use	O
patterns	O
(	O
sequences	O
of	O
words	O
)	O
instead	O
of	O
isolated	O
natural	O
languages	O
words	O
.	O
</s>
<s>
One	O
of	O
the	O
main	O
advantages	O
of	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
is	O
that	O
it	O
can	O
be	O
trained	O
on	O
a	O
per-user	O
basis	O
.	O
</s>
<s>
A	O
Bayesian	B-Application
spam	I-Application
filter	I-Application
will	O
eventually	O
assign	O
a	O
higher	O
probability	O
based	O
on	O
the	O
user	O
's	O
specific	O
patterns	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
a	O
corporate	O
environment	O
,	O
the	O
company	O
name	O
and	O
the	O
names	O
of	O
clients	B-Protocol
or	O
customers	O
will	O
be	O
mentioned	O
often	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
accuracy	O
after	O
training	O
is	O
often	O
superior	O
to	O
pre-defined	O
rules	O
.	O
</s>
<s>
Depending	O
on	O
the	O
implementation	O
,	O
Bayesian	B-Application
spam	I-Application
filtering	I-Application
may	O
be	O
susceptible	O
to	O
Bayesian	O
poisoning	O
,	O
a	O
technique	O
used	O
by	O
spammers	O
in	O
an	O
attempt	O
to	O
degrade	O
the	O
effectiveness	O
of	O
spam	O
filters	O
that	O
rely	O
on	O
Bayesian	O
filtering	O
.	O
</s>
<s>
Spammer	O
tactics	O
include	O
insertion	O
of	O
random	O
innocuous	O
words	O
that	O
are	O
not	O
normally	O
associated	O
with	O
spam	O
,	O
thereby	O
decreasing	O
the	O
email	O
's	O
spam	O
score	O
,	O
making	O
it	O
more	O
likely	O
to	O
slip	O
past	O
a	O
Bayesian	B-Application
spam	I-Application
filter	I-Application
.	O
</s>
<s>
Another	O
technique	O
used	O
to	O
try	O
to	O
defeat	O
Bayesian	B-Application
spam	I-Application
filters	I-Application
is	O
to	O
replace	O
text	O
with	O
pictures	O
,	O
either	O
directly	O
included	O
or	O
linked	O
.	O
</s>
<s>
However	O
,	O
since	O
many	O
mail	O
clients	B-Protocol
disable	O
the	O
display	O
of	O
linked	O
pictures	O
for	O
security	O
reasons	O
,	O
the	O
spammer	O
sending	O
links	O
to	O
distant	O
pictures	O
might	O
reach	O
fewer	O
targets	O
.	O
</s>
<s>
A	O
solution	O
used	O
by	O
Google	B-Application
in	O
its	O
Gmail	B-Application
email	I-Application
system	O
is	O
to	O
perform	O
an	O
OCR	O
(	O
Optical	B-Application
Character	I-Application
Recognition	I-Application
)	O
on	O
every	O
mid	O
to	O
large	O
size	O
image	O
,	O
analyzing	O
the	O
text	O
inside	O
.	O
</s>
