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

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