Core is unable to connect Nlu

Hello Team,

I am running rasa core and nlu in 2 docker containers. The problem that am facing is when am sending request to http://localhost:5005/webhooks/rest/webhook endpoint am getting the below error in rasa core logs -

2019-03-08 10:37:25 INFO root - Rasa Core server is up and running on http://localhost:5005 2019-03-08 10:37:34 ERROR rasa_core.interpreter - Failed to parse text ‘hi’ using rasa NLU over http. Error: HTTPConnectionPool(host=‘127.0.0.1’, port=5000): Max retries exceeded with url: /parse?model=nlu&project=HCaiConversation&q=hi (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f06935b5be0>: Failed to establish a new connection: [Errno 111] Connection refused’,))

I have mentioned the nlu url in endpoints.yml like below

nlu:

url: "http://127.0.0.1:5000"

NLU is running on 127.0.0.1:5000 .

The same setup was working 1 month back but now am facing this connectivity issue. Can someone help me to resolve this issue ? I have a demo next week… Please let me know if any other files you want to check .

Thanks

sandeep

@sandeepkumarsahoo How do you start up the docker container? using docker-compose?

if you are using docker-compose, instead of 127.0.0.1, use the name of the nlu container as hostname

if you are starting two docker run, then you need to link the containers to create a single network where you can connect to them using the same hostname

I am not using docker-compose . I am running as to individual containers .

if you are starting two docker run, then you need to link the containers to create a single network where you can connect to them using the same hostname. How can i do this ? Can you please help me …

Thanks , Sandeep

docker run --name=rasa_nlu --network=multi-host-network rasa_nlu(your image)
docker run --name=rasa_core --network=multi-host-network rasa_core(your image)

Make sure of using

http://rasa_nlu:500/parse 

Since your container name is now used in the network multi-host-network as the hostname

reference here: docker network connect | Docker Documentation

1 Like

Hi @souvikg10 ,

I have tried by creating a new network but still getting the same issue. I have kept the required rasa files in git. Could you please try to run in your local once?

Thanks & Regards,
Sandeep

I think you missed a zero; should be on port 5000.

1 Like

yeah, sorry it should be on port 5000

1 Like

Yes it worked … Thank you so much @souvikg10

I would recommend using docker-compose when you are working with multiple containers

Yes you are right @souvikg10 . I will try with docker compose.

I have another doubt regarding the threshhold value for nlu and core, Actually my requirement is to reply only those values whose conf. level is more than 90%. So for this I have created a new file policies.yml with the below props:-

policies:

  • name: “FallbackPolicy”
    nlu_threshold: 0.9
    core_threshold: 0.9
    fallback_action_name: “action_default_fallback”

And added --config policies.yml during rasa training like below ;-
RUN python -m rasa_core.train -d domain.yml -s stories.md -o models/dialogue --config policies.yml

Am able to run but the problem is what ever value am passing it always returns default message. I checked with /parse endpoint of NLU ,the same message returns 96% confidence. Could you please check once or do i need to add anything ?

Thanks & Regards,
Sandeep

Perhaps it is the confidence of the actions as well. Maybe it is less than 90%

You can use the /predict API from rasa core to receive the action confidence as well. Check HTTP API documentation

1 Like