Update app.py
Browse files
app.py
CHANGED
@@ -77,26 +77,20 @@ if submit:
|
|
77 |
data["embeddings"]
|
78 |
).flatten()
|
79 |
sorted = np.argsort(similarity_score)[::-1].tolist()
|
80 |
-
|
81 |
-
m = st.markdown("""
|
82 |
-
<style>
|
83 |
-
.stAlert {
|
84 |
-
text-align: center;
|
85 |
-
}
|
86 |
-
</style>""", unsafe_allow_html=True)
|
87 |
|
88 |
prediction = np.argmax(result, axis=-1)
|
89 |
if prediction == 0:
|
90 |
st.success(f"This news is {label[prediction]}.")
|
91 |
else:
|
92 |
-
st.markdown("""<p style="background-color: rgb(254, 242, 242);
|
93 |
color: rgb(153, 27, 27);
|
94 |
-
font-size:
|
95 |
border-radius: 7px;
|
96 |
padding-left: 12px;
|
97 |
padding-top: 13px;
|
98 |
padding-bottom: 13px;
|
99 |
-
line-height: 25px;
|
|
|
100 |
st.error(f"This news is {label[prediction]}.")
|
101 |
|
102 |
with st.expander("Related Articles"):
|
|
|
77 |
data["embeddings"]
|
78 |
).flatten()
|
79 |
sorted = np.argsort(similarity_score)[::-1].tolist()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
prediction = np.argmax(result, axis=-1)
|
82 |
if prediction == 0:
|
83 |
st.success(f"This news is {label[prediction]}.")
|
84 |
else:
|
85 |
+
st.markdown(f"""<p style="background-color: rgb(254, 242, 242);
|
86 |
color: rgb(153, 27, 27);
|
87 |
+
font-size: 50px;
|
88 |
border-radius: 7px;
|
89 |
padding-left: 12px;
|
90 |
padding-top: 13px;
|
91 |
padding-bottom: 13px;
|
92 |
+
line-height: 25px;
|
93 |
+
text-align: center;">This article is {label[prediction]}.</p>""", unsafe_allow_html=True)
|
94 |
st.error(f"This news is {label[prediction]}.")
|
95 |
|
96 |
with st.expander("Related Articles"):
|