Lemon is a free, lightweight and fast python library to detect toxicity, insult, sexuality, threat, neutrality from text. It utilizes machine learning to do so.
pip install lemonifyNOTE FOR WINDOWS USER: This library uses a small compiled extension on Windows (sdist install). So you must install Microsoft Visual C++ Build Tools first.
- Download and install: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- During setup, select: "Desktop development with C++"
- Then run:
python -m pip install --upgrade pip setuptools wheel
pip install lemonifyfrom lemonify import lemon
print(lemon("you are stupid")){'toxicity': 1.0, 'insult': 1.0, 'sexuality': 0.0, 'threat': 0.0, 'neutrality': 0.0}Note that the value of emotions are in floating points between 0 and 1