SinaAhmadi
commited on
Commit
•
96cfc8d
1
Parent(s):
fd9da3b
Update app.py
Browse files
app.py
CHANGED
@@ -87,10 +87,6 @@ def normalize(text):
|
|
87 |
result = _translate_data(test_data)
|
88 |
return result
|
89 |
|
90 |
-
examples = [
|
91 |
-
["ياخوا تةمةن دريژبيت بوئةم ميللةتة"],
|
92 |
-
["سلاو برا جونی؟"],
|
93 |
-
]
|
94 |
|
95 |
title = "Script Normalization for Unconventional Writing"
|
96 |
|
@@ -110,12 +106,35 @@ description = """
|
|
110 |
For more information, you can check out the project on GitHub too: <a href="https://github.com/sinaahmadi/ScriptNormalization" target="_blank"><strong>https://github.com/sinaahmadi/ScriptNormalization</strong></a>
|
111 |
"""
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
demo = gr.Interface(
|
114 |
title=title,
|
115 |
description=description,
|
116 |
fn=normalize,
|
117 |
-
inputs
|
118 |
-
|
|
|
|
|
|
|
119 |
examples=examples
|
120 |
)
|
121 |
|
|
|
87 |
result = _translate_data(test_data)
|
88 |
return result
|
89 |
|
|
|
|
|
|
|
|
|
90 |
|
91 |
title = "Script Normalization for Unconventional Writing"
|
92 |
|
|
|
106 |
For more information, you can check out the project on GitHub too: <a href="https://github.com/sinaahmadi/ScriptNormalization" target="_blank"><strong>https://github.com/sinaahmadi/ScriptNormalization</strong></a>
|
107 |
"""
|
108 |
|
109 |
+
languages_scripts = {
|
110 |
+
"Azeri Turkish in Persian": "AzeriTurkish-Persian",
|
111 |
+
"Central Kurdish in Arabic": "Sorani-Arabic",
|
112 |
+
"Central Kurdish in Persian": "Sorani-Persian",
|
113 |
+
"Gilaki in Persian": "Gilaki-Persian",
|
114 |
+
"Gorani in Arabic": "Gorani-Arabic",
|
115 |
+
"Gorani in Central Kurdish": "Gorani-Sorani",
|
116 |
+
"Gorani in Persian": "Gorani-Persian",
|
117 |
+
"Kashmiri in Urdu": "Kashmiri-Urdu",
|
118 |
+
"Mazandarani in Persian": "Mazandarani-Persian",
|
119 |
+
"Northern Kurdish in Arabic": "Kurmanji-Arabic",
|
120 |
+
"Northern Kurdish in Persian": "Kurmanji-Persian",
|
121 |
+
"Sindhi in Urdu": "Sindhi-Urdu"
|
122 |
+
}
|
123 |
+
|
124 |
+
examples = [
|
125 |
+
["ياخوا تةمةن دريژبيت بوئةم ميللةتة", "Central Kurdish in Arabic"],
|
126 |
+
["سلاو برا جونی؟", "Central Kurdish in Arabic"],
|
127 |
+
]
|
128 |
+
|
129 |
demo = gr.Interface(
|
130 |
title=title,
|
131 |
description=description,
|
132 |
fn=normalize,
|
133 |
+
inputs = [
|
134 |
+
gr.inputs.Textbox(lines=4, label="Noisy Text"),
|
135 |
+
gr.Dropdown(label="Language in unconventional script", choices=sorted(list(languages_scripts.keys()))),
|
136 |
+
],
|
137 |
+
outputs=gr.outputs.Textbox(lines=4, label="Normalized Text"),
|
138 |
examples=examples
|
139 |
)
|
140 |
|