Hello!
I'm using a custom recipe that combines "view_id": "classification"
with "view_id": "diff"
. In addition, I'm overwriting prodigy.json
to combine view_id: "html".
It worked fine until now.
However, when I save the annotations in the middle and restart the session on the command line, I now see the first task in the source data. Until now, it was displayed from the continuation of the annotated task, but the behavior has changed.
I think it happened after updating to v1.11.0.
Below is my custom recipe
and prodigy.json
. Am I overlooking something?
My custom recipe is simple based on this documentation.
#My custom recipe
import prodigy
from prodigy.components.loaders import JSONL
from prodigy.util import split_string
from typing import List, Optional
@prodigy.recipe(
"anno_diff",
dataset=("The dataset to use", "positional", None, str),
source=("The source data as a JSONL file", "positional", None, str),
label=("One or more comma-separated labels", "option", "l", split_string)
)
def grammar_error(
dataset,
source,
label: Optional[List[str]]
):
stream = JSONL(source)
blocks = [{"view_id": "classification", "text":None},{"view_id": "diff", "text":None}] #Overwritten with prodigy.json
stream = add_options(stream,label)
return {
"stream": stream,
"dataset": dataset,
"view_id": "blocks",
"config": {
"blocks": blocks
}
}
def add_options(stream, label):
for task in stream:
task["label"] = label
yield task
prodigy.json
{
"port": 8011,
"global_css": ".prodigy-content{text-align: left}",
"blocks": [
{
"view_id": "classification",
"text": ""
},
{
"view_id": "diff",
"text": ""
},
{
"view_id": "html",
"html_template": "<small>[original]<br>{{original}}<br>[revised]<br>{{revised}}</small>"
},
{
"view_id": "text_input",
"field_id": "input_anottator_name",
"field_rows": 1,
"field_placeholder":"input comment..."
}
]
}
I used prodigy stats
and prodigy db-out
. I confirmed that the annotation was recorded halfway. However, the annotator is surprised on the screen because the task returns to the beginning.