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

Performance (dev set)

Metric Score
Macro F1 0.834
Micro F1 0.840
Macro AUC 0.963

Per-category F1:

Category F1
BABY 0.970
BAKERY 0.831
BAKING_SPICES 0.838
BEVERAGES 0.841
CONVENIENCE_FOOD 0.787
DAIRY 0.730
FROZEN 0.992
FRUITS_VEGETABLES 0.589
HOUSEHOLD 0.909
HYGIENE 0.824
MEAT_FISH 0.809
PANTRY 0.667
PET_SUPPLIES 0.965
SWEETS_SNACKS 0.932

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

import spacy

nlp = spacy.load("juusopi/grocery-fi-textcat")
doc = nlp("maito")

best = max(doc.cats, key=doc.cats.get)
print(best, doc.cats[best])
# DAIRY 0.99

Model details

Versions are semantic and describe the output contract: a major bump means the label set changed and consumers mapping those labels must be updated.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support