from transformers import pipeline | |
def analyze_output(input: str): | |
pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model") | |
x = pipe(input)[0] | |
if x["label"] == "LABEL_0": | |
return {"type":"Not Spam", "probability":x["score"]} | |
else: | |
return {"type":"Spam", "probability":x["score"]} | |
print(analyze_output("C一eck out our amazin伞 b芯芯褧ting servi褋e 选here you can get to Leve訌 3 for 3 mont一s for just 20 USD.")) |