JSON file not working properly

Hi!
I converted my .csv file with text data in it to a json file online and saved it as .json. I tried to load it into prodigy which worked perfectly (i used one of your recipe examples just to test it out). I did not get an error message and I can open the browser and see the annotation labels, etc. However, it does not show any sentences :hear_no_evil: So i don't know what to annotate haha

My Json file looks like that (just showing you an example so you can imagine what I am talking about):
[
{"Text": "This is one sentence. Then comes another. and another"
},
{"Text": "This would be the second feedback". It has several sentences in it as well"
}
]

What could be the problem? Does it have to do something with my data consisting of several sentences per case? Otherwise, how would it work to load in the CSV file?
(I tried that out as well but it did not work either --> Changed JSON to CSV in the recipe, changed the file ending to .csv instead of json and in my csv file i had a column named "Text". I received an error like that:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 8: invalid continuation byte)

Do you know how to solve this?
Thanks!

Hi! The JSON format looks fine (only that you want the keys to be "text" instead of "Text").

It sounds like there might be a problem with the file encoding. If you google something like "change file encoding utf8" plus your operating system, you should find instructions to check whether your file is UTF-8 and how to change the encoding if it's not.

1 Like

Hi, thanks for your answer.
I checked my file and it wasn't saved as UTF-8 CSV. I did that now but getting the following error now:
✘ Error while validating stream: no first example
This likely means that your stream is empty.

I also adapted the "Text" to "text"..doesn't do any change.
Do you have some other options to try?

Sorry i forgot to specify: i adapted the "Text" in "text" in my JSON file :smiley:

So how does your CSV file look? You either want to have a CSV file with a column Text or text containing the text, or a JSON-formatted file with a list of objects that each have a "text" key.

You can find examples of the different formats here: https://prodi.gy/docs/api-loaders#input

If you see the "no first example" error, it means that there were no examples available – either because none could be loaded from the file or because all examples have already been annotated and are in the dataset, or because there's no example that is sent out by the recipe (e.g. if your recpe filters the examples).