absa-app / app.py
asmashayea's picture
m
7ebac28
raw
history blame
740 Bytes
import gradio as gr
from inference import predict_absa, MODEL_OPTIONS
def run_absa(review, model_choice):
try:
return predict_absa(review, model_choice)
except Exception as e:
return f"❌ Error: {str(e)}"
demo = gr.Interface(
fn=run_absa,
inputs=[
gr.Textbox(label="Arabic Review"),
gr.Dropdown(choices=list(MODEL_OPTIONS.keys()), label="Choose Model", value="Araberta")
],
outputs=gr.Textbox(label="Extracted Aspect-Sentiment-Opinion Triplets"),
title="Arabic ABSA (Aspect-Based Sentiment Analysis)",
description="Choose a model (Araberta, mT5, GPT) to extract aspects, opinions, and sentiment using LoRA adapters"
)
if __name__ == "__main__":
demo.launch()