I have been trying to use the following recipe .py file to set up a multi-question annotation task. Although I don't face an error on terminal and the local host address is generated, when I open my localhost I keep seeing the error in the attached image. Does anyone know how to resolve this error "TypeError: Cannot use 'in' operator to search for 'reject' in undefined"? Thank you so much
Here is the recipe.py file:
import prodigy
from prodigy.components.loaders import JSONL
@prodigy.recipe(
"multi_question",
dataset=("The dataset to save annotations", "positional", None, str),
file_path=("Path to the JSONL data", "positional", None, str),
)
def multi_question(dataset, file_path):
# Load the data from the JSONL file
stream = JSONL(file_path)
return {
"dataset": dataset, # The dataset to save annotations
"view_id": "blocks", # Use "blocks" to combine multiple interfaces
"stream": stream, # Stream the data from the JSONL file
"config": {
"blocks": [
{
"view_id": "text", # Show the text first
"text_field": "text"
},
{
"view_id": "choice", # The first question is a multiple choice
"question": "What is the sentiment of this text?",
"choices": [
{"id": "positive", "label": "Positive"},
{"id": "neutral", "label": "Neutral"},
{"id": "negative", "label": "Negative"}
]
},
{
"view_id": "choice", # The second question, also multiple choice
"question": "Is this a question or a statement?",
"choices": [
{"id": "question", "label": "Question"},
{"id": "statement", "label": "Statement"}
]
},
{
"view_id": "text_input", # Third question for free-form text input
"question": "Any additional comments?",
"field_rows": 3 # Number of rows for the input field
}
]
}
}
Here is the error I see: