Display stream length

Is there any method by which I can display the stream length on the UI.
Main purpose of this feature is that if the user wants to know the amount of data he has to annotate.

Yes, this actually just came up in a different thread. Here’s some background on when the stream length is shown vs. when the stream is displayed as infinite:

You can try making the following edit in your recipe:

You can also supply your own custom progress function via the recipe options. This is useful if you want to calculate the remaining examples dynamically (e.g. by checking your database).



Where exactly should this function progress() be added?
If possible, how can I add it in base class ‘Streamer’

The progress can be returned as the 'progress' setting of a custom recipe – just like the dataset, stream, update callback etc. It takes the count of annotated questions in the session and the total annotations in the dataset as its arguments. You can find more details in the “custom recipes” section of your PRODIGY_README.html. Here’s an example:

def progress(session_count, total):
    custom_progress = calculate_your_own_stuff_here()
    return custom progress

In your recipe, you can then return it like this:

return {
    'dataset': dataset,
    # your other settings
    'progress': progress

Prodigy doesn’t really care where that function comes from and what it does – as long as it’s callable, takes the two arguments and returns a float.

1 Like