Hi
I am trying to set-up an annotation recipe for question answering database.
The annotation UI crashes after I select some tokens int the paragraph. with "Oops, something went wrong :(".
I use Prodigy 1.9.10.
The web console shows this stack trace:
TypeError: "items is null"
p http://question.tukekemt.xyz/bundle.js:1
h http://question.tukekemt.xyz/bundle.js:1
value http://question.tukekemt.xyz/bundle.js:1
s http://question.tukekemt.xyz/bundle.js:1
beginWork http://question.tukekemt.xyz/bundle.js:1
r http://question.tukekemt.xyz/bundle.js:1
i http://question.tukekemt.xyz/bundle.js:1
a http://question.tukekemt.xyz/bundle.js:1
k http://question.tukekemt.xyz/bundle.js:1
x http://question.tukekemt.xyz/bundle.js:1
batchedUpdates http://question.tukekemt.xyz/bundle.js:1
lt http://question.tukekemt.xyz/bundle.js:1
$t http://question.tukekemt.xyz/bundle.js:1
bundle.js:1:652962
s http://question.tukekemt.xyz/bundle.js:1
a http://question.tukekemt.xyz/bundle.js:1
k http://question.tukekemt.xyz/bundle.js:1
x http://question.tukekemt.xyz/bundle.js:1
batchedUpdates http://question.tukekemt.xyz/bundle.js:1
lt http://question.tukekemt.xyz/bundle.js:1
$t http://question.tukekemt.xyz/bundle.js:1
I use this recipe:
import prodigy
from prodigy.components.loaders import JSONL
from prodigy.util import split_string
from collections import Counter
from typing import List, Optional
@prodigy.recipe(
"question",
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 question(dataset: str, source: str, exclude: Optional[List[str]] = None):
stream = JSONL(source)
return {
"view_id": "blocks", # Annotation interface to use
"config": {
"exclude_by": "input",
"blocks": [
{
"view_id": "ner_manual",
"labels": ["Vyznačte odpoveď"],
},
{
"view_id": "text_input",
"field_rows": 1,
"field_autofocus":True,
"field_label": "Čo Vás zaujíma?",
"field_placeholder": "Napíšte otázku...",
"text":None
},
{
"view_id":"classification",
"text":None
},
]
},
"dataset": dataset, # Name of dataset to save annotations
"stream": stream, # Incoming stream of examples
}
One task has the following attributes:
- field_id: task identification
- label: heading for paragraph
- text: paragraph to annotate
- tokens: list of tokens (start, end, text)
Where is the error and is there some workaround?
Thanks
Daniel