Skip to content

Commit

Permalink
verify profanities
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Apr 28, 2024
1 parent 9c15b6f commit ca980cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
echo "Translations are: '${{ steps.google-translate.outputs.text }}'"
echo "${{ steps.google-translate.outputs.text }}" | sed 's/ ; /\n/g' > translated_texts.txt
cat translated_texts.txt | ./scripts/checkProfanity.sh
./scripts/checkProfanity.sh translated_texts.txt
shell: sh
- name: Upload Raw Translations
uses: actions/upload-artifact@v3
Expand Down
7 changes: 4 additions & 3 deletions scripts/checkProfanity.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/python

import sys
from profanity_check import predict, predict_prob
import joblib
import sys


file = open("suspicious_texts.txt", "a")
for line in sys.stdin:
source = open(sys.argv[1], "r")
lines = source.readlines()
for line in lines:
print("Checking: "+str(line.rstrip()))
prediction = predict_prob([line.rstrip()])
if prediction[0] > 0.5:
Expand Down

0 comments on commit ca980cb

Please sign in to comment.