KeyError: 'label' When Importing CSV with textcat.manual

Hello, I am a beginner with prodigy and I am trying to learn how to import CSV files with textcat.manual. I am trying to just import a basic csv file with just two labels "Positive,Negative". However I keep getting a "KeyError: 'label'".

Here is the command I used: "C:\Users\yaami>python -m prodigy textcat.manual test_csv --loader csv D:\Downloads\test.csv --label POSITIVE,NEGATIVE"

Here is a snip it of the csv:

1 Like

Hi! Sorry about that – I just tested it and could reproduce the error. It looks like there's an issue in the reader when accessing the title-case versions of the columns – surprised this hasn't come up before! I just fixed it and we'll include it in the next release.

In the meantime, the easiest workaround is to just call your column label instead of Label.

Btw, one thing to keep in mind when using pre-annotated data in textcat.manual: Prodigy will currently re-add the label options or top-level label based on what you define as --label on the CLI and won't use what's defined in the data. So you don't have to actually provide the label column in your CSV.

Yes, thank you this fixed my issue!