# Loading annotations

**URL:** <https://support.prodi.gy/t/loading-annotations/1272>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [March 5, 2019, 12:08am UTC](https://support.prodi.gy/t/loading-annotations/1272 "2019-03-05T00:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfoppiano](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lfoppiano/32/683_2.png) [@lfoppiano](https://support.prodi.gy/u/lfoppiano)\
**Post date:** [March 5, 2019, 12:08am UTC](https://support.prodi.gy/t/loading-annotations/1272/1 "2019-03-05T00:08:41Z")

</div>

Dear support,  
still me 🙂

I’m trying to load annotations and I get an error I cannot understand:

this is an example of annotations:

```python
{'text': '(TMTTF) 2 PF 6', 'label': 'supercon', 'spans': [{'start': 58, 'end': 72, 'label': 'supercon'}], 'meta': {'source': 'Semi-automatic generation'}}
{'text': '(TMTTF) 2 PF 6', 'label': 'supercon', 'spans': [{'start': 1150, 'end': 1164, 'label': 'supercon'}], 'meta': {'source': 'Semi-automatic generation'}}

```

copied from [https://prodi.gy/docs/workflow-first-steps#import-annotations](https://prodi.gy/docs/workflow-first-steps#import-annotations)

however I get the following error:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ prodigy db-in supercon1 output.json.annot-0.jsonl 
Traceback (most recent call last):
  File "cython_src/prodigy/components/loaders.pyx", line 145, in prodigy.components.loaders.JSONL
ValueError: Expected object or value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/anaconda3/envs/pyscript/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    " __main__", mod_spec)
  File "/anaconda3/envs/pyscript/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/anaconda3/envs/pyscript/lib/python3.6/site-packages/prodigy/ __main__.py", line 323, in <module>
    plac.call(commands[command], arglist=args, eager=False)
  File "/anaconda3/envs/pyscript/lib/python3.6/site-packages/plac_core.py", line 328, in call
    cmd, result = parser.consume(arglist)
  File "/anaconda3/envs/pyscript/lib/python3.6/site-packages/plac_core.py", line 207, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/anaconda3/envs/pyscript/lib/python3.6/site-packages/prodigy/ __main__.py", line 225, in db_in
    annotations = [set_hashes(eg) for eg in annotations]
  File "/anaconda3/envs/pyscript/lib/python3.6/site-packages/prodigy/ __main__.py", line 225, in <listcomp>
    annotations = [set_hashes(eg) for eg in annotations]
  File "cython_src/prodigy/components/loaders.pyx", line 152, in JSONL
ValueError: Failed to load task (invalid JSON).

{'text': '(TMTTF) 2 PF 6', 'label': 'supercon', 's ... 'meta': {'source': 'Semi-automatic generation'}}

```

The format looks correct to me: JSONL and the internal structure was copied from your example. Do you have perhaps more extended information about it?

Thank you in advance  
Luca

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [March 5, 2019, 12:35am UTC](https://support.prodi.gy/t/loading-annotations/1272/2 "2019-03-05T00:35:21Z")

</div>

> [@lfoppiano](#):
>
> The format looks correct to me: JSONL and the internal structure was copied from your example. Do you have perhaps more extended information about it?

The problem here is that JSON expects quotes to be double quotes: `"`. Your data uses single quotes, which is considered invalid JSON and can't be loaded.

If you come across JSON errors and you're not immediately sure what's wrong, you can also use a JSON validator like [this one](https://jsonlint.com/) or install a plugin for your code editor.

---

<div class="post-metadata">

**Author:** ![lfoppiano](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lfoppiano/32/683_2.png) [@lfoppiano](https://support.prodi.gy/u/lfoppiano)\
**Post date:** [March 5, 2019, 3:14am UTC](https://support.prodi.gy/t/loading-annotations/1272/3 "2019-03-05T03:14:25Z")

</div>

ouch!

I’m so sorry I overlooked … it was written in big characters in the exception 🤦‍♂️
