Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3model_path = "JavaneseHonorifics/Unggah-Ungguh-Javanese-Bert-Classifier"
4tokenizer = AutoTokenizer.from_pretrained(model_path)
5model = AutoModelForSequenceClassification.from_pretrained(model_path)
6INPUT_TEXT = "Mbak Srini mangan pecel ajange pincuk"
7tokenized_input = tokenizer([INPUT_TEXT], return_tensors="pt", truncation=True, padding=True)
8with torch.no_grad():
9 outputs = model(**tokenized_input)
10 y_pred = outputs.logits.argmax(-1)
11print("Predicted class:", y_pred.item())1@inproceedings{farhansyah-etal-2025-language,
2 title = "Do Language Models Understand Honorific Systems in {J}avanese?",
3 author = "Farhansyah, Mohammad Rifqi and
4 Darmawan, Iwan and
5 Kusumawardhana, Adryan and
6 Winata, Genta Indra and
7 Aji, Alham Fikri and
8 Wijaya, Derry Tanti",
9 editor = "Che, Wanxiang and
10 Nabende, Joyce and
11 Shutova, Ekaterina and
12 Pilehvar, Mohammad Taher",
13 booktitle = "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
14 month = jul,
15 year = "2025",
16 address = "Vienna, Austria",
17 publisher = "Association for Computational Linguistics",
18 url = "https://aclanthology.org/2025.acl-long.1296/",
19 doi = "10.18653/v1/2025.acl-long.1296",
20 pages = "26732--26754",
21 ISBN = "979-8-89176-251-0",
22 abstract = "The Javanese language features a complex system of honorifics that vary according to the social status of the speaker, listener, and referent. Despite its cultural and linguistic significance, there has been limited progress in developing a comprehensive corpus to capture these variations for natural language processing (NLP) tasks. In this paper, we present Unggah-Ungguh, a carefully curated dataset designed to encapsulate the nuances of Unggah-Ungguh Basa, the Javanese speech etiquette framework that dictates the choice of words and phrases based on social hierarchy and context. Using Unggah-Ungguh, we assess the ability of language models (LMs) to process various levels of Javanese honorifics through classification and machine translation tasks. To further evaluate cross-lingual LMs, we conduct machine translation experiments between Javanese (at specific honorific levels) and Indonesian. Additionally, we explore whether LMs can generate contextually appropriate Javanese honorifics in conversation tasks, where the honorific usage should align with the social role and contextual cues. Our findings indicate that current LMs struggle with most honorific levels, exhibiting a bias toward certain honorific tiers."
23}