textcat.teach recipe error

I have an unbalanced dataset with ~500 examples RELEVANT and rest 9500 IRRELEVANT

I am using this prodigy command
prodigy textcat.teach textcat_patent_model blank:en ./WIPO_11-07-2024.jsonl --label RELEVANT --patterns ./RELEVANT_PATTERN.jsonl

This is how the first two lines of WIPO_11-07-2024.jsonl look like
{"text": "HIGH-POWER REPEAT-FREQUENCY SOLID-STATE SWITCH CONTROLLED BY COMBINATION OF OPTICAL AMPLIFICATION AND ELECTRICAL AMPLIFICATION, AND METHOD <p id="p-0001" num="0000">Disclosed are a high-power repeat-frequency solid-state switch controlled by a combination of an optical amplification and an electrical amplification, and a method. The switch includes an optical pulse unit, an optical amplification device, an optical coupling device and a photoelectric semiconductor structure; the photoelectric semiconductor structure takes a photoelectric effect material as a base, and a multi-layer doping structure is manufactured on the photoelectric effect material; the optical pulse unit is configured to output an optical pulse signal to the optical amplification device; the optical amplification device is configured to amplify the optical pulse signal; the optical coupling device is configured to shape and diffuse the amplified optical pulse signal to form an array optical pulse signal; and irradiated by the optical pulse signal, the photoelectric effect material generates photo-induced carriers subjected to a photo-induced linear model amplification and/or a field-induced nonlinear model amplification in the multi-layer doping structure.

H03K", "meta": {"Application Id": "US431466370", "Publication Date": "11.07.2024", "Applicants": "Institute of Fluid Physics, China Academy of Engineering Physics", "Source": "WIPO_11-07-2024"}}
{"text": "VAPOR SEPARATION SYSTEMS AND METHODS <p id="p-0001" num="0000">A vapor separation system including a cooler having an inlet configured to receive an air-oil-water mixture, and an outlet configured to discharge separated oil and water in two different phases of matter. A first sensor is at the outlet of the cooler. A controller is communicatively coupled to the cooler, wherein the controller is configured to receive temperature feedback from the first sensor, and increase or reduce the amount of cooling, with the cooler and based on the temperature feedback, the oil-water mixture to a separation temperature configured to liquefy at least a portion of the oil in the air-oil-water mixture, while maintaining at least a portion of the water in the air-oil-water mixture in a vaporized state.

B01D F01M", "meta": {"Application Id": "US426973547", "Publication Date": "11.07.2024", "Applicants": "GENERAL ELECTRIC COMPANY", "Source": "WIPO_11-07-2024"}}

This is how my patterns file looks like
{"label":"RELEVANT","pattern":[{"lower":"inhibitor"}]}

This is the error I am getting

Using 1 label(s): RELEVANT
Traceback (most recent call last):
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/prodigy/main.py", line 61, in
controller = recipe(args, use_plac=True)
File "cython_src/prodigy/core.pyx", line 329, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/plac_core.py", line 367, in call
cmd, result = parser.consume(arglist)
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/plac_core.py", line 232, in consume
return cmd, self.func(
(args + varargs + extraopts), **kwargs)
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/prodigy/recipes/textcat.py", line 48, in teach
name = add_text_classifier(nlp, label)
File "cython_src/prodigy/models/textcat.pyx", line 48, in prodigy.models.textcat.add_text_classifier
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/spacy/pipeline/textcat_multilabel.py", line 198, in initialize
self._validate_categories(subbatch)
File "/Users/pdas/miniconda3/envs/explosion/lib/python3.10/site-packages/spacy/pipeline/textcat_multilabel.py", line 214, in _validate_categories
raise ValueError(Errors.E851.format(val=val))
ValueError: [E851] The 'textcat' component labels should only have values of 0 or 1, but found value of '0.5'.

Hi @prernadas,

You are using the recipe correctly, I'm actually not reproducing this errors with your inputs (on the latest version of Prodigy)
The error you can see at the end of the traceback is spaCy expecting exclusive labels while what we are giving it is actually the opposite.
For context, even though there's just one label, it's easier to use use spaCy textcat-multilabel with just one label as it handles the negative class under the hood (some more context on it in this post) which is what the recipe does but we're still getting the incompatibility.
Which spaCy version are you running?
Looking at traceback it looks like Prodigy is < 1.12?