Plino - An Intelligent spam filtering System

Built on top of a Custom Well Trained Naive Bayes Classifier

Try out Live Demo API Usage Fork us on

Plino's Features

Who seeks after it and wants to have it

Python based

Built on top of beautiful and expressive Python and a lot more things

REST API

We do provide a REST API for you to integrate plino in your apps

Machine Learning

Our custom machine learning classifiers do the heavy weight lifting of classifying your emails for you in a reliable manner.

Unlimited Users

Our REST API is currently available to anyone for use.

Crafted with Love

We put a lot of time and effort on Plino so that users are faced with the least friction when using our service.

Minimum Downtime

Our guys back at Heroku ensure that we have minimum downtime.

Here is some sample text but feel free to try your own emails to see what Plino can do


sendClassify clearClear

Tell me more about your Classifier?

Sure! Plino is powered by a custom Naive Bayes classifier which Tasdik built while working on spammy
We thought we could make an API for others to make use of our work. So here is Plino for you!

  • classifier trained against 33,000 emails
  • Dataset used is the Enron dataset
  • Simple REST API provided
  • Written in uncomplicated Python
  • Free To use
  • You can even run it locally!
Fork us on Github

Access our API using cURL

General syntax

                  
                    $ curl -H "Content-Type: application/json" -X \
                      POST -d \
                      '{"email_text":"SAMPLE EMAIL TEXT"}' \
                      https://plino.herokuapp.com/api/v1/classify/
                  
                

Example

                  
                    $ curl -H "Content-Type: application/json" \
                    -X POST -d \
                    '{"email_text":"Dear Tasdik, I would like to immediately transfer 10000 thousand dollars to your account as my beloved husband has expired and I have nobody to ask for to transfer the money to your account. I come from the family of the royal prince of burkino fasa and I would be more than obliged to take your help on this matter. Would you care to share your bank account details with me in the next email conversation that we have? -regards -Liah herman"}' \
                    https://plino.herokuapp.com/api/v1/classify/
                  
                
JSON Output
                  
                    {
                      "email_class": "spam",
                      "email_text": "Dear Tasdik, I would like to immediately transfer 10000 thousand dollars to your account as my beloved husband has expired and I have nobody to ask for to transfer the money to your account. I come from the family of the royal prince of burkino fasa and I would be more than obliged to take your help on this matter. Would you care to share your bank account details with me in the next email conversation that we have? -regards -Liah herman", 
                      "status": 200
                    }
                  
                

Accessing API using requests (in python)

How can we forget our beloved requests module (by kenneth)

General syntax

                  
                    >>> import requests
                    >>> import json
                    >>> import pprint
                    >>>
                    >>> api_url = "https://plino.herokuapp.com/api/v1/classify/"
                    >>> payload = \
                    {
                    'email_text': 'Dear Tasdik, I would like to immediately transfer 10000 '
                                   'thousand dollars to your account as my beloved husband has '
                                   'expired and I have nobody to ask for to transfer the money '
                                   'to your account. I come from the family of the royal prince '
                                   'of burkino fasa and I would be more than obliged to take '
                                   'your help on this matter. Would you care to share your bank '
                                   'account details with me in the next email conversation that '
                                   'we have? -regards -Liah herman'
                    }
                    >>>
                    >>> headers = {'content-type': 'application/json'}
                    >>> # query our API
                    >>> response = requests.post(api_url, data=json.dumps(payload), headers=headers)
                    >>> response.status_code
                    200
                    >>> pprint.pprint(response.json())
                    {
                     'email_class': 'spam',
                     'email_text': 'Dear Tasdik, I would like to immediately transfer 10000 '
                                   'thousand dollars to your account as my beloved husband has '
                                   'expired and I have nobody to ask for to transfer the money '
                                   'to your account. I come from the family of the royal prince '
                                   'of burkino fasa and I would be more than obliged to take '
                                   'your help on this matter. Would you care to share your bank '
                                   'account details with me in the next email conversation that '
                                   'we have? -regards -Liah herman',
                     'status': 200
                     }
                    >>> 
                  
                

Using the Python 3 Standard Library

requests module really makes our life easy and I use it all the time. But **sigh**, there should be an example using the standard library so here it is

General Syntax

                  
                 >>> import urllib.request
                 >>> import json
                 >>> import pprint 
                 >>>
                 >>> url = "https://plino.herokuapp.com/api/v1/classify/"
                 >>> req = urllib.request.Request(url)
                 >>> req.add_header(
                        'Content-Type',
                        'application/json; charset=utf-8'
                    )
                 >>>
                 >>> body = \
                 {'email_text': 'Dear Tasdik, I would like to immediately transfer 10000 '
                                'thousand dollars to your account as my beloved husband has '
                                'expired and I have nobody to ask for to transfer the money '
                                'to your account. I come from the family of the royal prince '
                                'of burkino fasa and I would be more than obliged to take '
                                'your help on this matter. Would you care to share your bank '
                                'account details with me in the next email conversation that '
                                'we have? -regards -Liah herman'
                 }
                 >>> json_data = json.dumps(body).encode('utf-8')   # needs to be bytes
                 >>> req.add_header('Content-Length', len(json_data))
                 >>>
                 >>> with urllib.request.urlopen(req, json_data) as f:
                 ...   print(f.read().decode('utf-8'))
                 ... 
                 {
                   "email_class": "spam", 
                   "email_text": "Dear Tasdik, I would like to immediately transfer 10000 thousand dollars to your account as my beloved husband has expired and I have nobody to ask for to transfer the money to your account. I come from the family of the royal prince of burkino fasa and I would be more than obliged to take your help on this matter. Would you care to share your bank account details with me in the next email conversation that we have? -regards -Liah herman", 
                   "status": 200
                 }
                 >>> 
                  
                

Team

The people behind Plino

Tasdik Rahman

ML & NLP enthusiast, Flask/Django dev, Python overlord @ SRMSE

♥'s python and speaks parseltongue way too often apparently. Has been wasting his weekends lately building stuff instead of studying, (here is a curated list for the curious)
When not programming, he can be found gobbling up pizzas, listenting to rap music or prowling on medium

Nitesh Sharma

Full Stack Flask, Django and Rails Developer, Head of Web Dev @ SRMADT

A Full Stack Web Developer and JavaScripter. Expert in Ruby on Rails, Flask and Express.js FrameWorks. Also develops Hybrid Mobile apps using Ionic framework and Angular Js.
Also had been Captain of state level Kabaddi Champion Team and loves Cooking in spare time

Trivia

Location

SRM University, Chennai, India

Email

prodicus AT outlook DOT com

We would Love to Hear From You

This project is still a Work in progress. Your feedback is more than welcome!