1

I have been trying to use rasa_nlu instead of native botpress nlu.

Here is my code. data/global/hooks/01_ras_nlu.js

const axios = require('axios') 
const eventTypes = ['text'] // Process only ‘text’ events
async function rasaExtract() {
if (eventTypes.includes(event.type)) {
      const { data } = await axios.post('http://localhost:5000/parse',{ q: event.preview }
   )
if (data) {
/** TODO Here you will need to manipulate the format of these objects so that they use the same 
  format as Botpress NLU */
event.nlu = event.nlu || {}
event.nlu.intent = {};
  if(data.intent.name)
    event.nlu.intent.name = data.intent.name;
  else
    event.nlu.intent.name = 'none';
    event.nlu.intent.confidence = 1.0;
// Disable Native NLU

 event.setFlag(bp.IO.WellKnownFlags.SKIP_NATIVE_NLU, true)
   }
  }
}
return rasaExtract()

I rewrite the nlu.json file 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": "botpress",
  "confidenceTreshold": 0.7,
  "ducklingURL": "https://duckling.botpress.io",
  "ducklingEnabled": true
}

I really confused with "rasaProject": "botpress", what should be the value of rasaProject? is it model folder?

I started rasa using below commands

 python -m rasa_nlu.train --data data/Data.json  --config config_spacy.json 
 python -m rasa_nlu.server --config config_spacy.json  --path models/

And i run botpress using ./bp

 Created a new chat bot. and tried  to communicate with chatbot, when i type `hi` in chat, i getting 
response in `data` field in *data/global/hooks/01_ras_nlu.js* . But not getting any response from chat bot in chat.

How can i resolve this?

KbiR
  • 4,047
  • 6
  • 37
  • 103

1 Answers1

0

Please try to call this endpoint. This should give you an output like this

{
  "available_projects": {
    "my_restaurant_search_bot" : {
      "status" : "ready",
      "available_models" : [
        <model_XXXXXX>,
        <model_XXXXXX>
      ]
    }
  }
}

Each key in available_projects is a project name. You probably should have only one. Use this for the request to /parse. Also it would be useful if you could share the NLU logs for further debugging. The community in the Rasa forum might also be able to help you.

Tobias
  • 1,880
  • 11
  • 17
  • Can you please look at [this](https://stackoverflow.com/questions/56819726/how-to-get-json-object-in-botpress-custom-component) question? Thanks. – AabinGunz Jun 30 '19 at 12:18