When you flag an example, Prodigy will add "flagged": True to the annotation example. So you could write a script that gets the examples in a dataset and filters out examples that have "flagged" set to True. For example:
from prodigy.components.db import connect
db = connect()
examples = db.get_dataset("your_dataset")
filtered_examples = [eg for eg in examples if not eg.get("flagged")]
You could then save out the filtered examples to a JSONL file, or use db.add_dataset and db.add_examples to create a new dataset and add the filtered examples to it. You can find more details on the available database methods in the “Database” section of your PRODIGY_README.html.
Sorry, that was a typo in my example – I meant the get_dataset method that takes the name of a dataset and returns the examples. Just edited the code in my previous post.
Yes, Database.get_examples is the method that gets individual examples from a list of example IDs. Database.get_dataset gets all examples in a dataset, given the dataset ID.