Skip to main content
100%

Gist dec05c8e23491da95f80ba891c35100a

✓ Published0🌍 Public
AArizonaTay
Last edited Dec 29, 2021
Created on Dec 29, 2021

This example trains a custom named entity recognition (NER) model using spaCy to identify sponsor mentions, product names, and promo codes in social media captions. It first preprocesses a data frame of captions by stripping non-alphabetic characters, then initializes a pre-trained English model and adds custom labels. Training uses 10 epochs with minibatch compounding and dropout, iterating over hand-labeled examples that mark entity spans. After training, the model is saved to disk and reloaded to test inference on new text, demonstrating the pipeline’s ability to extract promotional entities from informal, hashtag-heavy captions.

AI-generated description

Similar vizzes