Supervised Grapheme-to-Phoneme Conversion of Orthographic Schwas in H indi and P unjabi (2020)

Abstract: Hindi grapheme-to-phoneme (G2P) conversion is mostly trivial, with one exception: whether a schwa represented in the orthography is pronounced or unpronounced (deleted). Previous work has attempted to predict schwa deletion in a rule-based fashion using prosodic or phonetic analysis. We present the first statistical schwa deletion classifier for Hindi, which relies solely on the orthography as the input and outperforms previous approaches. We trained our model on a newly-compiled pronunciation lexicon extracted from various online dictionaries. Our best Hindi model achieves state of the art performance, and also achieves good performance on a closely related language, Punjabi, without modification.

## introduction hindi is written in the devanagari script, which is an abugida, an orthographic system where the basic unit consists of a consonant and an optional vowel diacritic or a single vowel. devanagari is fairly regular, but a hindi word's actual pronunciation can differ from what is literally written in the devanagari script. 1 for instance, in the hindi word ⟨pep@r@⟩ 'paper', there are three units ⟨pe⟩, ⟨p@⟩, and ⟨r@⟩, corresponding to the pronounced forms [pe], [p@], and [r]. the second unit's inherent schwa is retained in the pronounced form, but the third unit's inherent schwa is deleted. predicting whether a schwa will be deleted from a word's orthographic form is generally difficult. some reliable rules can be stated, e.g. 'delete any schwa at the end of the word', but these do not perform well enough for use in an application that requires schwa deletion, like a text-to-speech synthesis system. this work approaches the problem of predicting schwa deletion in hindi with machine learning techniques, achieving high accuracy with minimal human intervention. we also successfully apply our hindi schwa deletion model to a related language, punjabi. our scripts for obtaining machinereadable versions of the hindi and punjabi pronunciation datasets are published to facilitate future comparisons. 2 ## previous work previous approaches to schwa deletion in hindi broadly fall into two classes. the first class is characterized by its use of rules given in the formalism of the sound pattern of english @xcite ). looking to analyses of schwa deletion produced by linguists (e.g., @xcite in this framework, others built schwa deletion systems by implementing their rules. for example, this is a rule used by @xcite , describing schwa deletion for words like я ⟨dz@ng@li:⟩: paraphrasing, this rule could be read, "if a schwa occurs with a vowel and two consonants to its left, and a consonant and a vowel to its right, it should be deleted." a typical system of this class would apply many of these rules to reach a word's output form, sometimes along with other information, like the set of allowable consonant clusters in hindi. these systems were able to achieve fair accuracy @xcite al. achieve 89%), but were ill-equipped to deal with cases that seemed to rely on detailed facts about hindi morphology and prosody. hort all etic 1, orfore wel nce final s, so ore asight the n in lgoand for ived c-v ord then lla-1, oot; foot given that /[ka@xmath0na$]/ already has a long vowel in word-final position, we can assign metrical feet based upon the weight of the syllables as shown in the following diagram (algorithm 1, step 3): prwd f σ light cv ka σ light cv ra f σ heavy ## methodology we frame schwa deletion as a binary classification problem: orthographic schwas are either fully retained or fully deleted when spoken. previous work has shown that even with rich linguistic representations of words, it is difficult to discover categorical rules that can predict schwa deletion. this led us to approach the problem with machine learning, which we felt would stand a better chance at attaining high performance. we obtained training data from digitized dictionaries hosted by the university of chicago digital dictionaries of south asia project. the hindi data, comprised of the original devanagari orthography and the phonemic transcription, was parsed out of @xcite and @xcite and transcribed into an ascii format. the punjabi data was similarly processed from @xcite . to find all instances of schwa retention and schwa deletion, we force-aligned orthographic and phonemic representations of each dictionary entry using a linear-time algorithm. in cases where force-alignment failed due to idiosyncrasies in the source data (typos, ocr errors, etc.) we discarded the entire word. we provide statistics about our datasets in each schwa instance was an input in our training set. the output was a boolean value indicating whether the schwa was retained. our features in the input column were a one-hot encoding of a variable window of phones to the left (c -n , . . . , c -1 ) and right (c +1 , . . . , c +m ) of the schwa instance (c 0 ) under consideration. the length of the window on either side was treated as a hyperparamater and tuned. we also tested whether including phonological features (for vowels: height, backness, rounded- hindi dict. entries schwas deletion rate mcgregor 34,952 36,183 52.94% bahri 9,769 14,082 49.41% google 847 1,098 56.28% punjabi dict. entries schwas deletion rate singh 28,324 34,576 52.25% ## results we obtained a maximum of 98.00% accuracy for all schwa instances in our test set from the mc-gregor dataset with gradient-boosted decision trees from xgboost. we used a window of 5 phonemes to the left and right of the schwa instance, phonological features, 200 estimators, and a maximum tree depth of 11. any model with at least 200 estimators and a depth of at least 5 obtains a comparable accuracy, but this gradually degrades with increasing estimators due to overfitting. without phonological feature data, the model consistently achieves a slightly lower accuracy of 97.93%. logistic regression with the same features achieved 97.19% accuracy. an mlp classifier with a single hidden layer of 250 neurons and a learning rate of 10 - foot_2 achieved 97.83% accuracy. on the singh dataset for punjabi, the same xg-boost model (except without phonological features) achieved 94.66% accuracy. this shows the extensibility of our system to other indo-aryan languages that undergo schwa deletion. we were unable to obtain evaluation datasets or code from previous work @xcite for a direct comparison of our system with previous ones. 4 however, we were able to port and test the hindi transliteration code written in lua utilized by @xcite , an online freely-editable dictionary operated by the wikimedia foundation, the parent of wikipedia. that system obtains 94.94% word-level accuracy on the mcgregor dataset, which we outperform consistently. ## discussion our system achieved higher performance than any other. the schwa instances which our model did not correctly predict tended to fall into two classes: borrowings from persian, arabic, or european languages, or compounds of native or sanskritborrowed morphemes. of the 150 hindi words from our test set from mcgregor that our best model incorrectly predicted schwa deletion for, we sampled 20 instances and tabulated their source languages. 10 were native indo-aryan terms descended through the direct ancestors of hindi, 4 were learned sanskrit borrowings, 5 were perso-arabic borrowings, and 1 was a dravidian borrowing. 9 were composed of multiple morphemes. borrowings are overrepresented relative to the baseline rate for hindi; in one frequency list, only 8 of the 1,000 top words in hindi were of perso-arabic origin @xcite . notably, some of the perso-arabic borrowings that the model failed on actually reflected colloquial pronunciation; e.g. a ⟨@m@n@⟩ is [@mn] in mcgregor yet our model predicts [@m@n] which is standard in most speech. we qualitatively analyzed our system to investigate what kind of linguistic representations it seemed to be learning. to do this, we inspected several decision trees generated in our model, and found that our system was learning both prosodic and phonetic patterns. some trees very clearly encoded phonotactic information. one tree we examined had a subtree that could be paraphrased like so, where c n indicates the phone n characters away from the schwa being considered: "if c +1 is beyond the end of the word, and c -2 is not beyond the beginning of the word, and c -2 is a ⟨t⟩, then if c -1 is a ⟨j⟩, then penalize deleting this schwa; foot_3 otherwise if c -1 is not a ⟨j⟩, prefer deleting this schwa." put another way, this subtree penalizes deleting a schwa if it comes at the end of a word, the preceding two characters are exactly ⟨tj⟩, and the word extends beyond the preceding two characters. this is just the kind of phonetic rule that systems like @xcite were using. the extent to which our system encodes prosodic information was less clear. our features were phonetic, not prosodic, but some prosodic information can be somewhat captured in terms of phonetics. take, for instance, this subtree that we found in our model, paraphrasing as before: "if c -3 is beyond the beginning of the word, and c -2 is ⟨a:⟩, then if c +2 is ⟨@⟩, prefer deletion; otherwise, if c +2 is not ⟨@⟩, penalize deletion." consider this rule as it would apply to the first schwa in the hindi word a ú ⟨a:m@d@ni:⟩ -3 -2 -1 0 1 2 3 4 5 a: m @ d @ n i: the rule decides that deleting the first schwa should be penalized, and it decided this by using criteria that entail that the preceding rhyme is heavy and the following rhyme is light. 6 obviously, though, this same rule would not work for other heavy and light syllables: if any of the vowels had been different, or at different offsets, a non-deletion rather than a deletion would have been preferred, which is not what it ought to do if it is emulating the prosodic rule. it is expected that our model is only able to capture ungeneralized, low-level patterns like this, since it lacks the symbolic vocabulary to capture elegant linguistic generalizations, and it is perhaps surprising that our system is able to achieve the performance it does even with this limitation. in future work, it would be interesting to give our system more directly prosodic representations, like the moraic weights of the surrounding syllables and syllabic stress. another limitation of our system is that it assumes all schwas are phonologically alike, which may not be the case. while most schwas are at all times either pronounced or deleted, there are less determinate cases where a schwa might or might not be deleted according to sociolinguistic and other factors. mcgregor (1993, p. xi) calls these "weakened schwas", describing them as "weakened by hindi speakers in many phonetic contexts, and dropped in others" and orthographically indicating them with a breve. ## conclusion we have presented the first statistical schwa deletion classifier for hindi achieves state-of-the-art performance. our system requires no hard-coded phonological rules, instead relying solely on pairs of orthographic and phonetic forms for hindi words at training time. furthermore, this research presents the first schwa-deletion model for punjabi, and has contributed several freely-accessible scripts for scraping hindi and punjabi pronunciation data from online sources.