Spaces:
Sleeping
Sleeping
File size: 709 Bytes
f9db5d8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
import predictor
def check_string(string_to_predict):
try:
is_extremist = predictor.predictor().predict(string_to_predict)
if is_extremist:
return "The message has been identified as potentially containing violent far-right extremist content."
else:
return "The message has been identified as not containing violent far-right extremist content."
except FileNotFoundError as e:
return "The message was not feature rich enough to identify, try something else. {}".format(e)
demo = gr.Interface(
fn=check_string,
inputs=gr.Textbox(lines=2, placeholder="Text to predict here..."),
outputs="text",
)
demo.launch() |