Spaces:
Sleeping
Sleeping
Update models/hsd_tr.py
Browse files- models/hsd_tr.py +12 -10
models/hsd_tr.py
CHANGED
@@ -10,15 +10,17 @@ label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
|
10 |
|
11 |
|
12 |
#st.title("Hate Speech Detection in Turkish with HuggingFace Spaces")
|
13 |
-
#st.write("Enter a Turkish sentence
|
14 |
-
|
15 |
#user_input = st.text_input(" ")
|
16 |
-
|
17 |
-
|
|
|
18 |
#if user_input:
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
10 |
|
11 |
|
12 |
#st.title("Hate Speech Detection in Turkish with HuggingFace Spaces")
|
13 |
+
#st.write("Enter a Turkish sentence here:")
|
|
|
14 |
#user_input = st.text_input(" ")
|
15 |
+
|
16 |
+
user_input = st.text_input("Enter your text here:",)
|
17 |
+
|
18 |
#if user_input:
|
19 |
+
if st.button("Click for predictions!"):
|
20 |
+
with st.spinner('Generating predictions...'):
|
21 |
+
result = sentiment_pipeline(user_input)
|
22 |
+
sentiment = result[0]["label"]
|
23 |
+
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
24 |
+
sentiment = label_dict[sentiment]
|
25 |
+
#st.write(f"Detection: {sentiment}")
|
26 |
+
#st.success(sentiment)
|