Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A basic and simple yet powerful Python library to detect toxicity/profanity of a review or list of reveiws.

License

NotificationsYou must be signed in to change notification settings

LMSharma/cuss_inspect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypi

A simple yet powerful library to predict toxicity/profanity of a review/comment or list of reviews/comments.

How It Works

cuss_inspect is a logistic regression based model trained on 180K+ reviews and tested on 24K+ reviews. The library does not uses any specific wordlist/swear-words-list but is able to detected most of the swear words easily.

Performance

1 Prediction (ms)10 Predictions (ms)100 Predictions (ms)1000 Predictions (ms)10000 Predictions (ms)
cuss_inspect0.20.30.84.324.7

Accuracy

The accuracy,precision and recall are quite impressive as compared to other models. Logistic regression for text classification outperforms many other classifcation algorithms such as SVC,Decision Tree and Naive Bayes.

PrecisionRecallF1 Score
00.840.940.89
10.990.960.98
Accuracy0.96
macro avg0.910.950.93
weighted avg0.960.960.96

Receiver Operating Characteristics

ROC Curve

Installation

$ pip install cuss_inspect

Usage

fromcuss_inspectimportpredict,predict_prob# for simple stringtext_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 inputstest= ['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() andpredict_prob returnnumpy arrays.

Releases

No releases published

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp