SyncAI.news, a Varaisys broadcasting
Introducing Prodigy-HF: a direct integration with Hugging Face
HF

Hugging Face Blog

· 1 min read

AI LabsHugging Face Blog

Introducing Prodigy-HF: a direct integration with Hugging Face

Prodigy is an annotation tool made by Explosion, a company well known as the creators of spaCy. It's a fully scriptable product with a large community around it. The product has many features, including tight integration with spaCy and active learning capabilities. But the main feature of the product is that it is programmatically customizable with Python.

To foster this customisability, Explosion has started releasing plugins. These plugins integrate with third-party tools in an open way that encourages users to work on bespoke annotation workflows. However, one customization specifically deserves to be celebrated explicitly. Last week, Explosion introduced Prodigy-HF, which offers code recipes that directly integrate with the Hugging Face stack. It's been a much-requested feature on the Prodigy support forum, so we're super excited to have it out there.

Features

The first main feature is that this plugin allows you to train and re-use Hugging Face models on your annotated data. That means if you've been annotating data in our interface for named entity recognition, you can directly fine-tune BERT models against it.

After installing the plugin you can call the hf.train.ner recipe from the command line to train a transformer model directly on your own data.

python -m prodigy hf.train.ner fashion-train,eval:fashion-eval path/to/model-out --model "distilbert-base-uncased"

This will fine-tune the distilbert-base-uncased model for the dataset you've stored in Prodigy and save it to disk. Similarly, this plugin also supports models for text classification via a very similar interface.

python -m prodigy hf.train.textcat fashion-train,eval:fashion-eval path/to/model-out --model "distilbert-base-uncased"
python -m prodigy hf.correct.ner fashion-train path/to/model-out examples.jsonl

This will give you a similar interface as before, but now the model predictions will be shown in the interface as well.

Upload

python -m prodigy hf.upload <dataset_name> <username>/<repo_name>

Original source

This story was published by Hugging Face Blog. SyncAI.news shows a preview; the complete article is on the publisher's site.

Read the full story on huggingface.co

Similar News