Spaces:
Sleeping
Sleeping
Download app.py from User1342/Pinpoint-Web: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/spaces/User1342/Pinpoint-Web/resolve/main/app.py
- Command line
-
hf download hf://spaces/User1342/Pinpoint-Web/app.py
-
curl -L -o app.py https://huggingface.co/spaces/User1342/Pinpoint-Web/resolve/main/app.py
752 Bytes
| 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() |