File size: 474 Bytes
81a8113
9c123d3
 
81a8113
 
9c123d3
 
 
 
 
81a8113
9c123d3
81a8113
1
2
3
4
5
6
7
8
9
10
11
12
13
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."))