| import gradio as gr | |
| from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer | |
| def analyze_output(input): | |
| pipe = pipeline("text-classification", model='Titeiiko/OTIS-Official-Spam-Model') | |
| return "hello" | |
| x = pipe(input)[0] | |
| if x["label"] == "LABEL_0": | |
| return {"type":"Not Spam", "probability":x["score"]} | |
| else: | |
| return {"type":"Spam", "probability":x["score"]} | |
| demo = gr.Interface(fn=analyze_output, inputs="text", outputs="text") | |
| demo.launch() |