# cannot add new recipe

**URL:** <https://support.prodi.gy/t/cannot-add-new-recipe/1267>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [March 4, 2019, 9:29am UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267 "2019-03-04T09:29:02Z")\
**Posts on this page:** 5\
**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 4, 2019, 9:29am UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267/1 "2019-03-04T09:29:02Z")

</div>

Hi,  
I’m trying to add a new receipe to do text tagging and I’ve written (copy-pasted from the example about sentiments) something like:

```python
    import prodigy
from prodigy.components.loaders import JSONL

@prodigy.recipe('superconductor-material-recipe',
                dataset=prodigy.recipe_args['dataset'],
                file_path=("Path to texts", "positional", None, str))
def sentiment(dataset, file_path):
    """Annotate the sentiment of texts using different mood options."""
    stream = JSONL(file_path) # load in the JSONL file
    # stream = add_options(stream) # add options to each task

    return {
        'dataset': dataset, # save annotations in this dataset
        'view_id': 'ner_manual', # use the choice interface
        'stream': stream,
    }

```

Then when trying to import it I got this criptic message:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ prodigy superconductor-material-recipe supercon1 superconductor-material-recipe.py -h

  ✨ ERROR: Can't find recipe or command
  'superconductor-material-recipe'.

```

Any idea?

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 4, 2019, 4:06pm UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267/2 "2019-03-04T16:06:25Z")

</div>

I think the problem here is that you need to use the `-F` option on the command line to point to the recipe file. For example, like this:

```bash
prodigy superconductor-material-recipe supercon1 -F superconductor-material-recipe.py

```

If a recipe path is provided via the `-F` argument, Prodigy will try to load the recipe from that file. If not, it’ll look in the built-in recipes and raise an error if it can’t find a recipe of the given name – which seems to have happened in your case.

---

<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 4, 2019, 11:03pm UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267/3 "2019-03-04T23:03:44Z")

</div>

Hi Ines and thanks for your answer  
I did tried that already and the answer was:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ prodigy superconductor-material-recipe supercon1 -F superconductor-material-recipe.py
usage: prodigy superconductor-material-recipe [-h] dataset file_path
prodigy superconductor-material-recipe: error: the following arguments are required: file_path
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ 

```

The receipt is in the directory:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ ls -lh superconductor-material-recipe.py 
-rw-r--r-- 1 lfoppiano staff 634B Mar 4 18:09 superconductor-material-recipe.py

```

the prodigy version looks correct:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ pip list | grep prodigy
prodigy 1.7.1     
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ 

```

moreover the helper menu doesn’t really have any info about new recipes:

```python
(pyscript) Lucas-MacBook-Pro:prodigy-preprocessing lfoppiano$ prodigy --help

  ✨ Available recipes:
  ner.match, ner.teach, ner.manual, ner.make-gold, ner.eval, ner.eval-ab,
  ner.batch-train, ner.train-curve, ner.print-best, ner.print-stream,
  ner.print-dataset, ner.gold-to-spacy, ner.iob-to-gold

  textcat.teach, textcat.batch-train, textcat.train-curve, textcat.eval,
  textcat.print-stream, textcat.print-dataset

  dep.teach, dep.batch-train, dep.train-curve, compare, pos.teach,
  pos.make-gold, pos.batch-train, pos.train-curve, pos.gold-to-spacy,
  terms.train-vectors, terms.teach, terms.to-patterns, mark, image.manual,
  image.test

  ✨ Available commands:
  dataset, drop, stats, pipe, db-in, db-out

```

Is there a way to get more information from the output response of the application?

Thanks  
Luca

---

<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 4, 2019, 11:55pm UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267/4 "2019-03-04T23:55:28Z")

</div>

I have found a solution, which I’m not sure is the right one…

```python
superconductor-material-recipe supercon1 output.json.text-0.json -F superconductor-material-recipe.py

```

so we have to specify also the text we want to apply our recipe, is that correct?

This bring me to another topic I’ve opened a specific thread for: [prodigy use case for annotation having pre-annotated text](https://support.prodi.gy/t/prodigy-use-case-for-annotation-having-pre-annotated-text/1270)

I have a question though, how should the recipe be modified if I want the single annotations to be shown and corrected? How could I add them in the 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:** [March 5, 2019, 12:30am UTC](https://support.prodi.gy/t/cannot-add-new-recipe/1267/5 "2019-03-05T00:30:20Z")

</div>

> [@lfoppiano](#):
>
> so we have to specify also the text we want to apply our recipe, is that correct?

The recipe can define any arguments that you can then pass through via the command line. This completely up to you. In your custom recipe, you've defined two arguments: the `dataset` and the `file_path`. See here:

```python
@prodigy.recipe('superconductor-material-recipe',
                dataset=prodigy.recipe_args['dataset'],
                file_path=("Path to texts", "positional", None, str))
def sentiment(dataset, file_path):

```

So on the command line, the recipe then expects you to pass in those two arguments.
