Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from Dungeon-MASSters/master
Browse files Browse the repository at this point in the history
check profanity en
  • Loading branch information
genia10 authored Oct 14, 2023
2 parents c786e43 + 4f05a0b commit 270fb18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion model/censor/research/NSWF.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import opennsfw2 as n2
from rus_rule_based_insult_classifier.core import insult_classifier
from better_profanity import profanity

def check_nudity_one(image_path):
nsfw_probability = n2.predict_image(image_path)
Expand All @@ -16,4 +17,7 @@ def check_nudity_lot(image_paths):

#pip install git+https://github.com/kudep/rus_rule_based_insult_classifier
def check_profanity_ru(text):
return insult_classifier(text)
return insult_classifier(text)

def check_profanity_en(text):
return profanity.contains_profanity(text)

0 comments on commit 270fb18

Please sign in to comment.