rahbi's picture
Upload app.py
1eb3c4f verified
raw
history blame
570 Bytes
import gradio as gr
from transformers import pipeline
# Initialize the classifier pipeline
classifier = pipeline("text-classification", model="rahbi/alclam-base-v1-DID")
# Define the prediction function
def classify_text(text):
result = classifier(text)
return result
# Create the Gradio interface
iface = gr.Interface(
fn=classify_text,
inputs="text",
outputs="json",
title="Arabic Text Classifier",
description="Classify Arabic text using the rahbi/alclam-base-v1-DID model."
)
# Launch the interface
iface.launch()