# Invalid JSON on line 1 in the patterns file

**URL:** <https://support.prodi.gy/t/invalid-json-on-line-1-in-the-patterns-file/3670>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [November 25, 2020, 4:47pm UTC](https://support.prodi.gy/t/invalid-json-on-line-1-in-the-patterns-file/3670 "2020-11-25T16:47:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksei](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksei](https://support.prodi.gy/u/Aleksei)\
**Post date:** [November 25, 2020, 4:47pm UTC](https://support.prodi.gy/t/invalid-json-on-line-1-in-the-patterns-file/3670/1 "2020-11-25T16:47:13Z")

</div>

I've created the patterns file using:

**python -m prodigy terms.to-patterns relatives\_terms --label RELATIVES --spacy-model blank:en \> ./relatives\_patterns.jsonl**

If I start with manual NER annotation by

**python -m prodigy ner.manual relatives\_data blank:en ./relatives\_sample.jsonl --label RELATIVES --patterns ./relatives\_patterns.jsonl**

I'll get an error:

ValueError: Invalid JSON on line 1: {"label":"RELATIVES","pattern":[{"lower":"aunt"}]}

---

<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:** [November 26, 2020, 12:42am UTC](https://support.prodi.gy/t/invalid-json-on-line-1-in-the-patterns-file/3670/2 "2020-11-26T00:42:10Z")

</div>

Hi! That's strange, the example JSON looks fine and under the hood, `terns.to-patterns` just calls `json.dumps`. How does the whole JSONL file look? Any weird line endings or something like that?

---

<div class="post-metadata">

**Author:** ![Aleksei](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksei](https://support.prodi.gy/u/Aleksei)\
**Post date:** [November 26, 2020, 9:15am UTC](https://support.prodi.gy/t/invalid-json-on-line-1-in-the-patterns-file/3670/3 "2020-11-26T09:15:25Z")

</div>

Hi, Ines! I had the encoding issue. The `terms.to-patterns` created the file not encoded in "UTF-8" (аlthough ` python -c 'import sys; print(sys.getdefaultencoding())` returns utf-8 ). I had changed the encoding by Notepad++ then I got "Invalid JSON" error. Now I'm doing it in another way and it works for me.  
Thanks!
