|
from transformers import pipeline |
|
import gradio as gr |
|
|
|
|
|
model_path = "Nainglinthu/quest_model" |
|
|
|
|
|
classifier = pipeline("text-classification", model=model_path) |
|
|
|
|
|
def classify_text(text): |
|
results = classifier(text) |
|
return results |
|
|
|
|
|
iface = gr.Interface( |
|
fn=classify_text, |
|
inputs=gr.Textbox(lines=5, placeholder="Enter legal text here..."), |
|
outputs=gr.JSON(), |
|
title="Legal Text Classification", |
|
description="Classify legal text using your fine-tuned Legal BERT model." |
|
) |
|
|
|
if __name__ == "__main__": |
|
iface.launch() |
|
|