sgurriah commited on
Commit
6d8bb66
β€’
1 Parent(s): 1062df1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ model_name = "ieuniversity/flirty_classifier"
5
+ classifier = pipeline("text-classification", model=model_name)
6
+
7
+ def classify_text(text):
8
+ output = classifier(text)
9
+ label = output[0]["label"]
10
+ score = output[0]["score"]
11
+ return f"Label: {label}, Score: {score:.2f}"
12
+
13
+ gr.Interface(fn=classify_text,
14
+ inputs="text",
15
+ outputs="text",
16
+ title="Flirty Classifier",
17
+ description="Enter some text and get a prediction for whether it's flirty or not.").launch()