We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
这一点都不容易,需要有一些理论/数学/统计背景。它被称为贝叶斯过滤,它只是其中一种方法,但效果很好。
您可以在此处了解维基百科的介绍和一些背景知识,但这是一个被广泛涵盖的主题互联网上,随便搜索一下(我想也在 StackOverflow 上)。
It's not easy at all and requires to have some theoretical / mathematical / statistics background. It's called Bayesian filtering, it's just one of the methods but works great.
You can have an introduction and some background on wikipedia here, but it is a topic greatly covered over the internet, just search around (here on StackOverflow too I think).
也许最简单的方法是利用现有的 API。 Akismet 有Java 绑定,并且 WordPress 默认在其博客上使用它。哦,它是免费、自由、开源软件。
Probably the easiest way is to leverage an existing API for that. Akismet has bindings for Java, and it's what Wordpress uses on its blogs by default. Oh, and it's free, libre, open source software.
您可以通过 SpamAssassin 管道它并查看返回值是什么。
这里有一个古怪的想法:将文本作为电子邮件发送到 Gmail 帐户。然后使用 IMAP 查看它是否最终进入收件箱或垃圾邮件文件夹。
You could pipe it through SpamAssassin and see what the return value is.
Here's a wacky idea: send the text as an email to a Gmail account. Then use IMAP to see whether it ended up in the Inbox or the Spam folder.
Akismet 为您提供所有数学和逻辑,我认为这是避免垃圾邮件的最佳方法。
您只需索要与您的网站相关的密钥。有一种免费(自愿付费)的方式。
通过它的 Java API 的正常调用是这样的,我使用
commentCheck
对于您正在检查的那段文本。如果此调用返回
true
,则被视为垃圾邮件。Akismet makes all that mathematical and logic for you, I think is the best way to avoid spam.
You only need to ask for you key related to your website. There's a free (voluntary paid) way.
A normal call through it's Java API would be like this, I use
commentCheck
for that piece of text you're checking.If this call returns
true
, it's considered spam.