# Prodigy present text with no matching pattern (ner.manual)

**URL:** <https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777>\
**Category:** Uncategorized\
**Tags:** usage, ner, solved\
**Created:** [April 8, 2020, 8:42pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777 "2020-04-08T20:42:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yw2903](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/yw2903/32/1614_2.png) [@yw2903](https://support.prodi.gy/u/yw2903)\
**Post date:** [April 8, 2020, 8:42pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/1 "2020-04-08T20:42:25Z")

</div>

Hello,

I'm using the command

prodigy ner.manual XXX en\_core\_web\_sm XXX.jsonl --label ORG,PERSON,DATE --patterns ./pattern.jsonl

to annotate docs that have matching patterns. However, Prodigy interface keeps giving me texts with no matching patterns at all.

![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/7/7a0039040fa1aa007aa0475846c5759eba5140d7.png)

---

<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:** [April 8, 2020, 9:22pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/2 "2020-04-08T21:22:48Z")

</div>

Hi! This behaviour is intentional for `ner.manual`, because patterns are typically used to help pre-label examples. In that case, it's important to also show examples with no pattern matches, because those could either still be containing other entities you want to assign, or no entities at all, in which case you also want to include that example in your training data.

If you just want to select examples based on the matches they contain, maybe the generic binary [`match` recipe](https://prodi.gy/docs/recipes#match) is a better fit for your use case. Or, if you want a manual labelling workflow that only shows you examples containing matches, you could use your own version of the `ner.manual` recipe and set `all_examples=False` when [initializing the `PatternMatcher`](https://prodi.gy/docs/api-components#patternmatcher-init). This will only show examples containing pattern matches and filter out everything else.

---

<div class="post-metadata">

**Author:** ![yw2903](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/yw2903/32/1614_2.png) [@yw2903](https://support.prodi.gy/u/yw2903)\
**Post date:** [April 9, 2020, 4:01pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/3 "2020-04-09T16:01:57Z")

</div>

Thanks Ines. However, I'm unable to modify the source file, nor can I replace a with a new file. So how can I use my custom recipe?

---

<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:** [April 9, 2020, 4:54pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/4 "2020-04-09T16:54:26Z")

</div>

Check out the docs on custom recipes here: [https://prodi.gy/docs/custom-recipes](https://prodi.gy/docs/custom-recipes)  
You can use this example recipe of `ner.manual` as a template: [https://github.com/explosion/prodigy-recipes/blob/master/ner/ner\_manual.py](https://github.com/explosion/prodigy-recipes/blob/master/ner/ner_manual.py)

(In general, it should be no problem to modify the installed source btw. It's maybe not a best practice and not as clean as using a custom recipe, but it's possible if you just want to try something out. You can run `prodigy stats` to find the location of your Prodigy installation and the recipes are included in `prodigy/recipes`.)

---

<div class="post-metadata">

**Author:** ![yw2903](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/yw2903/32/1614_2.png) [@yw2903](https://support.prodi.gy/u/yw2903)\
**Post date:** [April 10, 2020, 10:38pm UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/5 "2020-04-10T22:38:56Z")

</div>

I try to use the command

python -m prodigy -F XXX/ner\_teach.py

but got the following error.

![image](https://us1.discourse-cdn.com/flex020/uploads/prodigy/original/2X/a/af3623e4cd3c75ba8bab2cea407a165a75053969.png)

I'm very confident the path to ner\_teach.py is valid.

---

<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:** [April 12, 2020, 10:54am UTC](https://support.prodi.gy/t/prodigy-present-text-with-no-matching-pattern-ner-manual/2777/6 "2020-04-12T10:54:17Z")

</div>

> [@yw2903](#):
>
> ```python
> python -m prodigy -F XXX/ner_teach.py
> 
> ```

You need to also tell it which recipe to load after `prodigy` and the arguments of the recipe, if available. Otherwise, Prodigy won't know what to do and what to load from your file. See the custom recipe example [here](https://prodi.gy/docs/custom-recipes#writing) that shows the recipe vs. how it's called.

So in your case, that could look something like this (depending on what arguments your reicpe takes):

```bash
python -m prodigy [name of your recipe] [recipe arguments] -F XXX/ner_teach.py

```
