Specifying separate streams per session?


I was wondering, is it possible, to specify a list of available session in a recipe config and provide per session streams? I would like to have more fine-grained control over which annotator gets which example (let's say I can distinguish annotators' proficiency and optimize example allocation per session) and I'm looking for something different from having to set up several instances.


Hi! For a scenario where you know upfront which annotator should receive which examples, the easiest solution would be to just start multiple instances of Prodigy on different ports, one per annotator. The multi-user sessions are really designed for situations where you want to send out the data to multiple annotators and whoever is available to do work next.

Because streams are only simple Python generators, there's currently no easy way for Prodigy to pass the session_id of the current annotator back to the stream generator (since it's a generator consumed in batches, not a function). This is something we'd love to change going forward but it'll require a deeper refactor (so it's currently on the list for Prodigy v2).

That said, if you really wanted to, you could probably implement a slightly hacky solution yourself by modifying the get_questions endpoint in the app.py included with Prodigy (run prodigy stats to find the location). This endpoint receives the session ID, and you could then use that to decide what to send out to the given session_id.