For anyone finding this thread now: you can do this without labelling data, using a model that takes the entity type as input. I built one, ReDefiNER (GitHub - Jungroo-AI/redefiner: A 0.8B model that extracts the entities you define in a plain-English rulebook. It runs on a CPU and is free under Apache 2.0. · GitHub, Apache 2.0, runs on a CPU). You describe the type and the rules in plain English:
from redefiner import Tagger
tagger = Tagger.from_pretrained("jungroo-ai/redefiner-0.8b")
rulebook = """[RULES]
Extract every entity of the supplied types. Return exact spans from the text.
[TYPE] STORE_NUMBER
[DESCRIPTION] The store or branch number in a card transaction description, usually right after the merchant name.
SN1 Do not mark phone numbers, dates or amounts.
SN2 Keep a letter prefix in the span, as in K6148.
"""
tagger.extract(["FIVE GUYS 2565 DIST 468-981-3409 AL", "McDonald's K6148"], rulebook)
It returns exact character spans with a confidence, so you can send low-confidence rows for review. When it gets a pattern wrong, you add a rule instead of retraining. I haven’t tested it on transaction descriptions, so check a few hundred of your own rows first. If you already have labelled data, the token-classification approach above is still a good route.