Spaces:
Sleeping
Sleeping
Update models/hsd_tr.py
Browse files- models/hsd_tr.py +4 -3
models/hsd_tr.py
CHANGED
@@ -14,10 +14,11 @@ label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
|
14 |
|
15 |
#user_input = st.text_input(" ")
|
16 |
user_input = st.text_input("Enter your text here:",)
|
17 |
-
if
|
|
|
18 |
result = sentiment_pipeline(user_input)
|
19 |
sentiment = result[0]["label"]
|
20 |
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
21 |
sentiment = label_dict[sentiment]
|
22 |
-
|
23 |
-
st.success(sentiment)
|
|
|
14 |
|
15 |
#user_input = st.text_input(" ")
|
16 |
user_input = st.text_input("Enter your text here:",)
|
17 |
+
if st.button("Predict"):
|
18 |
+
#if user_input:
|
19 |
result = sentiment_pipeline(user_input)
|
20 |
sentiment = result[0]["label"]
|
21 |
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
22 |
sentiment = label_dict[sentiment]
|
23 |
+
st.write(f"Detection: {sentiment}")
|
24 |
+
#st.success(sentiment)
|