Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
human_read={"LABEL_0":"Negative",
|
2 |
+
"LABEL_1":"Positive"}
|
3 |
+
sentimental=pipeline("text-classification", model="Dmyadav2001/Sentimental-Analysis")
|
4 |
+
def predictive_model(texts):
|
5 |
+
result=sentimental(texts)
|
6 |
+
sentiment=human_read[result[0]["label"]]
|
7 |
+
score=result[0]["score"]
|
8 |
+
return sentiment, score
|
9 |
+
|
10 |
+
interface=gr.Interface(fn=predictive_model,
|
11 |
+
inputs="text",
|
12 |
+
outputs=["text","number"],
|
13 |
+
title="Sentiment-Analysis-App",
|
14 |
+
description="Gave your text my machine is going to detect Positive / Negative "
|
15 |
+
)
|
16 |
+
interface.launch()
|