textcat.manual "'label' is a required property" error

Thanks for the report – I’ll have a look :+1: This might actually be a bug, because it should work pretty much as you expected: if you provide more than one label, you get a multiple choice interface (most common use case), and if you only add one label, you get the basic classification interface where you accept/reject the single label.

But I think the problem is that the label isn’t correctly added to the stream. Here’s a quick workaround for now – just add this this at the end of the recipe script in recipes/textcat.py:

    def add_label_to_stream(stream, label):
        for eg in stream:
            eg["label"] = label[0]
            yield eg
    
    if has_options:
        stream = add_label_options(stream, label)
    else:
        stream = add_label_to_stream(stream, label)

To find the location of your Prodigy installation, you can run the following command:

python -c "import prodigy; print(prodigy.__file__)"

I’ll also fix this internally and the fix will be included in the next release!

1 Like