Dialogflow data conversion not working

We’re trying to import a dialogflow agent into rasa (version 1.0.1) by following this tutorial. However, we’re stuck at the beginning of step 2.

Within the project’s root folder, we have the following directory structure (that’s the most simple bot we tried to import. We get the same result for more complicated ones):

/
  - data/
    - demobot/
      - intents/
        - Default Welcome Intent.json
        - DEFAULT_FALLBACK_INTENT.json
        - TESTIT_INTENT_usersays_de.json
        - TESTIT_INTENT.json
      - agent.json
      - package.json

config.yaml:

language: "de"
pipeline: "pretrained_embeddings_spacy"

policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy

All other files remained unchanged after running rasa init.

When running rasa data convert nlu --data data/demobot --out data/nlu.md --format md we always get the same results for all intents:

- intent examples: 0 (0 distinct intents)
- found intents: 
- entity examples: 0 (0 distinct entities)
- found entities:

The dialogflow agent used here is a very simple one with the following intents:

Here’s the full content of the four intents files:

Default Welcome Intent.json:

{
  "id": "76a1f1a8-b23a-4508-9d6c-9afa55e2e9d1",
  "name": "Default Welcome Intent",
  "auto": true,
  "contexts": [],
  "responses": [
    {
      "resetContexts": false,
      "action": "input.welcome",
      "affectedContexts": [],
      "parameters": [],
      "messages": [
        {
          "type": 0,
          "lang": "de",
          "speech": [
            "Hallo!",
            "Guten Tag!",
            "Ich grüße dich!"
          ]
        }
      ],
      "defaultResponsePlatforms": {},
      "speech": []
    }
  ],
  "priority": 500000,
  "webhookUsed": false,
  "webhookForSlotFilling": false,
  "fallbackIntent": false,
  "events": [
    {
      "name": "WELCOME"
    }
  ]
}

DEFAULT_FALLBACK_INTENT.json:

{
  "id": "55aded02-7942-4abd-b0e8-a8fcc4179c78",
  "name": "DEFAULT_FALLBACK_INTENT",
  "auto": true,
  "contexts": [],
  "responses": [
    {
      "resetContexts": false,
      "action": "input.unknown",
      "affectedContexts": [],
      "parameters": [],
      "messages": [
        {
          "type": 0,
          "lang": "de",
          "speech": [
            "Ich verstehe deine Frage leider nicht.",
            "Entschuldige bitte, ich habe deine Frage nicht verstanden.",
            "Ich bin nicht so sicher, ob ich dich richtig verstanden habe.",
            "Leider kann ich nicht verstehen, was du von mir möchtest.",
            "Kannst du das noch mal anders formulieren?"
          ]
        }
      ],
      "defaultResponsePlatforms": {},
      "speech": []
    }
  ],
  "priority": 500000,
  "webhookUsed": false,
  "webhookForSlotFilling": false,
  "fallbackIntent": true,
  "events": []
}

TESTIT_INTENT_usersays_de:

[
  {
    "id": "cfb33e4a-4052-4fcb-8aeb-c578bf70aca5",
    "data": [
      {
        "text": "los",
        "userDefined": false
      }
    ],
    "isTemplate": false,
    "count": 0,
    "updated": 0
  },
  {
    "id": "c08d9c51-8163-4428-a12a-fa4f5353947b",
    "data": [
      {
        "text": "testit",
        "userDefined": false
      }
    ],
    "isTemplate": false,
    "count": 0,
    "updated": 0
  },
  {
    "id": "e021e3df-9e12-403a-88d7-37d1c268de58",
    "data": [
      {
        "text": "TEST",
        "userDefined": false
      }
    ],
    "isTemplate": false,
    "count": 0,
    "updated": 0
  }
]

TESTIT_INTENT.json:

{
  "id": "b53c81c9-e52b-4d9f-a4f0-b1ead650258c",
  "name": "TESTIT_INTENT",
  "auto": true,
  "contexts": [],
  "responses": [
    {
      "resetContexts": false,
      "affectedContexts": [],
      "parameters": [],
      "messages": [
        {
          "type": 0,
          "lang": "de",
          "speech": []
        }
      ],
      "defaultResponsePlatforms": {},
      "speech": []
    }
  ],
  "priority": 500000,
  "webhookUsed": false,
  "webhookForSlotFilling": false,
  "fallbackIntent": false,
  "events": []
}

Any advise on how to make the import work is very much appreciated.

I guess you are missing some files that end with _usersays_en.json. Maybe take a look at the example in the tutorial: tutorial-migrating-dialogflow-to-rasa/rasa-assistant/data/place_finder/intents at master · RasaHQ/tutorial-migrating-dialogflow-to-rasa · GitHub

Thanks for your reply, Tanja. Does that mean that parsing dialogflow to rasa only works with _usersays_en.js but not with _usersays_de.json? Or that migration will fail completely if not all intents have a matching _usersays_de.json? Because at least TESTIT_INTENT_usersays_de.json exists, but nlu.md remains completely empty.

Thanks again!

You can specify the language in the command, e.g. rasa data convert nlu --data data/demobot --out data/nlu.md --format md --language de. Depending on the language you provide, the parser is looking for _usersays_<language>.json files. Can you maybe try again using the above command including the language?

1 Like

--language de was the missing piece, now it works. Thank you very much for your help! Could this be found in the documentation (if so, would you happen to know where)?

You can find the argument itself here: Command Line Interface. We also have a page around Rasa as open source alternative to Google Dialogflow - Migration Guide, however this is still in an early stage. Feel free to open a PR for adding a section to the migration guide here: rasa/google-dialogflow-to-rasa.rst at master · RasaHQ/rasa · GitHub