Many thanks for soon reply and advices, Ines,
I have 1.10.7
version of Prodigy. Your command with -
argument worked fine for me.
Yes, my labels are hierarchical, So, I'll act as you recommended.
Many thanks for soon reply and advices, Ines,
I have 1.10.7
version of Prodigy. Your command with -
argument worked fine for me.
Yes, my labels are hierarchical, So, I'll act as you recommended.
Hi,
I am using a custom recipe for multi-label text classification.
But I am getting similar issue as "No tasks available" after few annotations.
Could you please check my recipe?
import prodigy
from prodigy.components.loaders import JSONL@prodigy.recipe(
"article_cat",
dataset=("The dataset to save to", "positional", None, str),
file_path=("Path to texts", "positional", None, str),
)
def article_cat(dataset, file_path):
"""Annotate the sentiment of texts using different mood options."""
stream = JSONL(file_path) # load in the JSONL file
stream = add_options(stream) # add options to each task
blocks = [
{"view_id": "html"},
{"view_id": "text"},
{"view_id": "choice", "text": None, "html": None}
]
return {
"dataset": dataset, # save annotations in this dataset
"view_id": "blocks", # set the view_id to "blocks"
"stream": list(stream),
"config": {
"blocks": blocks, # add the blocks to the config
# "html_template": html_temp
}
}def add_options(stream):
# Helper function to add options to every task in a stream
options = [
{"id": "1", "text": "A"},
{"id": "2", "text": "B"},
{"id": "3", "text": "C"},
{"id": "4", "text": "D"}
]for task in stream:
task["options"] = options
yield task