Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ st.set_page_config(
|
|
22 |
sentiment_pipeline_tr = pipeline(task = "text-classification", model = "SoDehghan/BERTurk-hate-speech") # "gritli/bert-sentiment-analyses-imdb"
|
23 |
label_dict = {'LABEL_1': 'Hate ❌', 'LABEL_0': 'Non-hate ✅'}
|
24 |
|
25 |
-
def hsd_turkish:
|
26 |
|
27 |
result_tr = sentiment_pipeline_tr(tr_input)
|
28 |
sentiment_tr = result_tr[0]["label"]
|
@@ -31,12 +31,6 @@ def hsd_turkish:
|
|
31 |
return sentiment_tr
|
32 |
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
st.sidebar.title("Hate Speech Detection")
|
37 |
-
#st.sidebar.write("In this HuggingFace space you can use Hate Speech Detection model built at [VERİM - Center of Excellence in Data Analytics - Sabanci University](https://github.com/verimsu).")
|
38 |
-
st.sidebar.write('This tool is developed in the context of the EU project "Utilizing Digital Technology for Social Cohesion, Positive Messaging and Peace by Boosting Collaboration, Exchange and Solidarity" (EuropeAid/170389/DD/ACT/Multi) by [Sabanci University Center of Excellence in Data Analytics](https://github.com/verimsu).')
|
39 |
-
|
40 |
iface = gr.Interface(fn=[hsd_turkish],
|
41 |
inputs=gr.inputs.Textbox(lines=2, placeholder=None, label="Enter text here:"),
|
42 |
outputs=['text'], # a list should match the number of values returned by fn to have one input and 2 putputs.
|
@@ -44,4 +38,9 @@ iface = gr.Interface(fn=[hsd_turkish],
|
|
44 |
title = "HSD in Turkish",
|
45 |
theme = "peach")
|
46 |
|
47 |
-
iface.launch(share=False, enable_queue=True)
|
|
|
|
|
|
|
|
|
|
|
|
22 |
sentiment_pipeline_tr = pipeline(task = "text-classification", model = "SoDehghan/BERTurk-hate-speech") # "gritli/bert-sentiment-analyses-imdb"
|
23 |
label_dict = {'LABEL_1': 'Hate ❌', 'LABEL_0': 'Non-hate ✅'}
|
24 |
|
25 |
+
def hsd_turkish(text_in):
|
26 |
|
27 |
result_tr = sentiment_pipeline_tr(tr_input)
|
28 |
sentiment_tr = result_tr[0]["label"]
|
|
|
31 |
return sentiment_tr
|
32 |
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
iface = gr.Interface(fn=[hsd_turkish],
|
35 |
inputs=gr.inputs.Textbox(lines=2, placeholder=None, label="Enter text here:"),
|
36 |
outputs=['text'], # a list should match the number of values returned by fn to have one input and 2 putputs.
|
|
|
38 |
title = "HSD in Turkish",
|
39 |
theme = "peach")
|
40 |
|
41 |
+
iface.launch(share=False, enable_queue=True)
|
42 |
+
|
43 |
+
|
44 |
+
st.sidebar.title("Hate Speech Detection")
|
45 |
+
#st.sidebar.write("In this HuggingFace space you can use Hate Speech Detection model built at [VERİM - Center of Excellence in Data Analytics - Sabanci University](https://github.com/verimsu).")
|
46 |
+
st.sidebar.write('This tool is developed in the context of the EU project "Utilizing Digital Technology for Social Cohesion, Positive Messaging and Peace by Boosting Collaboration, Exchange and Solidarity" (EuropeAid/170389/DD/ACT/Multi) by [Sabanci University Center of Excellence in Data Analytics](https://github.com/verimsu).')
|