Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,16 +20,31 @@ def detect_bias_and_type(text):
|
|
| 20 |
else:
|
| 21 |
return f"✅ **Unbiased** (Confidence: {score:.2%})"
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Gradio UI
|
| 24 |
iface = gr.Interface(
|
| 25 |
fn=detect_bias_and_type,
|
| 26 |
inputs=gr.Textbox(lines=3, placeholder="Enter a sentence..."),
|
| 27 |
outputs="markdown",
|
| 28 |
title="Bias Analyser",
|
| 29 |
-
description=
|
| 30 |
-
|
| 31 |
-
"Models: `himel7/bias-detector` and `maximuspowers/bias-type-classifier`"
|
| 32 |
-
),
|
| 33 |
examples=[
|
| 34 |
["The brilliant leader saved the country from disaster."],
|
| 35 |
["The government announced new tax reforms."],
|
|
|
|
| 20 |
else:
|
| 21 |
return f"✅ **Unbiased** (Confidence: {score:.2%})"
|
| 22 |
|
| 23 |
+
badges_html = """
|
| 24 |
+
<p align="center">
|
| 25 |
+
<a href="https://huggingface.co/himel7/bias-detector">
|
| 26 |
+
<img src="https://img.shields.io/badge/🤗-Hugging%20Face-yellow.svg">
|
| 27 |
+
</a>
|
| 28 |
+
<a href="https://huggingface.co/himel7/bias-detector">
|
| 29 |
+
<img src="https://img.shields.io/badge/Model-Homepage-purple.svg">
|
| 30 |
+
</a>
|
| 31 |
+
<a href="https://github.com/Himel1996/NewsBiasDetector/">
|
| 32 |
+
<img src="https://img.shields.io/badge/GitHub-Repo-orange.svg">
|
| 33 |
+
</a>
|
| 34 |
+
<a href="https://arxiv.org/abs/2505.13010v1">
|
| 35 |
+
<img src="https://img.shields.io/badge/arXiv-2505.13010-red.svg">
|
| 36 |
+
</a>
|
| 37 |
+
</p>
|
| 38 |
+
"""
|
| 39 |
+
|
| 40 |
# Gradio UI
|
| 41 |
iface = gr.Interface(
|
| 42 |
fn=detect_bias_and_type,
|
| 43 |
inputs=gr.Textbox(lines=3, placeholder="Enter a sentence..."),
|
| 44 |
outputs="markdown",
|
| 45 |
title="Bias Analyser",
|
| 46 |
+
description=badges_html,
|
| 47 |
+
("This tool detects whether a text is biased and classifies the type of bias.\n"),
|
|
|
|
|
|
|
| 48 |
examples=[
|
| 49 |
["The brilliant leader saved the country from disaster."],
|
| 50 |
["The government announced new tax reforms."],
|