一、启动 rasa 服务
启动 rasa
服务,其api接口及返回为
{
"intent": {
"name": "restaurant_search",
"confidence": 0.391780148893826
},
"entities": [
{
"entity": "food",
"value": "火锅",
"start": 2,
"end": 5,
"confidence": null,
"extractor": "ner_mitie",
"processors": [
"ner_synonyms"
]
}
],
"intent_ranking": [
{
"name": "restaurant_search",
"confidence": 0.391780148893826
},
{
"name": "affirm",
"confidence": 0.20622648487184436
},
{
"name": "medical",
"confidence": 0.18946717243538233
},
{
"name": "greet",
"confidence": 0.1062720709536873
},
{
"name": "goodbye",
"confidence": 0.10625412284526019
}
],
"text": "我想吃火锅啊"
}
二、botpress使用第 3 方 NLU
1. nlu配置
data/global/config/nlu.json
{
"$schema": "../../../assets/modules/nlu/config.schema.json",
"intentsDir": "./intents",
"entitiesDir": "./entities",
"modelsDir": "./models",
"provider": "rasa",
"debugModeEnabled": true,
"minimumConfidence": 0.3,
"maximumConfidence": 100,
"rasaEndpoint": "http://localhost:5000",
"rasaProject": "nlu",
"luisAppRegion": "westus",
"maximumRequestsPerHour": 1000
}
rasaEndpoint
: rasa 服务
rasaProject
:模型名称?(不确定) 貌似无关
2. hook
将示例文件中的 global/examples/examples/hooks/before_incoming_middleware/06_rasa_nlu.js
移到 global/hooks/before_incoming_middleware/06_rasa_nlu.js
,并修改
修改 rasa 配置,开启意图识别和实体识别
3. 重启botpress
问题
问题:不支持模型训练,语言好像有问题,请关注后续
官方文档:https://botpress.com/docs/nlu/3rd-party-NLU
论坛:https://forum.botpress.com/
https://forum.botpress.com/t/connect-botpress-with-rasa-nlu/1565
https://forum.botpress.com/t/rasa-nlu-not-working-on-messenger-channel/4900
https://forum.botpress.com/t/404-response-when-integrate-with-rasa-nlu/992