rahbi commited on
Commit
3bf6c16
·
verified ·
1 Parent(s): e185eed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -1,22 +1,22 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
-
4
- # Initialize the classifier pipeline
5
- classifier = pipeline("text-classification", model="rahbi/alclam-base-v1-DID")
6
-
7
- # Define the prediction function
8
- def classify_text(text):
9
- result = classifier(text)
10
- return result
11
-
12
- # Create the Gradio interface
13
- iface = gr.Interface(
14
- fn=classify_text,
15
- inputs="text",
16
- outputs="json",
17
- title="Arabic Text Classifier",
18
- description="Classify Arabic text using the rahbi/alclam-base-v1-DID model."
19
- )
20
-
21
- # Launch the interface
22
  iface.launch()
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Initialize the classifier pipeline
5
+ classifier = pipeline("text-classification", model="rahbi/alclam-base-v1-dialect-id")
6
+
7
+ # Define the prediction function
8
+ def classify_text(text):
9
+ result = classifier(text)
10
+ return result
11
+
12
+ # Create the Gradio interface
13
+ iface = gr.Interface(
14
+ fn=classify_text,
15
+ inputs="text",
16
+ outputs="json",
17
+ title="Arabic Text Classifier",
18
+ description="Classify Arabic text using the rahbi/alclam-base-v1-DID model."
19
+ )
20
+
21
+ # Launch the interface
22
  iface.launch()