Unexpected character in found when decoding object value

(Cailleaud) #1


Prodigy 1.7 work fine with Sqlite, but when i try with Postgres, i have this error :

Traceback (most recent call last):
File “/produit/anaconda/anaconda353/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/produit/anaconda/anaconda353/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/produit/anaconda/anaconda353/lib/python3.7/site-packages/prodigy/main.py”, line 331, in
controller = recipe(*args, use_plac=True)
File “cython_src/prodigy/core.pyx”, line 224, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File “cython_src/prodigy/util.pyx”, line 49, in prodigy.util.get_config
File “cython_src/prodigy/util.pyx”, line 469, in prodigy.util.read_json
File “cython_src/prodigy/util.pyx”, line 470, in prodigy.util.read_json
ValueError: Unexpected character in found when decoding object value

What is wrong ?


(Ines Montani) #2

Hi! What command were you running that caused this error?

Based on the message and traceback, it looks like it’s trying to load content from a JSON file, but the file contents aren’t valid JSON. Are you loading in patterns or input data from JSON and if so, did you double check that it’s valid?

I’d be very surprised if this was related to Postgres – the database is really only used to save annotations and is completely separate from any processes that load data etc.


(Cailleaud) #3

I launch this one :
prodigy ner.teach mes_donnees en_core_web_sm phrases.jsonl

and then, my json content (with no linefeed at teh end of the file) :

{“text”: “C’est lundi”}
{“text”: “C’est mardi”}
{“text”: “C’est une belle journée”}
{“text”: “C’est chouette la neige”}
{“text”: “C’est pas vrai”}
{“text”: “Il fait beau”}
{“text”: “C’est noel”}
{“text”: “C’est l’été”}
{“text”: “Il fait beau en été et froid en hiver”}
{“text”: “C’est lundi”}
{“text”: “C’est lundi”}
{“text”: “C’est lundi”}
{“text”: “C’est lundi”}
{“text”: “C’est lundi”}
{“text”: “C’est lundi”}


(Ines Montani) #4

What does your prodigy.json look like? Just checked and pretty sure the error occurs when Prodigy is loading the configuration from JSON. When you added the database details, maybe you accidentally introduced a bug or invalid JSON in your config file?


(Cailleaud) #5

Thank you for your reply. I had a misplaced comma in the prodijy.json for Postgres connection.

Best regards.

1 Like