Skip to content

Commit

Permalink
Merge pull request #7160 from RasaHQ/dialogflow-training-data
Browse files Browse the repository at this point in the history
Adapt the training data reader and emulator for DialogFlow to their latest format
  • Loading branch information
rasabot authored Nov 5, 2020
2 parents 8625d48 + 3fb355a commit 26884fe
Show file tree
Hide file tree
Showing 30 changed files with 348 additions and 332 deletions.
3 changes: 3 additions & 0 deletions changelog/7160.improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Adapt the [training data reader and emulator for DialogFlow](migrate-from/google-dialogflow-to-rasa.mdx) to
[their latest format](https://cloud.google.com/dialogflow/es/docs/reference/rest/v2/DetectIntentResponse)
and add support for regex entities.
30 changes: 26 additions & 4 deletions data/examples/dialogflow/agent.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"description": "",
"language": "en",
"shortDescription": "",
"examples": "",
"linkToDocs": "",
"disableInteractionLogs": false,
"disableStackdriverLogs": true,
"googleAssistant": {
"googleAssistantCompatible": false,
"project": "rasanlu-development",
Expand All @@ -10,23 +15,40 @@
"endIntentIds": [],
"oAuthLinking": {
"required": false,
"providerId": "",
"authorizationUrl": "",
"tokenUrl": "",
"scopes": "",
"privacyPolicyUrl": "",
"grantType": "AUTH_CODE_GRANT"
},
"voiceType": "MALE_1",
"capabilities": [],
"protocolVersion": "V2"
"env": "",
"protocolVersion": "V2",
"autoPreviewEnabled": false,
"isDeviceAgent": false
},
"defaultTimezone": "Asia/Hong_Kong",
"webhook": {
"url": "",
"username": "",
"headers": {},
"available": false,
"useForDomains": false,
"cloudFunctionsEnabled": false,
"cloudFunctionsInitialized": false
},
"isPrivate": true,
"customClassifierMode": "use.after",
"mlMinConfidence": 0.3,
"supportedLanguages": [
"es"
]
}
],
"enableOnePlatformApi": true,
"onePlatformApiVersion": "v2",
"analyzeQueryTextSentiment": false,
"enabledKnowledgeBaseNames": [],
"knowledgeServiceConfidenceAdjustment": 0.0,
"dialogBuilderMode": false,
"baseActionPackagesUrl": ""
}
6 changes: 4 additions & 2 deletions data/examples/dialogflow/entities/cuisine.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"name": "cuisine",
"isOverridable": true,
"isEnum": false,
"automatedExpansion": false
}
"isRegexp": false,
"automatedExpansion": false,
"allowFuzzyExtraction": false
}
2 changes: 1 addition & 1 deletion data/examples/dialogflow/entities/cuisine_entries_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"india"
]
}
]
]
2 changes: 1 addition & 1 deletion data/examples/dialogflow/entities/cuisine_entries_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"india"
]
}
]
]
9 changes: 9 additions & 0 deletions data/examples/dialogflow/entities/flightNumber.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "fc93d510-e240-4b71-bafe-7dd7a3303e79",
"name": "flightNumber",
"isOverridable": true,
"isEnum": false,
"isRegexp": true,
"automatedExpansion": false,
"allowFuzzyExtraction": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"value": "flight [A-Z]{2} [0-9]{4}",
"synonyms": [
"flight [A-Z]{2} [0-9]{4}"
]
}
]
6 changes: 4 additions & 2 deletions data/examples/dialogflow/entities/location.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"name": "location",
"isOverridable": true,
"isEnum": false,
"automatedExpansion": false
}
"isRegexp": false,
"automatedExpansion": false,
"allowFuzzyExtraction": false
}
2 changes: 1 addition & 1 deletion data/examples/dialogflow/entities/location_entries_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"north"
]
}
]
]
2 changes: 1 addition & 1 deletion data/examples/dialogflow/entities/location_entries_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
"norte"
]
}
]
]
23 changes: 15 additions & 8 deletions data/examples/dialogflow/intents/Default Fallback Intent.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
"parameters": [],
"messages": [
{
"type": 0,
"type": "0",
"title": "",
"textToSpeech": "",
"lang": "es",
"speech": [
"Ups, no he entendido a que te refieres.",
"¿Podrías repetirlo, por favor?",
"¿Disculpa?",
"¿Decías?",
"¿Cómo?"
]
],
"condition": ""
},
{
"type": 0,
"type": "0",
"title": "",
"textToSpeech": "",
"lang": "en",
"speech": [
"I didn\u0027t get that. Can you say it again?",
Expand All @@ -37,17 +42,19 @@
"Say that again?",
"I didn\u0027t get that.",
"I missed that."
]
],
"condition": ""
}
],
"defaultResponsePlatforms": {},
"speech": []
}
],
"priority": 500000,
"webhookUsed": false,
"webhookForSlotFilling": false,
"lastUpdate": 1507539905,
"fallbackIntent": true,
"events": []
}
"events": [],
"conditionalResponses": [],
"condition": "",
"conditionalFollowupEvents": []
}
28 changes: 20 additions & 8 deletions data/examples/dialogflow/intents/affirm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,40 @@
"responses": [
{
"resetContexts": false,
"action": "",
"affectedContexts": [],
"parameters": [],
"messages": [
{
"type": 0,
"type": "0",
"title": "",
"textToSpeech": "",
"lang": "es",
"speech": "Me alegro de ayudarte, compañero :)"
"speech": [
"Me alegro de ayudarte, compañero :)"
],
"condition": ""
},
{
"type": 0,
"type": "0",
"title": "",
"textToSpeech": "",
"lang": "en",
"speech": "Glad I help you, mate :)"
"speech": [
"Glad I help you, mate :)"
],
"condition": ""
}
],
"defaultResponsePlatforms": {},
"speech": []
}
],
"priority": 500000,
"webhookUsed": false,
"webhookForSlotFilling": false,
"lastUpdate": 1507540481,
"fallbackIntent": false,
"events": []
}
"events": [],
"conditionalResponses": [],
"condition": "",
"conditionalFollowupEvents": []
}
9 changes: 8 additions & 1 deletion data/examples/dialogflow/intents/affirm_usersays_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -21,6 +22,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -33,6 +35,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -45,6 +48,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -57,6 +61,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -69,6 +74,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
},
{
Expand All @@ -81,6 +87,7 @@
],
"isTemplate": false,
"count": 0,
"lang": "en",
"updated": 0
}
]
]
23 changes: 15 additions & 8 deletions data/examples/dialogflow/intents/affirm_usersays_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "9dg52d2a-dbf2-44e7-bc55-0eee5a6a8a14",
Expand All @@ -21,7 +22,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "9dg52d2a-dbf2-44e7-bc55-0eee5a6a8a24",
Expand All @@ -33,7 +35,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "7a11df78-3b06-48c3-9aa4-9f779c23fb0b",
Expand All @@ -45,7 +48,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "e6238a3e-3dcd-4932-9034-1a05f037d4e3",
Expand All @@ -57,7 +61,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "64cc393a-f9c9-4521-9052-543f99fcd97e",
Expand All @@ -69,7 +74,8 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
},
{
"id": "0f4a932a-c929-47d4-8cb2-5095882f40a0",
Expand All @@ -81,6 +87,7 @@
],
"isTemplate": false,
"count": 0,
"updated": 1507540481
"lang": "es",
"updated": 0
}
]
]
Loading

0 comments on commit 26884fe

Please sign in to comment.