Abdurahman
commited on
Commit
·
6b61ee0
1
Parent(s):
f0e249a
app
Browse files
util.py
CHANGED
@@ -21,7 +21,7 @@ ug_arab_to_latn = UgMultiScriptConverter('UAS', 'ULS')
|
|
21 |
ug_latn_to_arab = UgMultiScriptConverter('ULS', 'UAS')
|
22 |
|
23 |
# Initialize Epitran for Uyghur (Arabic script)
|
24 |
-
ipa_converter = epitran.Epitran(
|
25 |
|
26 |
|
27 |
## Front-End Utils
|
@@ -77,9 +77,9 @@ def calculate_pronunciation_accuracy(reference_text, output_text, script):
|
|
77 |
str: IPA transliteration of the output text.
|
78 |
"""
|
79 |
|
80 |
-
|
81 |
if script == 'Uyghur Latin':
|
82 |
-
reference_text = ug_latn_to_arab(reference_text)
|
83 |
|
84 |
# Remove punctuation from both texts
|
85 |
reference_text_clean = remove_punctuation(reference_text)
|
|
|
21 |
ug_latn_to_arab = UgMultiScriptConverter('ULS', 'UAS')
|
22 |
|
23 |
# Initialize Epitran for Uyghur (Arabic script)
|
24 |
+
ipa_converter = epitran.Epitran('uig-Arab')
|
25 |
|
26 |
|
27 |
## Front-End Utils
|
|
|
77 |
str: IPA transliteration of the output text.
|
78 |
"""
|
79 |
|
80 |
+
# make sure input text is arabic script for IPA conversion
|
81 |
if script == 'Uyghur Latin':
|
82 |
+
reference_text = ug_latn_to_arab(reference_text)
|
83 |
|
84 |
# Remove punctuation from both texts
|
85 |
reference_text_clean = remove_punctuation(reference_text)
|