I have the following custom recipe using blocks to have two label capture elements: 3 point select and a text comment field. My custom recipe is below. Our global prodigy.json file has feed_overlap set to false. We want to build a calibration recipe to let us have all sessions label all tasks. When launching recipe it does not honor the feed overlap setting of TRUE. Am I missing something here?
import random
from typing import List, Optional
import prodigy
from prodigy.components.loaders import JSONL
from prodigy.util import split_string
# Helper functions for adding user provided labels to annotation tasks.
def preprocess_stream(stream):
blocks = [
{"view_id": "choice", "text": None},
{"view_id": "text_input", "field_rows": 2, "field_label": "Optional Notes"},
]
options = [
{"id": "1", "text": "1 - not interesting"},
{"id": "2", "text": "2 - somewhat interesting"},
{"id": "3", "text": "3 - highly interesting"},
]
for task in stream:
task["options"] = options
yield task
# Recipe decorator with argument annotations: (description, argument type,
# shortcut, type / converter function called on value before it's passed to
# the function). Descriptions are also shown when typing --help.
@prodigy.recipe(
"user_post_interest.likert",
dataset=("The dataset to use", "positional", None, str),
source=("The source data as a JSONL file", "positional", None, str),
exclude=("Names of datasets to exclude", "option", "e", split_string),
)
def user_post_interest_likert(
dataset: str,
source: str,
exclude: Optional[List[str]] = None,
):
"""
Manually annotate categories that apply to a text. If more than one label
is specified, categories are added as multiple choice options. If the
--exclusive flag is set, categories become mutually exclusive, meaning that
only one can be selected during annotation.
"""
# Load the stream from a JSONL file and return a generator that yields a
# dictionary for each example in the data.
stream = JSONL(source)
stream = preprocess_stream(stream)
return {
"view_id": "blocks",
"dataset": dataset, # Name of dataset to save annotations
"stream": stream, # Incoming stream of examples
"config": {
"blocks": [
{"view_id": "choice"},
{
"view_id": "text_input",
"field_rows": 2,
"field_label": "Optional notes can be added",
},
],
"choice_style": "single",
"feed_overlap": True,
"exclude_by": "task",
},
}