A basic and simple yet powerful Python library to detect toxicity/profanity of a review or list of reveiws.
Project description
cuss_inspect
How It Works
cuss_inspect is a logistic regression based model trained on 180K+ reviews and tested on 24K+ reviews.
Performance
| 1 Prediction (ms) | 10 Predictions (ms) | 100 Predictions (ms) | 1000 Predictions (ms) | 10000 Predictions (ms) | |
|---|---|---|---|---|---|
| cuss_inspect | 0.2 | 0.3 | 0.8 | 4.3 | 24.7 |
Accuracy
| Precision | Recall | F1 Score | |
|---|---|---|---|
| 0 | 0.84 | 0.94 | 0.89 |
| 1 | 0.99 | 0.96 | 0.98 |
| Accuracy | 0.96 | ||
| macro avg | 0.91 | 0.95 | 0.93 |
| weighted avg | 0.96 | 0.96 | 0.96 |
Receiver Operating Characteristics
Installation
$ pip install cuss_inspect
Usage
from cuss_inspect import predict, predict_prob
# for simple string
text_0 = "this is simple review. you have done a good job"
print(predict(text_0))
# [0]
print(predict_prob(text_0)
# [0.05]
text_1 = "son of a bitch"
print(predict(text_1))
# [1]
print(predict_prob(text_1)
# [1.]
# for list of inputs
test = ['who are you?' , 'what do you want?' , 'son of a dog' , 'how the hell can you say that' , 'fuck it']
print(predict(test))
# [0 0 1 1 1]
print(predict_prob(test))
# [0.12 0.22 0.55 0.96 1.]
*predict() and predict_prob return numpy arrays.
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
cuss_inspect-1.0.2b0.tar.gz
(2.7 kB
view details)
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 cuss_inspect-1.0.2b0.tar.gz.
File metadata
- Download URL: cuss_inspect-1.0.2b0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a884100f881275448360710935a9b3e33df15286eecc8a9eb8b15a63fc84a8
|
|
| MD5 |
25bd0326a603133bd0b9988654c73375
|
|
| BLAKE2b-256 |
66eef056d5e520d82b90c85a678c4077e723045099f6ce355dcc70aad6b7a830
|
File details
Details for the file cuss_inspect-1.0.2b0-py3-none-any.whl.
File metadata
- Download URL: cuss_inspect-1.0.2b0-py3-none-any.whl
- Upload date:
- Size: 30.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5adef3094820df66882b35bc2be6a74e6cd00a6b8e226d9658ee79f67c51e1a3
|
|
| MD5 |
bcd73e4d5c9108060e3cb9a892a185c0
|
|
| BLAKE2b-256 |
5a22a29b8bfa0f5d649e663abcb020ffd4d1c062e9af32e8bff4dcb9d298e59a
|