![Arxiv:2105.05209V2 [Cs.CL] 13 May 2021 in Most Reasonable Contexts, Knowing That the Word Different Language Register](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
Restoring Hebrew Diacritics Without a Dictionary Elazar Gershuni Yuval Pinter Technion - Israel Institute of Technology Georgia Institute of Technology Haifa, Israel Atlanta, GA, USA [email protected] [email protected] המטוס נחת ברכות! Abstract We demonstrate that it is feasible to diacritize (a) hamatos naxat ???? Hebrew script without any human-curated re- ‘The plane landed (unspecified)’ הַמָּטוֹס Éחַת בְּר¯כּוּת! sources other than plain diacritized text. We present NAKDIMON, a two-layer character- (b) hamatos naxat b-rakut level LSTM, that performs on par with ‘The plane landed softly’ הַמָּטוֹס Éחַת בְּר´כוֹת! much more complicated curation-dependent systems, across a diverse array of modern He- (c) hamatos naxat braxot brew sources. ‘The plane landed congratulations’ 1 Introduction Table 1: An example of an undotted Hebrew text (a) The vast majority of modern Hebrew texts are writ- (written right to left) which can be interpreted in at least ten in a letter-only version of the Hebrew script, two different ways (b,c), dotted and pronounced differ- one which omits the diacritics present in the full di- ently, but only (b) makes grammatical sense. acritized, or dotted variant.1 Since most vowels are encoded via diacritics, the pronunciation of words dotted text. Obtaining such data is not trivial, even in the text is left underspecified, and a considerable given correct pronunciation: the standard Tiberian mass of tokens becomes ambiguous. This ambigu- diacritic system contains several sets of identically- ity forces readers and learners to infer the intended vocalized forms, so while most Hebrew speakers reading using syntactic and semantic context, as easily read dotted text, they are unable to produce it. well as common sense (Bentin and Frost, 1987; Moreover, the process of manually adding diacrit- Abu-Rabia, 2001). In NLP systems, recovering ics in either handwritten script or through digital such signals is difficult, and indeed their perfor- input devices is mechanically cumbersome. Thus, mance on Hebrew tasks is adversely affected by the overwhelming majority of modern Hebrew text the presence of undotted text (Shacham and Wint- is undotted, and manually dotting it requires exper- ner, 2007; Goldberg and Elhadad, 2010; Tsarfaty tise. The resulting scarcity of available dotted text et al., 2019). As an example, the sentence in Ta- in modern Hebrew contrasts with Biblical and Rab- ble 1 (a) will be resolved by a typical reader as (b) binical texts which, while dotted, manifest a very arXiv:2105.05209v2 [cs.CL] 13 May 2021 in most reasonable contexts, knowing that the word different language register. This state of affairs al- “softly” may characterize landings. In contrast, an lows individuals and companies to offer dotting as automatic system processing Hebrew text may not paid services, either by experts or automatically, be as sensitive to this kind of grammatical knowl- e.g. the Morfix engine by Melingo.2 edge and instead interpret the undotted token as the Existing computational approaches to dotting more frequent word in (c), harming downstream are manifested as complex, multi-resourced sys- performance. tems which perform morphological analysis on the One possible way to overcome this problem is undotted text and look undotted words up in hand- by adding diacritics to undotted text, or dotting, im- crafted dictionaries as part of the dotting process. plemented using data-driven algorithms trained on Dicta’s Nakdan (Shmidman et al., 2020), the cur- 1Also known as pointed text, or via the Hebrew term for the diacritic marks, nikkud/niqqud. 2https://nakdan.morfix.co.il/ rent state-of-the-art, applies such methods in ad- tagging problem, and in collecting our test set from dition to applying multiple neural networks over raw text, these added letters may conflict with the different levels of the text, requiring manual anno- dotting standard. For the sake of input integrity, tation not only for dotting but also for morphology. and unlike some other systems, we opt not to re- Among the resources it uses are a diacritized corpus move these characters, but instead employ a dotting of 3M tokens and a POS-tagged corpus of 300K policy consistent with full script. tokens. Training the model takes several weeks.3 In this work, we set out to simplify the dotting New test set Shmidman et al.(2020) provide a task as much as possible to standard modules. Our benchmark dataset for dotting modern Hebrew doc- system, NAKDIMON, accepts the undotted char- uments. However, it is relatively small and non- acter sequence as its input, consults no external diverse: all 22 documents in the dataset originate in resources or lexical components, and produces di- a single source, Hebrew Wikipedia articles. There- acritics for each character, resulting in dotted text fore, we created a new test set5 from a larger variety whose quality is comparable to that of the commer- of texts, including high-quality Wikipedia articles cial Morfix, on both character-level and word-level and edited news stories, as well as user-generated accuracy. To our knowledge, this is the first at- blog posts. This set consists of ten documents from tempt at a “light” model for Hebrew dotting since each of eleven sources (5x Dicta’s test set), and early HMM-based systems (Kontorovich, 2001; totals 20,476 word tokens, roughly 3.5x Dicta’s. Gal, 2002). In experiments over existing and novel datasets, we show that our system is particu- 3 Character-LSTM Dotter larly useful in the main use case of modern dotting, which is to convey the desired pronunciation to NAKDIMON embeds the input characters a reader, and that the errors it makes should be and passes them through a two-layer Bi- more easily detectable by non-professionals than LSTM (Hochreiter and Schmidhuber, 1997). The Dicta’s.4 LSTM output is fed into a single linear layer, which then feeds three linear layers, one for each 2 Dotting as Sequence Labeling diacritic category. Each character then receives a prediction for each category independently, and The input to the dotting task consists of a sequence decoding is performed greedily with no additional of characters, each of which is assigned at most one search techniques.6 In training, we sum the of each of three separate diacritic categories: one cross-entropy loss from all categories. Trivial category for the dot distinguishing shin ( ) from !שׁ decisions, such as the label for the shin/sin diacritic sin (!שׂ), two consonants sharing a base character .letter, are masked ש!-for any non another for the presence of dagesh/mappiq, a ;ש! central dot affecting pronunciation of some con- Training corpora Dotted modern Hebrew text sonants, e.g. /p/ from /f/, but also present is scarce, since speakers usually read and write פ|! פּ! elsewhere; and one for all other diacritic marks, undotted text, with the occasional diacritic for which mostly determine vocalization, e.g. /da/ .disambiguation when context does not suffice ד´! vs. /de/. Diacritics of different categories may As we are unaware of legally-obtainable dotted ד»! co-occur on single letters, e.g. , or may be absent !µ modern corpora, we use a combination of dot- altogether. ted pre-modern texts and semi-automatically dot- Full script Hebrew script written without inten- ted modern sources to train NAKDIMON. The tion of dotting typically employs a compensatory PRE-MODERN portion is obtained from two main variant known colloquially as full script (ktiv male, sources: A combination of late pre-modern text from Project Ben-Yehuda, mostly texts from the י! which adds instances of the letters ,(כתיב מלא! 7 in some places where they can aid pronuncia- late 19th century and the early 20th century; and ו! and tion, but are incompatible with the rules for dotted rabbinical texts from the medieval period, the most script. In our formulation of dotting as a sequence 5Provided as supplementary material. 3Private communication. 6We experimented with a CRF layer in preliminary phases 4The system is a available at www.nakdimon.org, and and did not find a substantial benefit. the source code is a available at http://github.com/ 7Obtained from the Ben-Yehuda Project https:// elazarg/nakdimon. benyehuda.org/. Genre Sources # Docs # Tokens We report the following metrics: decision accu- Wiki Dicta test set 22 5,862 racy (DEC), which is computed over the entire set News Yanshuf 78 11,323 of individual possible decisions: dagesh/mappiq y Literary Books, forums 129 73,770 * Official gov.il 2 7,619 for letters that allow it, sin/shin dot for the let- and all other diacritics for letters that allow ,ש! News / Mag Online outlets 84 55,467 ter * * User-gen. Blogs, forums 58 57,672 them; character accuracy (CHA) is the portion of * Wiki he.wikipedia 40 62,723 characters in the text that end up in their intended Total 413 274,436 final form (which may be the result of two or three decisions, e.g. dagesh + vowel); word accuracy Table 2: Data sources for our MODERN Hebrew train- ing set. Rows marked with * were automatically dotted (WOR) is the portion of words with no diacritiza- via the Dicta API and corrected manually. Rows with y tion mistakes; and vocalization accuracy (VOC) were dotted at low quality, requiring manual correction. is the portion of words where any dotting errors do The rest were available with professional dotting. not cause incorrect pronunciation.9 We train NAKDIMON over PRE-MODERN fol- lowed by five epochs over the MODERN corpus. important of which is Mishneh Torah.8 This por- We pre-process the input by removing all but He- tion contains roughly 2.6 million Hebrew tokens, brew characters, spaces and punctuation; digits are most of which are dotted, with a varying level of ac- converted to a dedicated symbol, as are Latin char- curacy, varying dotting styles, and varying degree acters.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-