Abdurahman commited on
Commit
6b61ee0
·
1 Parent(s): f0e249a
Files changed (1) hide show
  1. util.py +3 -3
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(language_code='uig-Arab')
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) # make sure input text is arabic script for IPA conversion
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)