Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import joblib
|
|
4 |
# Function to load your model (adjust the path and method if needed)
|
5 |
def load_model():
|
6 |
# This path is relative to the root of your Hugging Face Space
|
7 |
-
model_path = "./
|
8 |
model = joblib.load(model_path)
|
9 |
return model
|
10 |
|
@@ -19,13 +19,12 @@ def predict_hate_speech(text):
|
|
19 |
|
20 |
# Adjusted Gradio interface to take text input and output model predictions
|
21 |
iface = gr.Interface(fn=predict_hate_speech,
|
22 |
-
inputs=gr.
|
23 |
outputs="text",
|
24 |
-
description="Detects hate speech in text. Outputs '
|
25 |
iface.launch()
|
26 |
|
27 |
|
28 |
-
|
29 |
"""
|
30 |
import gradio as gr
|
31 |
|
|
|
4 |
# Function to load your model (adjust the path and method if needed)
|
5 |
def load_model():
|
6 |
# This path is relative to the root of your Hugging Face Space
|
7 |
+
model_path = "./en-hate-speech-detection-3label"
|
8 |
model = joblib.load(model_path)
|
9 |
return model
|
10 |
|
|
|
19 |
|
20 |
# Adjusted Gradio interface to take text input and output model predictions
|
21 |
iface = gr.Interface(fn=predict_hate_speech,
|
22 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter Text Here..."),
|
23 |
outputs="text",
|
24 |
+
description="Detects hate speech in text. Outputs 'Neutral or Ambiguous', 'Not Hate', 'Offensive or Hate Speech'.")
|
25 |
iface.launch()
|
26 |
|
27 |
|
|
|
28 |
"""
|
29 |
import gradio as gr
|
30 |
|