# a question about custom recipe

**URL:** <https://support.prodi.gy/t/a-question-about-custom-recipe/4387>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [July 1, 2021, 12:46pm UTC](https://support.prodi.gy/t/a-question-about-custom-recipe/4387 "2021-07-01T12:46:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [July 3, 2021, 3:11am UTC](https://support.prodi.gy/t/a-question-about-custom-recipe/4387/4 "2021-07-03T03:11:40Z")

</div>

> [@gwd](#):
>
> If I have raw data and patterns, how to automatically create a dataset like one that is saved by the annotation process?

Check out these threads for details:

> [@How to perform automatically NER annotation based on patterns?](https://support.prodi.gy/t/how-to-perform-automatically-ner-annotation-based-on-patterns/4284/2):
>
> Hi! In that case, you can just go directly via spaCy, for example, using the entity ruler: [https://spacy.io/usage/rule-based-matching#entityruler](https://spacy.io/usage/rule-based-matching#entityruler) It lets you add your patterns and will add all matches to the doc.ents, just like an entity recognizer. You can then use that nlp object to process your texts and extract the pattern-based NER annotations. In theory, you don't even have to go through Prodigy at all and you could just export the data and train with spaCy directly. But if you want to mi…

> [@Store the annotation obtained by ner.manual and --patterns at once](https://support.prodi.gy/t/store-the-annotation-obtained-by-ner-manual-and-patterns-at-once/4350/3):
>
> @ines Thanks a lot ! it works now Here I share my experience: My source data is in jsonl format and look like: {"text":"abcd","meta":{"source":"doc1"}} . . I wrote a code (compatible with SpaCy 2.5) based on your explanation to read a set of documents and annotate them based on patterns file: # path of jsonl file contains the performed annotation to be loaded in the db db\_jsonl\_path='db\_jsonl.jsonl' nlp = English() ruler = EntityRuler(nlp) # the patterns file ruler.from\_disk('patterns.…

---

_[View the full topic](https://support.prodi.gy/t/a-question-about-custom-recipe/4387)._
