How to include spaCy, MITIE, displaCy or other components

I’m convinced that I’m missing something really basic but I can’t for the life of me figure out why I can’t get spaCy/displaCy or MITIE to work. I couldn’t find this in the documentation either (at least not directly).

For example, when I ran the following command, I got the longer message below and spaCy exited -

docker build -t sample-rasa-core . && docker build -t sample-rasa-action-server -f Dockerfile.actionserver . && docker-compose -f rasa-compose.yml up 
rasa-spacy_1          | usage: rasa [-h] [--version]
rasa-spacy_1          |             {init,run,shell,train,interactive,test,visualize,data,x} ...
rasa-spacy_1          |
rasa-spacy_1          | Rasa command line interface. Rasa allows you to build your own conversational
rasa-spacy_1          | assistants 🤖. The 'rasa' command allows you to easily run most common commands
rasa-spacy_1          | like creating a new bot, training or evaluating models.
rasa-spacy_1          |
rasa-spacy_1          | positional arguments:
rasa-spacy_1          |   {init,run,shell,train,interactive,test,visualize,data,x}
rasa-spacy_1          |                         Rasa commands
rasa-spacy_1          |     init                Creates a new project, with example training data,
rasa-spacy_1          |                         actions, and config files.
rasa-spacy_1          |     run                 Starts a Rasa server with your trained model.
rasa-spacy_1          |     shell               Loads your trained model and lets you talk to your
rasa-spacy_1          |                         assistant on the command line.
rasa-spacy_1          |     train               Trains a Rasa model using your NLU data and stories.
rasa-spacy_1          |     interactive         Starts an interactive learning session to create new
rasa-spacy_1          |                         training data for a Rasa model by chatting.
rasa-spacy_1          |     test                Tests Rasa models using your test NLU data and
rasa-spacy_1          |                         stories.
rasa-spacy_1          |     visualize           Visualize stories.
rasa-spacy_1          |     data                Utils for the Rasa training files.
rasa-spacy_1          |
rasa-spacy_1          | optional arguments:
rasa-spacy_1          |   -h, --help            show this help message and exit
rasa-spacy_1          |   --version             Print installed Rasa version
rasa_rasa-spacy_1 exited with code 0

This is my Docker compose file -

version: '3.4'
services:
  rasa:
    image: sample-rasa-core:latest
    ports:
      - 5005:5005
    command: ["run", "--enable-api", "--cors", " \"*\"", "--verbose"]

  rasa-duckling:
    image: rasa/duckling:latest

  rasa-spacy:
    image: rasa/rasa:latest-spacy-en

  rasa-action-server:
    image: sample-rasa-action-server:latest
    command: ["start", "--actions", "actions", "-vv"]

What am I doing wrong? Many thanks in advance! I’m still fairly new to Rasa and some of the technical setup is a little beyond me.

@ganeshv can i ask where you got this setup from? It seems like you’re running two separate Rasa images, which isn’t necessary. And the reason rasa-spacy isn’t running is because it needs a command to execute when starting. You can take a look at how to configure the docker setup here: Running Rasa with Docker

Hello @akelad - Don’t remember where I had gotten this from, but I had been using this for a while. Since it worked initially, I hadn’t verified the docs recently to validate this. To clarify, the action server should be run under the same rasa image, correct?

What commands do I need to add for spaCy? I’m not sure where to find them. Will they then also be executed as part of the rasa shell nlu command?

Hello @akelad, I finally figured out what you meant by two rasa images; took me a while as I’m super new to Docker. I was able to get spaCy to work and I imagine the same process would apply for MITie and ConveRT components.

On your question about my setup, the setup is based on an optimized build process that I can then run with one command. This was since I need to build actions each time I make changes to the actions.py file.

Here’s one question that I couldn’t figure out though - how does one get displaCy to work?

i’m not sure what you mean with “how does one get displaCy to work” - I think that’s a better questions for the spaCy community, we only use their language models in some of our pipelines

Understood; thank you @akelad!