Pinpoint-Web / app.py
James Stevenson
added lib
f9db5d8
raw history blame
No virus
709 Bytes
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()