Spaces:
Sleeping
Sleeping
Update models/hsd_tr.py
Browse files- models/hsd_tr.py +2 -3
models/hsd_tr.py
CHANGED
@@ -5,6 +5,8 @@ import time
|
|
5 |
from transformers import pipeline
|
6 |
import os
|
7 |
|
|
|
|
|
8 |
def write():
|
9 |
st.markdown(
|
10 |
"""
|
@@ -12,11 +14,9 @@ def write():
|
|
12 |
"""
|
13 |
)
|
14 |
|
15 |
-
|
16 |
#st.title("Hate Speech Detection in Turkish with HuggingFace Spaces")
|
17 |
#st.write("Enter a sentence to detect its hateful:")
|
18 |
|
19 |
-
sentiment_pipeline = pipeline(task = "text-classification", model = "gritli/bert-sentiment-analyses-imdb")
|
20 |
|
21 |
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
22 |
|
@@ -27,4 +27,3 @@ if user_input:
|
|
27 |
|
28 |
sentiment = label_dict[sentiment]
|
29 |
st.write(f"Detection: {sentiment}")
|
30 |
-
#st.success(sentiment)
|
|
|
5 |
from transformers import pipeline
|
6 |
import os
|
7 |
|
8 |
+
sentiment_pipeline = pipeline(task = "text-classification", model = "gritli/bert-sentiment-analyses-imdb")
|
9 |
+
|
10 |
def write():
|
11 |
st.markdown(
|
12 |
"""
|
|
|
14 |
"""
|
15 |
)
|
16 |
|
|
|
17 |
#st.title("Hate Speech Detection in Turkish with HuggingFace Spaces")
|
18 |
#st.write("Enter a sentence to detect its hateful:")
|
19 |
|
|
|
20 |
|
21 |
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
22 |
|
|
|
27 |
|
28 |
sentiment = label_dict[sentiment]
|
29 |
st.write(f"Detection: {sentiment}")
|
|