A module for filtering text with profanity using Google's Perspective API.
Project description
begentle is a package for detecting toxic language using the Perspective API (more info at PerspectiveAPI.com). Google already has a Python module for this, but I think it’s too complex, so I created my own.
Getting Started
First you will need a Google Cloud project API key with the Perspective API enabled.
Follow these two tutorials: | Tutorial 1: Getting Started | Tutorial 2: Enable the API
Once you have your API key install the package:
pip install begentle
and use it like so:
from begentle import CommentAnalyzer
analyzer = CommentAnalyzer('YOUR_API_KEY')
comment = 'You suck! I hate you, never come back.'
print(analyzer.analyze(comment))
You should see something like 0.9543847. This is a value between 0 and 1 representing toxicity. Generally toxic phrases return a value above 0.9. And that’s it!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file begentle-0.1.1.tar.gz.
File metadata
- Download URL: begentle-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db4c8189a5e08acca134c275aa5a0bbd071f426326dff53324e8d909d555bf3
|
|
| MD5 |
9fa4a48cfa3328a5369ce4cf5352a7ec
|
|
| BLAKE2b-256 |
5fcc6645bc77fcb243795dc093783fe4fd83dda77f0d0943496d8549ae67a6f3
|
File details
Details for the file begentle-0.1.1-py3-none-any.whl.
File metadata
- Download URL: begentle-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7811a14c7be5a0b36c52442509410bd9d1ee7c0adcb524b3a8441ea9c9c4017
|
|
| MD5 |
65f509aaa9df7f136cbeb5e03d4746ba
|
|
| BLAKE2b-256 |
0f0cf5bed6abd87109d88bf762b924b9c98465c72f2851e6fb0cc8d8da92e3ac
|