百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

antispam

> 编程语言
开源

一个简单的贝叶斯反垃圾邮件分类器,使用 Python 编写。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个简单的贝叶斯反垃圾邮件分类器,使用 Python 编写。

AntiSpam

Bayesian anti-spam classifier written in Python.

PyPI: pypi.python.org/pypi/antispam

Docs: antispam.readthedocs.org

Installation

bash
pip install antispam

Usage

Use the built-in model provided & trained by author:

python
import antispam

antispam.score("Cheap shoes for sale at DSW shoe store!")
# => 0.9657724517163143

antispam.is_spam("Cheap shoes for sale at DSW shoe store!")
# => True

antispam.score("Hi mark could you please send me a copy of your machine learning homework? thanks")
# => 0.0008064840568731558

antispam.is_spam("Hi mark could you please send me a copy of your machine learning homework? thanks")
# => False

Train your own modle:

python
import antispam

d = antispam.Detector("my_model.dat")

d.train("Super cheap octocats for sale at GitHub.", True)
d.train("Hi John, could you please come to my office by 3pm? Ding", False)

msg1 = "Cheap shoes for sale at DSW shoe store!"
d.score(msg1)
# => 0.9999947825633266

d.is_spam(msg1)
# => True

msg2 = "Hi mark could you please send me a copy of your machine learning homework? thanks"
d.score(msg2)
# => 4.021280114849398e-08

d.is_spam(msg2)
# => False

Save your model:

python
d.save()

License

MIT Licenses

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonantispambayes-classifiermachine-learningpython

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言