Update app.py
Browse files
app.py
CHANGED
@@ -50,27 +50,27 @@ if Cont:
|
|
50 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
51 |
|
52 |
|
53 |
-
#pass text to model
|
54 |
-
output=pipe(text)
|
55 |
-
output_dict=output[0]
|
56 |
-
lable=output_dict['label']
|
57 |
-
score=output_dict['score']
|
58 |
-
|
59 |
-
|
60 |
-
if lable=='NEGATIVE':
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
elif lable=='POSITIVE':
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
else:
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
|
|
|
50 |
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
51 |
|
52 |
|
53 |
+
#pass text to model
|
54 |
+
output=pipe(text)
|
55 |
+
output_dict=output[0]
|
56 |
+
lable=output_dict['label']
|
57 |
+
score=output_dict['score']
|
58 |
+
|
59 |
+
#output
|
60 |
+
if lable=='NEGATIVE':
|
61 |
+
with col1:
|
62 |
+
com.iframe("https://embed.lottiefiles.com/animation/125694")
|
63 |
+
col2.write('NEGATIVE')
|
64 |
+
col3.write(f'{score*100:.2f}%')
|
65 |
+
elif lable=='POSITIVE':
|
66 |
+
with col1:
|
67 |
+
com.iframe("https://embed.lottiefiles.com/animation/148485")
|
68 |
+
col2.write('POSITIVE')
|
69 |
+
col3.write(f'{score*100:.2f}%')
|
70 |
+
else:
|
71 |
+
with col1:
|
72 |
+
com.iframe("https://embed.lottiefiles.com/animation/136052")
|
73 |
+
col2.write('NEUTRAL')
|
74 |
+
col3.write(f'{score*100:.2f}%')
|
75 |
|
76 |
|