papie lemmatization · tagging · any language

Silver-data pretraining

Gold annotations are scarce; unlabelled text is not. Silver data is text labelled automatically (by a trained model, an analyzer, or another corpus’s tagger). Silver labels are noisier but plentiful, so they make a useful pretraining phase: the model first trains on silver for a number of epochs you choose, then fine-tunes on gold with the usual early stopping.

raw textno labelsannotatora trained model (annotate)silver TSVautomatic labelsphase 1: silver--silver-epochs N, no early stoppingsilver checkpointlast.ckptphase 2: goldwarm start, fresh optimizer, early stoppingbest modelone label encoder, built from gold + silver, serves both phases
Silver pretraining, then gold fine-tuning, in one command.

Train

python -m papie.cli fit-silver -c config.yaml \
    --silver silver.tsv --silver-epochs 5

config.yaml is the ordinary config for the gold data. The command runs two stages through the normal fit:

  1. Silver phase — path_train is replaced by the silver file and training runs for exactly --silver-epochs epochs. Early stopping is removed (so a noisy dev curve cannot end the phase early) and only last.ckpt is kept. The dev set is still the gold dev set, so you can watch what silver does to it.
  2. Gold phase — your original config, warm-started from that checkpoint (model.init_from), with a fresh optimizer, scheduler, early stopping and checkpointing.

Both phases share one label encoder built from gold and silver, so neither vocabulary is truncated. Several --silver files may be given. Everything is written to runs/silver/<config name>/ (override with --workdir); the silver phase is skipped on a re-run if its checkpoint exists (--force redoes it), so an interrupted gold phase can simply be restarted. --dry-run writes the two stage configs and stops.

The silver file uses the same format and columns as the gold data (see Getting started).

Create silver data

Any process that writes a TSV works. annotate labels raw text with a trained model:

python -m papie.cli annotate -c config.yaml --ckpt teacher.ckpt \
    --input raw.txt --output silver.tsv [--device cuda]

The input is plain text (one sentence per line, whitespace-separated tokens) or a TSV with tokens in column 0. Every task in the config is predicted and written at its configured column. Long sentences are split at --max-sent-len (35).

Warm start from any checkpoint

model.init_from: path/to/last.ckpt works on its own in any config, with an exact load (same architecture and label vocabulary) or a vocabulary-aware transfer (init_from_mode: transfer). See Fine-tuning and transfer.

Notes

  • How many silver epochs help is an empirical question; start small (2–5) and compare the gold dev curve with a gold-only run.
  • Known and ambiguous token statistics (used in the known/unknown accuracy splits) are computed over gold + silver vocabulary.
  • The pipeline is tested (stage planning, file handling, annotation format) and runs end to end on a small example, but its effect on accuracy has not been measured yet.