Spaces:
Sleeping
Sleeping
adding examples
Browse files- src/main.py +11 -1
src/main.py
CHANGED
@@ -2,7 +2,6 @@ import os
|
|
2 |
import pickle
|
3 |
|
4 |
import gradio as gr
|
5 |
-
import numpy as np
|
6 |
from transformers import AutoModel, AutoTokenizer
|
7 |
|
8 |
from .utils import extract_hidden_state
|
@@ -45,6 +44,7 @@ def classify_arabic_dialect(text):
|
|
45 |
|
46 |
with gr.Blocks() as demo:
|
47 |
gr.HTML(index_html)
|
|
|
48 |
input_text = gr.Textbox(label="Your Arabic Text")
|
49 |
submit_btn = gr.Button("Submit")
|
50 |
predictions = gr.Label(num_top_classes=3)
|
@@ -52,6 +52,16 @@ with gr.Blocks() as demo:
|
|
52 |
fn=classify_arabic_dialect,
|
53 |
inputs=input_text,
|
54 |
outputs=predictions)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
gr.HTML("""
|
56 |
<p style="text-align: center;font-size: large;">
|
57 |
Checkout the <a href="https://github.com/zaidmehdi/arabic-dialect-classifier">Github Repo</a>
|
|
|
2 |
import pickle
|
3 |
|
4 |
import gradio as gr
|
|
|
5 |
from transformers import AutoModel, AutoTokenizer
|
6 |
|
7 |
from .utils import extract_hidden_state
|
|
|
44 |
|
45 |
with gr.Blocks() as demo:
|
46 |
gr.HTML(index_html)
|
47 |
+
|
48 |
input_text = gr.Textbox(label="Your Arabic Text")
|
49 |
submit_btn = gr.Button("Submit")
|
50 |
predictions = gr.Label(num_top_classes=3)
|
|
|
52 |
fn=classify_arabic_dialect,
|
53 |
inputs=input_text,
|
54 |
outputs=predictions)
|
55 |
+
|
56 |
+
gr.Markdown("## Text Examples")
|
57 |
+
examples = gr.Examples(
|
58 |
+
examples=[
|
59 |
+
"واش نتا خدام ولا لا",
|
60 |
+
"بصح راك فاهم لازم الزيت",
|
61 |
+
"حضرتك بروح زي كدا؟ على طول النهار ده",
|
62 |
+
],
|
63 |
+
inputs=input_text,
|
64 |
+
)
|
65 |
gr.HTML("""
|
66 |
<p style="text-align: center;font-size: large;">
|
67 |
Checkout the <a href="https://github.com/zaidmehdi/arabic-dialect-classifier">Github Repo</a>
|