Error using ner_duckling_http in pipeline

I have installed duckling using pip and then docker to run the server using

sudo docker run -p 8000:8000 rasa/duckling

The server runs fine:

no port specified, defaulting to port 8000 Listening on http://0.0.0.0:8000

But when running the bot it gives this error

2018-08-07 03:41:40 ERROR    rasa_nlu.extractors.duckling_http_extractor  - Failed to connect to duckling http server. Make sure the duckling server is running and the proper host and port are set in the configuration. More information on how to run the server can be found on github: https://github.com/facebook/duckling#quickstart Error: HTTPConnectionPool(host='duckling', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1589ab8f10>: Failed to establish a new connection: [Errno -2] Name or service not known',))```

@akelad can you please help me in this.

You are running from docker and rasa from where? another docker? keep in mind Docker runs a virtual process that creates it’s own network so if you have two separate running containers on localhost, they are actually running in two different virtualised environment and hence can’t find each other. use --link to provide a network name or use docker-compose to spin them up together( rasa + duckling) this way every container will be able to find each other using the hostname as the container name

No i am running rasa on rasa server on port 5005

Hi @souvikg10 are you sure this works? it seems for @boredomed didn’t resolve this issue.

I have 2 docker containers.

  1. rasa_nlu (docker container) in port 5000
  2. ducklings (docker container) in port 8000

Well I have 4 repos doing the same thing. You can take a look. Github- souvikg10

ERROR    rasa_nlu.extractors.duckling_http_extractor  - Failed to connect to duckling http server. Make sure the duckling server is running and the proper host and port are set in the configuration. More information on how to run the server can be found on github: https://github.com/facebook/duckling#quickstart Error: HTTPConnectionPool(host='178.128.15.202', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6e96d7b150>: Failed to establish a new connection: [Errno 110] Connection timed out',))

can you share your code?

If you are using docker, you need to create one network where both containers(NLU and duckling runs) which is why docker-compose is useful, hence i referred you to my code.

take a look at this file

if you run them under the same network in docker, it will create a network name and then it will be able to find duckling

your config should look like this for duckling

url is the same as the name of the container

@souvikg10 Hi. I’m getting the same error.

The config file is :

pipeline:
- name: tokenizer_whitespace
- name: ner_crf
- name: intent_featurizer_count_vectors
  OOV_token: oov
  token_pattern: (?u)\b\w+\b
- name: intent_classifier_tensorflow_embedding
  epochs: 50
- name: ner_duckling_http
  url: http://localhost:8000
  dimensions:
  - email
  - number
  - amount-of-money
- name: ner_synonyms
language: en

Any help is appreciated. And can you explain what is the use of dimensions?

Did you take a look at the above example?

If you are running duckling in a docker container and rasa in another , use docker-compose

hey @Sayak9495, dimensions are like entity type, whether you want time,date, email,phone number, you can get more details on dimensions here :

and for the error which you are facing is because i think so you haven’t started you duckling server, for more details you can visit :

@JiteshGaikwad , Thanks for help mate. I was not running the duckling server. It’s working now. But I’ve another problem with interactive learning method,


Do you have any idea why that’s happening?

Hi, I am getting the same error while starting up and testing my bot.

But I am not using docker. How do I start up the duckling server?

hi @niharika2298 the above error is due to duckling, you aren’t running your duckling server

Hi. Yeah. How do I run it? I’m unaware of the command.

hey @niharika2298 I haven’t used docker but you can use spacy entity extractor, now spacy too extracts the entity the same way duckling does l, if you want some more information you can refer this link Entity Extraction with spaCy - Sematext