Finnish Grocery Text Classification
spaCy text classification for Finnish grocery text, assigning each item to a store category.
Backed by
TurkuNLP/bert-base-finnish-cased-v1; the pipeline is
transformer → textcat.
This repository holds the textcat model only. NER and text classification are
trained and published separately, so the matching ner model lives in its
own repository and is versioned independently of this one.
Labels
Categories: BABY, BAKERY, BAKING_SPICES, BEVERAGES, CONVENIENCE_FOOD, DAIRY, FROZEN, FRUITS_VEGETABLES, HOUSEHOLD, HYGIENE, MEAT_FISH, PANTRY, PET_SUPPLIES, SWEETS_SNACKS, OTHER
Performance (dev set)
| Metric | Score |
|---|
| Macro F1 | 0.833 |
| Micro F1 | 0.838 |
| Macro AUC | 0.964 |
Per-category F1:
| Category | F1 |
|---|
| BABY | 0.980 |
| BAKERY | 0.759 |
| BAKING_SPICES | 0.814 |
| BEVERAGES | 0.854 |
| CONVENIENCE_FOOD | 0.800 |
| DAIRY | 0.730 |
| FROZEN | 0.983 |
| FRUITS_VEGETABLES | 0.660 |
| HOUSEHOLD | 0.885 |
| HYGIENE | 0.828 |
| MEAT_FISH | 0.844 |
| PANTRY | 0.608 |
| PET_SUPPLIES | 0.988 |
| SWEETS_SNACKS | 0.930 |
| OTHER | 0.837 |
Note that the development set is generated from the same vocabulary as the
training set, so these figures measure fit rather than generalisation. Held-out
performance is measured against a hand-labelled probe set in the training
repository.
Usage
1import spacy
2
3nlp = spacy.load("juusopi/grocery-fi-textcat")
4doc = nlp("maito")
5
6best = max(doc.cats, key=doc.cats.get)
7print(best, doc.cats[best])
8# DAIRY 0.99
Model details
- Base model: TurkuNLP/bert-base-finnish-cased-v1
- spaCy version: >=3.8.15,<3.9.0
- Version: 3.0.0
Versions are semantic and describe the output contract: a major bump means the
label set changed and consumers mapping those labels must be updated.