Running my NER HF tuned model? [One solution]

This feels super basic, I'm sorry... I successfully labeled a bunch of data with an LLM in the loop (yay!) and then used the hf plugin to tune a distilbert-base-cased model... And now I guess I'm missing some doc pointers to how to run it :).

Updating this again, after hours of trying to figure out the fastest way to do this if i don't have a saved cfg I've already figured out -- it's this:

!pip install spacy-huggingface-pipelines
nlp = spacy.blank("en")
nlp.add_pipe("hf_token_pipe", config={"model": "ner-training/distilbert-ner-train/checkpoint-4446/"})

doc = nlp("goat cheese remoulade with Fig Jam, a Cabertnet Sauvignon 2019")
for ent in doc.ents:
    print(ent.text, ent.label_)

Apologies - but hey, the ann and hf plugins are great! Keep up the tooling!!

1 Like