Update app.py
Browse files
app.py
CHANGED
|
@@ -76,22 +76,21 @@ def predict_and_save(text):
|
|
| 76 |
|
| 77 |
# Gradio UI
|
| 78 |
with gr.Blocks() as demo:
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
if __name__ == "__main__":
|
| 97 |
demo.launch()
|
|
|
|
| 76 |
|
| 77 |
# Gradio UI
|
| 78 |
with gr.Blocks() as demo:
|
| 79 |
+
"## π Multilingual Sentiment Analysis (Positive β’ Neutral β’ Negative)\n"
|
| 80 |
+
"**Languages:** English, Urdu, Roman Urdu \n"
|
| 81 |
+
"Model: `siebert/sentiment-roberta-large-english (For English)`\n `mrgmd01/sentiment_model_FineTune_cardiffnlp(For Urdu & Roman Urdu)`"
|
| 82 |
+
|
| 83 |
+
with gr.Tab("πΉ Single Text"):
|
| 84 |
+
user_text = gr.Textbox(label="Enter text", placeholder="Type in English, Urdu, or Roman Urdu...")
|
| 85 |
+
lang_dropdown = gr.Dropdown(["English", "Urdu", "Roman Urdu"], label="Language Hint", value="English")
|
| 86 |
+
btn = gr.Button("Analyze")
|
| 87 |
+
|
| 88 |
+
out_sent = gr.Textbox(label="Sentiment")
|
| 89 |
+
out_conf = gr.Textbox(label="Confidence (0β1)")
|
| 90 |
+
out_pol = gr.Textbox(label="Polarity")
|
| 91 |
+
out_file = gr.File(label="Download logs (.xlsx)")
|
| 92 |
+
|
| 93 |
+
btn.click(analyze_single, inputs=[user_text, lang_dropdown],
|
| 94 |
+
outputs=[out_sent, out_conf, out_pol, out_file])
|
|
|
|
| 95 |
if __name__ == "__main__":
|
| 96 |
demo.launch()
|