fixed typo
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
from pathlib import Path
|
| 3 |
import time
|
| 4 |
import gradio as gr
|
| 5 |
-
from
|
| 6 |
import numpy as np
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
from huggingface_hub import hf_hub_download
|
|
@@ -55,25 +55,23 @@ with gr.Blocks(title="UPLME", theme=Soft(primary_hue="blue")) as demo:
|
|
| 55 |
gr.Markdown("# Empathy Prediction with Uncertainty Estimation")
|
| 56 |
with gr.Row():
|
| 57 |
with gr.Column():
|
| 58 |
-
essay_input = gr.Textbox(label="Response (E.g., Essay)", lines=10, placeholder="Enter the essay text here...")
|
| 59 |
article_input = gr.Textbox(label="Stimulus (E.g., News Article)", lines=10, placeholder="Enter the article text here...")
|
| 60 |
button = gr.Button("Predict")
|
| 61 |
with gr.Column():
|
| 62 |
-
output_mean = gr.Number(label="Predicted Empathy Score", precision=2)
|
| 63 |
ci_low = gr.Number(label="95% CI Lower Bound", precision=2)
|
| 64 |
ci_upp = gr.Number(label="95% CI Upper Bound", precision=2)
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
button.click(fn=predict_with_ci, inputs=[essay_input, article_input], outputs=[output_mean, ci_low, ci_upp, fig])
|
| 69 |
|
| 70 |
gr.Markdown("## About")
|
| 71 |
gr.Markdown("""
|
| 72 |
-
This application predicts empathy score using the UPLME model proposed in **UPLME: Uncertainty-Aware Probabilistic Language Modelling for Robust Empathy Regression** by **Md Rakibul Hasan, Md Zakir Hossain, Aneesh Krishna, Shafin Rahman and Tom Gedeon**.
|
| 73 |
-
|
| 74 |
-
-
|
| 75 |
-
- **Stimulus**: The text input representing the stimulus (e.g. newspaper article) that the response is based on.
|
| 76 |
-
- **Predicted Empathy**: The predicted empathy score on a scale from 0 to 100.
|
| 77 |
""")
|
| 78 |
|
| 79 |
if __name__ == "__main__":
|
|
|
|
| 2 |
from pathlib import Path
|
| 3 |
import time
|
| 4 |
import gradio as gr
|
| 5 |
+
from gradio.themes import Soft
|
| 6 |
import numpy as np
|
| 7 |
import matplotlib.pyplot as plt
|
| 8 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 55 |
gr.Markdown("# Empathy Prediction with Uncertainty Estimation")
|
| 56 |
with gr.Row():
|
| 57 |
with gr.Column():
|
| 58 |
+
essay_input = gr.Textbox(label="Response (E.g., Essay) towards the stimulus", lines=10, placeholder="Enter the essay text here...")
|
| 59 |
article_input = gr.Textbox(label="Stimulus (E.g., News Article)", lines=10, placeholder="Enter the article text here...")
|
| 60 |
button = gr.Button("Predict")
|
| 61 |
with gr.Column():
|
| 62 |
+
output_mean = gr.Number(label="Predicted Empathy Score (0-100)", precision=2)
|
| 63 |
ci_low = gr.Number(label="95% CI Lower Bound", precision=2)
|
| 64 |
ci_upp = gr.Number(label="95% CI Upper Bound", precision=2)
|
| 65 |
|
| 66 |
+
fig = gr.Plot(label="Prediction +/- 95% CI")
|
| 67 |
|
| 68 |
button.click(fn=predict_with_ci, inputs=[essay_input, article_input], outputs=[output_mean, ci_low, ci_upp, fig])
|
| 69 |
|
| 70 |
gr.Markdown("## About")
|
| 71 |
gr.Markdown("""
|
| 72 |
+
This application predicts empathy score and uncertainty estimates using the UPLME model proposed in **UPLME: Uncertainty-Aware Probabilistic Language Modelling for Robust Empathy Regression** by **Md Rakibul Hasan, Md Zakir Hossain, Aneesh Krishna, Shafin Rahman and Tom Gedeon**.
|
| 73 |
+
- Paper: https://arxiv.org/abs/2508.03520
|
| 74 |
+
- Code: https://github.com/hasan-rakibul/UPLME
|
|
|
|
|
|
|
| 75 |
""")
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
src/__pycache__/infer.cpython-313.pyc
ADDED
|
Binary file (1.74 kB). View file
|
|
|
src/__pycache__/paired_texts_modelling.cpython-313.pyc
ADDED
|
Binary file (6.68 kB). View file
|
|
|