Instructions to use juusopi/grocery-fi-textcat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- spaCy
How to use juusopi/grocery-fi-textcat with spaCy:
!pip install https://huggingface.co/juusopi/grocery-fi-textcat/resolve/main/grocery-fi-textcat-any-py3-none-any.whl # Using spacy.load(). import spacy nlp = spacy.load("grocery-fi-textcat") # Importing as module. import grocery-fi-textcat nlp = grocery-fi-textcat.load() - Notebooks
- Google Colab
- Kaggle
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
- Base model: TurkuNLP/bert-base-finnish-cased-v1
- spaCy version: >=3.8.11,<3.9.0
- Version: 2.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.
- Downloads last month
- -