b AI -b AI : A Context-Aware Transliteration System for Baybayin Scripts (2025)

Abstract: Baybayin, a pre-colonial writing system from the Philippines, has seen a resurgence in recent years. Research in computational linguistics has shown an increasing interest in Baybayin OCR, which focuses on the recognition and classification of script characters. However, existing studies face challenges with ambiguous Baybayin words that have multiple possible transliterations. This study introduces a disambiguation technique that employs word embeddings (WE) for contextual analysis and uses part-of-speech (POS) tagging as an initial filtering step. This approach is compared with an LLM method that prompts GPT-4o mini to determine the most appropriate transliteration given a sentence input. The proposed disambiguation process is integrated into existing Baybayin OCR systems to develop bAI-bAI, a context-aware Baybayin transliteration system capable of handling ambiguous words. Results show that incorporating POS as a filter does not significantly affect performance. The WE-Only method yields an accuracy of 77.46% and takes 5.35ms to process one sample while leveraging GPT-4o mini peaks at a higher accuracy of 90.52% but with a much longer runtime of 3280ms per sample. These findings present an opportunity to further explore and improve NLP approaches in disambiguation methods.

## introduction baybayin is an ancient writing system widely used by the early filipinos starting around the 16th century @xcite . the term baybayin comes from the tagalog root word baybay, which means "to spell." tagalog forms the foundation of the filipino language @xcite . the existence of baybayin signifies the development of philippine society prior to spanish colonization @xcite . baybayin provides a cultural and national emblem to the filipino people and offers a sense of communal pride, belongingness, and social cohesion among diverse communities of filipinos in the philippines and abroad @xcite . delving into baybayin contributes to the conservation and comprehension of traditional filipino practices, beliefs, and customs. recently, there has been a resurgence of interest in baybayin that serves as fuel to cultural revival and artistic expression. contemporary artists and writers have incorporated traditional elements into their work, as evidenced by the adoption of baybayin across various creative mediums from paintings to tattoos (narra @xcite . moreover, baybayin has found its way into public spaces such as the lagusnilad underpass and public transit systems @xcite . legislative efforts have also been made to recognize baybayin, such as the "national writing system act" by the house of representatives which sought to declare baybayin as the country's national writing system @xcite . in line with this, the department of education (deped) and the commission on higher education (ched) of the philippines have incorporated baybayin into their educational programs @xcite . while studies have been conducted on developing optical character recognition (ocr) systems that can transliterate baybayin text, these systems lack awareness on the context surrounding the words. this becomes problematic in the presence of words that have ambiguous translations. behind this gap arises the need for a context-aware model that is capable of identifying the appropriate word given multiple possible translations. for example, could mean either "bawat isa ay may boto sa halalan" (as in, "everyone has a vote in the elections") or "bawat isa ay may buto sa halalan" ("everyone has a bone in the elections"). given the electoral context of the sentence, it is more appropriate to choose the term "boto" ("vote") as the correct transliteration. this study presents bai-bai, a context-aware system that is able to identify the correct transliteration of ambiguous baybayin words. it tests and compares two methods in achieving this goal: (1) a more traditional yet more explainable approach that uses word embeddings in conjunction with a part-of-speech tagger; and (2) a more advanced yet more blackbox-like approach that queries an llm api. ## methodology the end goal of this study is to develop bai-bai, an end-to-end context-aware system that can transliterate baybayin script, including ambiguous words, to filipino given an input image. this process entails four main stages: acquisition and preprocessing of data, development of the two word disambiguation systems, evaluation of both systems, and finally, integration of the disambiguation process with an ocr model. 3.1 data acquisition and preprocessing 3.1.1 corpus the palito tagalog corpus developed by dita et al. ( 2009 ) was expanded with a collection of short stories written in filipino to build the corpus for this study, with the final corpus having 627,711 words in total, of which 35,474 are unique. in preparing the corpus for generating word embeddings, several preprocessing steps were implemented. first, accented characters were replaced with their unaccented counterparts and all characters were converted to lowercase to ensure uniformity in representation. then, punctuation marks, numerical digits, and other non-alphabetic characters were removed from the text. finally, stopwords, as compiled by diaz jr. (2016), were excluded from the corpus. ## results and discussion the proposed disambiguation processes were applied to 1,058 text blocks containing words that are ambiguous when transliterated from baybayin. as shown in the pos+we hybrid model yielded a 76.42% accuracy, with its individual components achieving 69.79% and 79.14%, respectively. while lower than gpt, pos+we substantially outperforms the random guess baseline of 47.64%. furthermore, although the we-only technique achieved a slightly higher accuracy of 77.46%, it does not imply that the pos step is redundant as the hybrid model was able to successfully process a larger proportion of the sample size (984 vs. 967). rather, it suggests that improving the performance of the pos tagger may enhance overall system performance. it is important to note that both approaches fell short of the total sample size (1,058) due to inconclusive cases. this limitation arises from the use of word embeddings, which are limited by the vocab-ulary present in the training corpus. when words from the input sentence or the definitions of a word do not exist in the corpus (i.e., out of vocabulary, or oov), the calculation for cosine similarity results in none. this leads to an undetermined outcome due to the absence of quantifiable similarities. in certain instances, this can be addressed by the pos tagger, as evidenced by the lower number of inconclusive samples in the hybrid approach. however, when both the word embeddings component and the pos tagger fail to provide a conclusive match, the overall system is incapable of processing the input. this limitation was not factored into the calculation of accuracies presented in ## conclusion this study introduced and compared two methodologies for resolving ambiguities in baybayin words with multiple possible transliterations: (1) the more traditional yet more explainable pos+we method, and (2) the more blackbox-like yet more advanced gpt*n method. empirical evaluation of these approaches showed that gpt*5 was the most effective with an accuracy of 90.52%. however, this was accompanied by a substantial increase in computational demand, with gpt*5 requiring 121 times more processing time than pos+we. despite its lower accuracy of 77.46%, we-only was considerably more efficient with its capability to process one sample in a mere 5.35ms. furthermore, adding pos to we and prompt repetition for gpt do not appear to provide statistically significant benefits. these disambiguation techniques were integrated with a baybayin ocr model to implement bai-bai, an end-to-end system capable of transliterating baybayin text blocks, including those with ambiguous words.