Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ import re
|
|
| 12 |
from transformers import DistilBertTokenizerFast, DistilBertForSequenceClassification
|
| 13 |
|
| 14 |
# ── Load model from HuggingFace Hub ──
|
| 15 |
-
MODEL_ID = "Ahmadjunaid/
|
| 16 |
|
| 17 |
tokenizer = DistilBertTokenizerFast.from_pretrained(MODEL_ID)
|
| 18 |
model = DistilBertForSequenceClassification.from_pretrained(MODEL_ID)
|
|
@@ -226,7 +226,7 @@ with gr.Blocks(css=CSS, title="Tweet Sentiment Analysis") as demo:
|
|
| 226 |
|
| 227 |
with gr.Column(scale=2):
|
| 228 |
result_out = gr.Textbox(label="Prediction", elem_classes=["output-text"])
|
| 229 |
-
bar_out = gr.
|
| 230 |
cleaned_out = gr.Textbox(label="Cleaned Input (what the model sees)", lines=2)
|
| 231 |
|
| 232 |
gr.HTML('<div class="footer-note">Model: DistilBERT · Dataset: Sentiment140 · Technique: Fine-tuning · Split: 80/20</div>')
|
|
|
|
| 12 |
from transformers import DistilBertTokenizerFast, DistilBertForSequenceClassification
|
| 13 |
|
| 14 |
# ── Load model from HuggingFace Hub ──
|
| 15 |
+
MODEL_ID = "Ahmadjunaid/tweet-sentiment-distilbert"
|
| 16 |
|
| 17 |
tokenizer = DistilBertTokenizerFast.from_pretrained(MODEL_ID)
|
| 18 |
model = DistilBertForSequenceClassification.from_pretrained(MODEL_ID)
|
|
|
|
| 226 |
|
| 227 |
with gr.Column(scale=2):
|
| 228 |
result_out = gr.Textbox(label="Prediction", elem_classes=["output-text"])
|
| 229 |
+
bar_out = gr.Json(label="Confidence Scores (%)")
|
| 230 |
cleaned_out = gr.Textbox(label="Cleaned Input (what the model sees)", lines=2)
|
| 231 |
|
| 232 |
gr.HTML('<div class="footer-note">Model: DistilBERT · Dataset: Sentiment140 · Technique: Fine-tuning · Split: 80/20</div>')
|