Prodigy-HF Integration Release Notes

Explosion has introduced Prodigy-HF, a plugin that integrates the Prodigy annotation tool with the Hugging Face ecosystem. This integration allows users to fine-tune transformer models directly from annotated data and publish datasets to the Hugging Face Hub, streamlining the workflow between data labeling and model training.

Model Training and Reuse

Prodigy-HF enables the training and reuse of Hugging Face models using data annotated within the Prodigy interface. By integrating with the AutoTokenizer and AutoModel classes of the Hugging Face transformers library, the plugin allows any transformer model available on the Hugging Face Hub to be fine-tuned via a single command line interface.

Named Entity Recognition (NER)

Users can fine-tune transformer models for NER tasks using the hf.train.ner recipe. For example, training a distilbert-base-uncased model on a specific dataset is achieved with the following command:

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

Once trained, these models can be used to assist in further annotation through the hf.correct.ner recipe, which displays model predictions directly within the Prodigy interface to accelerate the labeling process.

Text Classification

Similar to the pipeline exists for NER, the plugin supports text classification via the hf.train.textcat recipe:

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

Dataset Publishing to Hugging Face Hub

Prodigy-HF includes a feature to publish annotated datasets directly to the Hugging Face Hub. This allows users to share their bespoke datasets with the wider community to foster collaboration.

The upload process is handled via the following command:

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

Integration Scope and Future Development

Prodigy-HF is designed to support domain-specific and experimental use cases by leveraging the vast array of models and languages available on the Hugging Face Hub. The developers have indicated that additional features for the library are currently in development.

Sources