Skip to main content

Identify insulting comments and users on social media

Project description

# Insults [![Build Status](https://travis-ci.com/thundergolfer/Insults.svg?token=yHGWQ42iK2BPk1FjaUMc&branch=master)](https://travis-ci.com/thundergolfer/Insults) [![Code Climate](https://codeclimate.com/repos/58fb905df9bb6802870021a9/badges/498dfdd9972b95ca793c/gpa.svg)](https://codeclimate.com/repos/58fb905df9bb6802870021a9/feed) [![Issue Count](https://codeclimate.com/repos/58fb905df9bb6802870021a9/badges/498dfdd9972b95ca793c/issue_count.svg)](https://codeclimate.com/repos/58fb905df9bb6802870021a9/feed)

**TLDR: This project is very similar in functionality and purpose to Google's recent [Perspective API](https://www.perspectiveapi.com/) project** ![Imgur](http://i.imgur.com/kzLNj2z.png)

-----

### Usage

```python
>>> from insults import Insults

>>> comment = "You are a disgusting maggot of a person."
>>> Insults.load_model()
>>> Insults.rate_comment(comment)
```

`0.89`

```python
>>> comments = ["You called me a 'dickhead', so I'll say you're a cunt.", "These shitakes taste like shit."]
>>> Insults.foul_language(comments, context=False)
```
`['cunt', 'shit'], None`

### Installation [Package]

`coming soon`

### Installation [Development]

If you'd like to contribute and hack on the newspaper project, feel free to clone a development version of this repository locally:

`git clone git://github.com/thundergolfer/Insults.git`

Once you have a copy of the source, run the following scripts:

`./install_miniconda.sh`
`./install_local.sh`

A Conda virtual environment is created and everything needed should be now installed into it. To activate the environment, run:

`source ./run_in_environment.sh`

or alternatively you can run single commands in the environment with:

`./run_in_environment.sh <COMMAND>`

##### Running The Tests

`python -m pytests tests/`

### Credit

* [cbrew](https://github.com/cbrew) for their original data-science work in [Imperium's Kaggle Competition](https://www.kaggle.com/c/detecting-insults-in-social-commentary). Code in [cbrew/Insults](https://github.com/cbrew/Insults)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insults-0.1.11.tar.gz (22.8 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page