allows you to override the default Prodigy config.Finally, add all these components to a stack and set it as your active stack. For example:

zenml stack copy default annotation

zenml stack update annotation -an prodigy

zenml stack set annotation

# optionally also

zenml stack describe

Now if you run a simple CLI command like zenml annotator dataset list this should work without any errors. You're ready to use your annotator in your ML workflow!

How do you use it?

With Prodigy, there is no need to specially start the annotator ahead of time like with Label Studio. Instead, just use Prodigy as per the Prodigy docs and then you can use the ZenML wrapper / API to get your labelled data etc using our Python methods.

ZenML supports access to your data and annotations via the zenml annotator ... CLI command.

You can access information about the datasets you're using with the zenml annotator dataset list. To work on annotation for a particular dataset, you can run zenml annotator dataset annotate <DATASET_NAME> <CUSTOM_COMMAND>. This is the equivalent of running prodigy <CUSTOM_COMMAND> in the terminal. For example, you might run:

zenml annotator dataset annotate your_dataset --command="textcat.manual news_topics ./news_headlines.jsonl --label Technology,Politics,Economy,Entertainment"

A common workflow for Prodigy is to annotate data as you would usually do, and then use the connection into ZenML to import those annotations within a step in your pipeline (if running locally). For example, within a ZenML step:

from typing import List, Dict, Any

from zenml import step

from zenml.client import Client

@step

def import_annotations() -> List[Dict[str, Any]:

zenml_client = Client()

annotations = zenml_client.active_stack.annotator.get_labeled_data(dataset_name="my_dataset")

# Do something with the annotations

return annotations