Spaces:
Sleeping
Sleeping
| 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() | |