GithubHelp home page GithubHelp logo

nguyenth69 / antispam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dinever/antispam

0.0 0.0 0.0 2.44 MB

Dead simple bayesian anti-spam classifier written in Python.

Home Page: https://antispam.readthedocs.org

Python 100.00%

antispam's Introduction

AntiSpam

version supported license

Bayesian anti-spam classifier written in Python.

PyPI: pypi.python.org/pypi/antispam

Docs: antispam.readthedocs.org

Installation

pip install antispam

Usage

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

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:

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:

d.save()

License

MIT Licenses

antispam's People

Contributors

dinever avatar perkinslr avatar michael-k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.