Spaces:
Running
Running
Delete app.py
Browse files
app.py
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
import awesome_streamlit as ast
|
2 |
-
import streamlit as st
|
3 |
-
import requests
|
4 |
-
import time
|
5 |
-
from transformers import pipeline
|
6 |
-
import os
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
sentiment_pipeline = pipeline(task = "text-classification", model = "gritli/bert-sentiment-analyses-imdb")
|
11 |
-
|
12 |
-
st.title("Hate Speech Detection in Turkish")
|
13 |
-
st.write(" ")
|
14 |
-
st.write("Enter a sentence to detect its hateful:")
|
15 |
-
|
16 |
-
label_dict = {'LABEL_0': 'Hate', 'LABEL_1': 'Non-hate'}
|
17 |
-
|
18 |
-
user_input = st.text_input("")
|
19 |
-
if user_input:
|
20 |
-
result = sentiment_pipeline(user_input)
|
21 |
-
sentiment = result[0]["label"]
|
22 |
-
|
23 |
-
sentiment = label_dict[sentiment]
|
24 |
-
st.write(f"Detection: {sentiment}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|