# Labels not being served,

**URL:** <https://support.prodi.gy/t/labels-not-being-served/2573>\
**Category:** Uncategorized\
**Tags:** usage, custom\
**Created:** [February 21, 2020, 12:09am UTC](https://support.prodi.gy/t/labels-not-being-served/2573 "2020-02-21T00:09:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Superscope](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/superscope/32/682_2.png) [@Superscope](https://support.prodi.gy/u/Superscope)\
**Post date:** [February 21, 2020, 12:09am UTC](https://support.prodi.gy/t/labels-not-being-served/2573/1 "2020-02-21T00:09:11Z")

</div>

Using Prodigy 1.9. The custom classify recipe below servers the content just fine, but the labels are not showing up.

```python
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.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 21, 2020, 11:55am UTC](https://support.prodi.gy/t/labels-not-being-served/2573/2 "2020-02-21T11:55:52Z")

</div>

Hi! The problem in your `classify` recipe is that the `classification` interface doesn't have any label options it could display – it renders the given content with a `"label"`. See here for examples: [Annotation interfaces · Prodigy · An annotation tool for AI, Machine Learning & NLP](https://prodi.gy/docs/api-interfaces#classification)

If you want to add multiple choice options, you probably want to use the `choice` interface and add a set of `"options"` to your incoming tasks. See here for examples and the data format: [Annotation interfaces · Prodigy · An annotation tool for AI, Machine Learning & NLP](https://prodi.gy/docs/api-interfaces#choice)

> [@Superscope](#):
>
> When i try the relations recipe above, which invokes the ner\_manual view\_id, the web page serves up an oops:

(I assume you're defining the constants like `DATASET`, `LABELS` or `RELATIONAL_LABELS` somewhere else in your file?)

I think the problem here is that you're creating your annotation tasks by calling spaCy's `doc.to_json`. That's an okay way to get a JSON representation of a `Doc` – but it doesn't necessarily match the data Prodigy's interfaces expect.

For instance, your task will have a `"tokens"` property that looks different, which is likely what's causing the problem here. Instead of processing the texts and then converting the doc, you could just make your tasks `{"text": conversation.content}` and then use Prodigy's `add_tokens`  
preprocessor to add `"tokens"` to each task. You can see an example of this here: [https://github.com/explosion/prodigy-recipes/blob/master/ner/ner\_manual.py](https://github.com/explosion/prodigy-recipes/blob/master/ner/ner_manual.py)
