Finnish grammatical case detection
Collection
Models detecting the correct grammatical case of a word • 1 item • Updated • 1
How to use johl/fi-case-detection-finbert with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="johl/fi-case-detection-finbert") # Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("johl/fi-case-detection-finbert")
model = AutoModelForTokenClassification.from_pretrained("johl/fi-case-detection-finbert", device_map="auto")# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("johl/fi-case-detection-finbert")
model = AutoModelForTokenClassification.from_pretrained("johl/fi-case-detection-finbert", device_map="auto")This model predicts the correct grammatical case for words in Finnish sentences. It can figure out the best-fitting case whether the target token is an uninflected base word or a masked placeholder.
Related code: https://github.com/joh17/case-detection
Related research publication: https://aclanthology.org/2026.sigtyp-main.1/
The repository includes:
List of the 14 target case labels, with the word talo (house) used as example:
| Label | Case name | Example | Rough meaning |
|---|---|---|---|
| Nom | Nominative | talo | house |
| Gen | Genitive | talon | of the house |
| Part | Partitive | taloa | (some) house |
| Ine | Inessive | talossa | in the house |
| Ela | Elative | talosta | out of the house |
| Ill | Illative | taloon | into the house |
| Ade | Adessive | talolla | at the house |
| Abl | Ablative | talolta | from the house |
| All | Allative | talolle | to the house |
| Ess | Essive | talona | as a house |
| Tra | Translative | taloksi | into a house |
| Abe | Abessive | talotta | without a house |
| Ins | Instructive | taloin | by means of houses |
| Com | Comitative | taloineen | with houses |
Base model
TurkuNLP/bert-base-finnish-uncased-v1
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="johl/fi-case-detection-finbert")