siddhantuniyal commited on
Commit
cb6ff81
1 Parent(s): 84e881d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -39,8 +39,10 @@ def predict(image):
39
  text=ocr_text,
40
  api_name="/predict"
41
  )
 
 
42
 
43
- if engResult[0] == "NEITHER" or hingResult[0] == "NAG":
44
  return ["not_hate" , "No Hate Symbols Detected"]
45
  else:
46
  return ["hate" , "No Hate Symbols Detected"]
 
39
  text=ocr_text,
40
  api_name="/predict"
41
  )
42
+
43
+ profanityFound = any(word in text.split() for word in profanity_hn)
44
 
45
+ if not profanityFound and (engResult[0] == "NEITHER" or hingResult[0] == "NAG"):
46
  return ["not_hate" , "No Hate Symbols Detected"]
47
  else:
48
  return ["hate" , "No Hate Symbols Detected"]