Using Prodigy 1.9. The custom classify recipe below servers the content just fine, but the labels are not showing up.
def _xml_to_conversations(source):
...
def _doc_as_json(doc, keys=[TEXT, TOKENS]):
return {key: doc.to_json().get(key) for key in keys}
def _get_tasks(source, model):
nlp = spacy.load(model)
conversations = _xml_to_conversations(source)
for conversation in conversations:
doc = nlp(conversation.content)
yield _doc_as_json(doc)
@prodigy.recipe(
'classify',
dataset = ('Dataset', 'positional', None, str),
model = ('Model', 'positional', None, str),
source = ('Source', 'positional', None, str)
)
def classify(dataset, model, source):
return{
"dataset": dataset,
"stream": _get_tasks(source, model),
"view_id": "classification",
"config": {"labels": ["Positive", "Negative"]}
}
@prodigy.recipe(
'relations',
dataset = ('Dataset', 'positional', None, str),
model = ('Model', 'positional', None, str),
source = ('Source', 'positional', None, str)
)
def relations(dataset, model, source):
return {
DATASET: dataset,
STREAM: _get_tasks(source, model),
VIEW_ID: NER_MANUAL,
CONFIG: {LABELS: RELATIONAL_LABELS}
}
When i try the relations recipe above, which invokes the ner_manual view_id, the web page serves up an oops:
Oops, something went wrong
You might have come across a bug in Prodigy's web app – sorry about that. We'd love to fix this, so feel free to open an issue on the Prodigy Support Forum and include the steps that led to this message.
Any help appreciated.