Automatic Grammatical Case Prediction for Template Filling in Case-Marking Languages: Implementation and Evaluation for Finnish

Johannes Laurmaa


Abstract
Automatically generating grammatically correct sentences in case-marking languages is hard because nominal case inflection depends on context. In template-based generation, placeholders must be inflected to the right case before insertion, otherwise the result is ungrammatical. We formalise this case selection problem for template slots and present a practical, data-driven solution designed for morphologically rich, case-marking languages, and apply it to Finnish. We automatically derive training instances from raw text via morphological analysis, and fine-tune transformer encoders to predict a distribution over 14 grammatical cases, with and without lemma conditioning. The predicted case is then realized by a morphological generator at deployment. On a held-out test set in the lemma-conditioned setting, our model attains 89.1% precision, 81.1% recall, and 84.2% F1, with recall@3 of 93.3% (macro averages). The probability outputs support abstention and top-k- suggestion User Interfaces, enabling robust, lightweight template filling for production use in multiple domains, such as customer messaging. The pipeline assumes only access to raw text plus a morphological analyzer and generator, and can be applied to other languages with productive case systems.
Anthology ID:
2026.sigtyp-main.1
Volume:
Proceedings of the 8th Workshop on Research in Computational Linguistic Typology and Multilingual NLP
Month:
March
Year:
2026
Address:
Rabat, Morocco
Editors:
Ekaterina Vylomova, Andrei Shcherbakov, Priya Rani
Venues:
SIGTYP | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
1–11
Language:
URL:
https://aclanthology.org/2026.sigtyp-main.1/
DOI:
Bibkey:
Cite (ACL):
Johannes Laurmaa. 2026. Automatic Grammatical Case Prediction for Template Filling in Case-Marking Languages: Implementation and Evaluation for Finnish. In Proceedings of the 8th Workshop on Research in Computational Linguistic Typology and Multilingual NLP, pages 1–11, Rabat, Morocco. Association for Computational Linguistics.
Cite (Informal):
Automatic Grammatical Case Prediction for Template Filling in Case-Marking Languages: Implementation and Evaluation for Finnish (Laurmaa, SIGTYP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.sigtyp-main.1.pdf