File size: 564 Bytes
3bf6c16
 
 
 
0bd1b52
3bf6c16
 
 
 
 
 
 
 
 
8678d9a
3bf6c16
df0e5cd
9544fba
3bf6c16
 
 
1eb3c4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()