import nltk nltk.download('averaged_perceptron_tagger') 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." demo = gr.Interface( fn=check_string, inputs=gr.Textbox(lines=2, placeholder="Text to predict here..."), outputs="text", ) demo.launch()