Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,26 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
pipe = pipeline("text-classification", model="knowhate/HateBERTimbau")
|
6 |
demo = gr.Interface.from_pipeline(pipe)
|
7 |
demo.launch()
|
|
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
app_title = "Portuguese Hate Speech Detection"
|
6 |
+
|
7 |
+
app_description = """
|
8 |
+
This app detects hate speech on Portuguese text using multiple models. You can either introduce your own sentences by filling in "Text" or click on one of the examples provided below.
|
9 |
+
"""
|
10 |
+
|
11 |
+
app_examples = [
|
12 |
+
["As pessoas tem que perceber que ser 'panasca' não é deixar de ser homem, é deixar de ser humano hahaha"],
|
13 |
+
["Hoje tive uma conversa muito agradável com um colega meu"],
|
14 |
+
]
|
15 |
+
|
16 |
+
output_textbox_component_description = """
|
17 |
+
This box will display the hate speech detection results based on the average score of multiple models.
|
18 |
+
"""
|
19 |
+
|
20 |
+
output_json_component_description = { "breakdown": """
|
21 |
+
This box presents a detailed breakdown of the evaluation for each model.
|
22 |
+
"""}
|
23 |
+
|
24 |
+
|
25 |
pipe = pipeline("text-classification", model="knowhate/HateBERTimbau")
|
26 |
demo = gr.Interface.from_pipeline(pipe)
|
27 |
demo.launch()
|