Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Initialize the classifier pipeline | |
classifier = pipeline("text-classification", model="rahbi/alclam-base-v2-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 Dialect Identification", | |
#description="Identify Arabic dialect using the rahbi/alclam-base-v1-dialect model." | |
) | |
# Launch the interface | |
iface.launch() |