Production NER Implementation: Training, Serving, and Monitoring
Creating Quality Training Data
NER model quality depends heavily on training data quality. Annotation guidelines must be unambiguous: annotators need clear rules for what counts as each entity type, how to handle edge cases, and when to mark something as uncertain. Without clear guidelines, different annotators make different decisions, and the model learns inconsistent patterns.
Measure inter-annotator agreement using Cohen's kappa. A score above 0.8 indicates annotators agree consistently. Below 0.7 suggests your guidelines are ambiguous. When annotators disagree, have a senior annotator adjudicate, but also use the disagreement data to improve guidelines. If two competent annotators disagree on whether "Apple" is an organization or should be left unannotated in a specific context, that context is genuinely ambiguous and your guidelines need to address it.
Active Learning for Efficient Annotation
Annotating thousands of documents is expensive. Active learning reduces cost by selecting the most informative examples for annotation. The process: train an initial model on a small labeled set, use that model to find examples where it is most uncertain, annotate those uncertain examples, retrain, and repeat. This focuses annotation effort on the boundaries where the model struggles rather than examples it already handles well.
Scaling NER to Large Corpora
Processing billions of documents requires parallelization. Partition documents across workers, run NER independently on each partition, merge results. The process is embarrassingly parallel because documents are independent. The bottleneck shifts from compute to I/O: reading documents, writing extracted entities. Use batch processing frameworks that handle data shuffling efficiently.
For very large scale, consider approximate methods: run expensive NER on a sample, use the results to train a smaller, faster model, deploy the fast model on the full corpus. You trade some accuracy for orders of magnitude speedup.