Spaces:
Runtime error
Runtime error
siddhantuniyal
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,9 @@ def predict(image):
|
|
40 |
api_name="/predict"
|
41 |
)
|
42 |
|
43 |
-
profanityFound = any(word in
|
44 |
|
45 |
-
if not profanityFound and
|
46 |
return ["not_hate" , "No Hate Symbols Detected"]
|
47 |
else:
|
48 |
return ["hate" , "No Hate Symbols Detected"]
|
@@ -55,4 +55,4 @@ iface = gr.Interface(fn=predict,
|
|
55 |
)
|
56 |
|
57 |
if __name__ == "__main__":
|
58 |
-
iface.launch()
|
|
|
40 |
api_name="/predict"
|
41 |
)
|
42 |
|
43 |
+
profanityFound = any(word in ocr_text.split() for word in profanity_hn)
|
44 |
|
45 |
+
if not profanityFound and engResult[0] == "NEITHER" and hingResult[0] == "NAG":
|
46 |
return ["not_hate" , "No Hate Symbols Detected"]
|
47 |
else:
|
48 |
return ["hate" , "No Hate Symbols Detected"]
|
|
|
55 |
)
|
56 |
|
57 |
if __name__ == "__main__":
|
58 |
+
iface.launch()
|