Basic question about batch persistence

Hello, I run prodigy with

python -m prodigy ner.manual test_dataset en_core_web_sm test.jsonl --label "LABEL_A, LABEL_B, CAT, DOG"

with a batch size of 4, where test.jsonl consists of:

{"text": "Apples are good and tasty"}
{"text": "Oranges are good and tasty"}
{"text": "Pineapples are good and tasty"}
{"text": "Lemons are good and tasty"}
{"text": "Bananas are good and tasty"}
{"text": "Grapes are vegetables"}
{"text": "Burgers are fruit"}
{"text": "Sandwiches are fruit"}

and whenever I refresh, per session, the batch number seems to iterate (meaning it starts with "apples..." i refresh, then the first item is "bananas...", then I refresh and it returns "No Tasks Available")
Is there a built-in way to prevent this default batch-iterate-on-refresh behaviour and instead have it return the latest batch that hasn't actually been interacted with?

If not, are there any custom recipes I can refer to to help with this sort of thing? We are going to have many sessions labeling data but all datapoints need labels, so at least being able to control the cursor of the data would be ideal.


Hi! I've explained some of this in more detail in this thread:

My post here has a little example of an "infinite stream" that checks the incoming examples against the hashes in the database to make sure everything is annotated:

Of course, you could also come up with your own custom logic for this. Streams in Prodigy are regular Python generators that yield example dicts, so they can respond to external state and let you control what to send out when.

1 Like

Oh perfect - I'm surprised I couldn't find that - apologies and thank you for the resources :smile:

1 Like