Non-personal Insults

This model was designed and training to detect personal insults, not insults directed at groups generally and third-parties. Insulting a celebrity, for example, should not be flagged by the model.

Though it is interesting to detect comments that are insulting something/somebody generally, it is not the domain of this project.


In [14]:
%matplotlib inline

In [5]:
# Ugly Python PATH hack to import insults from notebook
import os
import sys
nb_dir = os.path.split(os.getcwd())[0]
if nb_dir not in sys.path:
    sys.path.append(nb_dir)

In [6]:
from insults.core import Insults

Setup


In [7]:
samples = [
    "Owen Wilson is the ugliest person I've ever seen, period.",
    "Of the things I don't like, I like bankers the least.",
    "You shouldn't listen to Sam Harris; He's an idiot.",
    "I don't like women.",
    "Alex is worse than James, though both of them are fuckheads."
    "I just want to tell those guys to go die in a hole."
    "You're great, but idealists are awful.",
]

In [8]:
insult = Insults()

In [12]:
results = []
for example in samples:
    results.append(insult.rate_comment(example))

Exploration


In [10]:
import seaborn

In [16]:
seaborn.distplot(results, hist_kws={"range": [0,1]})


Out[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x1262ebc10>

In [ ]: