Hi, I have the following code but can't seem to get text to hide:
@prodigy.recipe( # type: ignore
"asset.txtcat",
label=Arg("--label", "-L", help="What label to use on classification", converter=lambda v: v.lower()),
key=Arg("--key", "-K", help="See enum member of the Concept asset type."),
)
def asset_txtcat(label: str, key: str):
blocks = [
{"view_id": "spans_manual"},
{"view_id": "choice", "text": None},
]
dataset = f"is-{label}"
span_labels = ["concept"]
def add_option(stream):
for ex in stream:
ex["options"] = [{"id": label, "text": f"Is this classified as {label}?"}]
yield ex
asset = Selection(key=key).asset
stream = get_stream(asset.stream())
stream = add_tokens(asset.nlp, stream)
stream = add_option(stream)
return {
"view_id": "blocks",
"dataset": dataset,
"stream": stream,
"config": {
"lang": asset.nlp.lang,
"labels": span_labels,
"blocks": blocks,
"choice_auto_accept": True,
},
}
This sort of resembles the tutorial code and I see it follows the answer found in a previous question. The texts appear regardless if I make both text
keys = None
.
blocks = [
{"view_id": "spans_manual", "text": None},
{"view_id": "choice", "text": None},
]
Also happens with the classification view_id, e.g.:
# remove `add_option`()`, replace `blocks =...` with
blocks = [{"view_id": "spans_manual"}, {"view_id": "classification"}]
I tried manipulating the text to determine if text length / weird characters affected the display but I think I've ruled these factors out.
Hoping for some direction, thanks!