ai-rag / app.py
feersdilaa's picture
Update app.py
41bc2ba verified
raw
history blame contribute delete
547 Bytes
import gradio as gr
from rag_engine import NewsLegalAnalyzer
analyzer = NewsLegalAnalyzer()
analyzer.initialize()
def analyze_news(news):
if len(news) < 50:
return "Berita terlalu pendek."
return analyzer.analyze(news)
demo = gr.Interface(
fn=analyze_news,
inputs=gr.Textbox(label="Masukkan Berita", lines=10),
outputs=gr.Textbox(label="Hasil Analisis", lines=20),
title="AI RAG Hukum – Qwen + Gemini",
description="Masukkan berita dan sistem RAG akan mencari pasal hukum paling relevan."
)
demo.launch()