Giter Site home page Giter Site logo

spam-user-detection's Introduction

Spam User Detection

This application helps in detection of spam users in Drupal, by analyzing the dataset and doing feature selection and finally ending with a decision tree.

Getting started.

This is an application which can either be run on a jupyter notebook or for feasibility, you could download this as a cgi application on your server.

Requirements

  • Apache Web Server
  • Python 3.6

Installation

  1. You need to copy the 'spam_trap.py', 'actual_words.csv', 'spamwords.csv','term_frequency.csv' files to your cgi-bin folder.

  2. Also create a folder uni in your public directory /var/www/html. Setting the access for this folder to 777.

  3. Change the 'Timeout value to 400' in your web server conf file.

  4. Now go to your python3.6 location, the location should be /usr/local/bin/python3.6 or you can also have it any other location and change the spam_trap.py script to start with the shebang of the desired location. You would need to run the following commands to install the dependencies for this project.

$ pip install numpy
$ pip install pandas
$ pip install csv
$ pip install unicodecsv
$ pip install re
$ pip install multiprocessing
$ pip install time
$ pip install datetime
$ pip install cgitb
$ pip install cgi

Some of these modules will already be pre installed, but it is always nice to recheck.

  1. You would need to provide a csv file with the following mysql query,
SELECT 
    users.*,
    COALESCE(user_settings.setting_value) AS biography,
    COALESCE(signs.setting_value) AS signature
FROM
    users
        LEFT OUTER JOIN
    user_settings ON (users.user_id = user_settings.user_id
        AND user_settings.setting_name = 'biography')
        LEFT OUTER JOIN
    user_settings AS signs ON (users.user_id = signs.user_id
        AND signs.setting_name = 'signature')
GROUP BY users.user_id
  1. Upload the file, wait for two minutes/ 40000 users. Click on the download link, it will provide you a corresponding csv file with only the spam user names.

spam-user-detection's People

Contributors

hoshangcharania avatar

Stargazers

Rahim Charania avatar  avatar

Watchers

Brian Gregg avatar James Cloos avatar Clinton Graham avatar David Rowan avatar Willow Gillingham avatar  avatar  avatar

Forkers

hoshangcharania

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.