Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import azure.cognitiveservices.speech as speechsdk
|
|
6 |
dialects = {"Palestinian/Jordanian": "P", "Syrian": "S", "Lebanese": "L", "Egyptian": "E"}
|
7 |
|
8 |
translator_en2ar = pipeline(task="translation", model="guymorlan/English2Dialect")
|
9 |
-
translator_ar2en = pipeline(task="translation", model="guymorlan/Shami2English")
|
10 |
transliterator = pipeline(task="translation", model="guymorlan/DialectTransliterator")
|
11 |
|
12 |
speech_config = speechsdk.SpeechConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
|
@@ -50,7 +49,7 @@ css = """
|
|
50 |
|
51 |
with gr.Blocks(title = "English to Levantine Arabic", css=css, theme="default") as demo:
|
52 |
gr.Markdown("# Levantine Arabic Translator")
|
53 |
-
with gr.Tab('
|
54 |
with gr.Row():
|
55 |
with gr.Column():
|
56 |
input_text = gr.Textbox(label="Input", placeholder="Enter English text", lines=1)
|
@@ -71,16 +70,6 @@ with gr.Blocks(title = "English to Levantine Arabic", css=css, theme="default")
|
|
71 |
btn.click(translate_english,inputs=[input_text], outputs=[pal, sy, lb, eg])
|
72 |
input_text.submit(translate_english, inputs=[input_text], outputs=[pal, sy, lb, eg])
|
73 |
pal.change(get_transliteration, inputs=[pal,], outputs=[pal_translit])
|
74 |
-
with gr.Tab('From Levantine Arabic to English'):
|
75 |
-
with gr.Row():
|
76 |
-
with gr.Column():
|
77 |
-
input_text = gr.Textbox(label="Input", placeholder="Enter Levantine Arabic text", lines=1, elem_id="trans")
|
78 |
-
gr.Examples(["خلينا ندور على مطعم تاني", "قديش حق البندورة؟"], input_text)
|
79 |
-
btn = gr.Button("Translate", label="Translate")
|
80 |
-
gr.Markdown("Built by [Guy Mor-Lan](mailto:guy.mor@mail.huji.ac.il).")
|
81 |
-
with gr.Column():
|
82 |
-
eng = gr.Textbox(label="English", lines=1, elem_id="liter")
|
83 |
-
btn.click(translate_arabic,inputs=input_text, outputs=[eng])
|
84 |
with gr.Tab("Transliterate"):
|
85 |
with gr.Row():
|
86 |
with gr.Column():
|
|
|
6 |
dialects = {"Palestinian/Jordanian": "P", "Syrian": "S", "Lebanese": "L", "Egyptian": "E"}
|
7 |
|
8 |
translator_en2ar = pipeline(task="translation", model="guymorlan/English2Dialect")
|
|
|
9 |
transliterator = pipeline(task="translation", model="guymorlan/DialectTransliterator")
|
10 |
|
11 |
speech_config = speechsdk.SpeechConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
|
|
|
49 |
|
50 |
with gr.Blocks(title = "English to Levantine Arabic", css=css, theme="default") as demo:
|
51 |
gr.Markdown("# Levantine Arabic Translator")
|
52 |
+
with gr.Tab('En -> Ar'):
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
input_text = gr.Textbox(label="Input", placeholder="Enter English text", lines=1)
|
|
|
70 |
btn.click(translate_english,inputs=[input_text], outputs=[pal, sy, lb, eg])
|
71 |
input_text.submit(translate_english, inputs=[input_text], outputs=[pal, sy, lb, eg])
|
72 |
pal.change(get_transliteration, inputs=[pal,], outputs=[pal_translit])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
with gr.Tab("Transliterate"):
|
74 |
with gr.Row():
|
75 |
with gr.Column():
|