uhasd
July 19, 2022, 3:47pm
1
Hey all!
Is there a way to get the Controller
's validate_answer
function to return the ?session=
value?
Like how the before_db
function returns _session_id
.
hi @uhasd !
It seems like your goal is to get the session_id
within a recipe, right? Have you seen these posts?
Hi! The session ID is only assigned when a user opens the app and makes a request to the server requesting a new batch of questions. There's not currently an in-recipe way to access it, because it's only available once the stream is already executing. So if you want fine-grained control like this within the recipe script, you'd currently have to use separate instances of Prodigy with different datasets, or the same dataset and sessions / annotator names / etc. set via the command line. This thre…
Ah, so if I understand the use case correctly, you want to attach additional meta info to the data you're annotating that's preserved when you merge datasets?
Recipes support a get_session_id function that was initially added to override the default timestamp session IDs (e.g. if you're starting Prodigy instances programmatically and end up with multiple sessions per second). So in a custom recipe, you could add a command-line argument for the annotator name and then
"get_session_id": lambda: …
Let me know if this answers your question.
uhasd
July 20, 2022, 11:10am
3
So the only way to go about this is to have separate instances?