Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document RASA_DUCKLING_HTTP_URL env variable usage #6240

Closed
N-Olbert opened this issue Jul 20, 2020 · 7 comments
Closed

document RASA_DUCKLING_HTTP_URL env variable usage #6240

N-Olbert opened this issue Jul 20, 2020 · 7 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:docs 📖 Improvements to the documenation. Adding missing pieces or improving existing ones.

Comments

@N-Olbert
Copy link

N-Olbert commented Jul 20, 2020

Rasa version: 1.10.7

Python version: 3.7

Operating system (windows, osx, ...): Windows 10 1909

Issue: It seems like the Duckling-URL becomes a hard-coded part of the NLU-Model. Changing the Duckling-URL after training seems to have no effect.

Repro:

  1. Train a model using f. e. http://localhost:8000 as Duckling-URL
  2. Change the URL to f. e. http://localhost:55555 (but DONT retrain the model)
  3. Start the Duckling-server on http://localhost:55555
  4. Run rasa run
  5. See failure after parsing any message

See also: https://forum.rasa.com/t/does-the-duckling-url-become-a-hard-coded-part-of-the-trained-model/31001

Error (including full traceback):

Failed to connect to duckling http server. Make sure the duckling server is running/healthy/not stale 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='localhost', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002BE546C5D48>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte'))

Note: Port 8000 is still used.

Content of configuration file (config.yml) (if relevant): Before

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: "http://localhost:8000"
     dimensions: ["time"]
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3

After

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: "http://localhost:55555" #This is the only change
     dimensions: ["time"]
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3
@N-Olbert N-Olbert added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Jul 20, 2020
@N-Olbert
Copy link
Author

N-Olbert commented Jul 20, 2020

Exalate commented:

N-Olbert commented:

According to the forum, this is defined functionality (see https://forum.rasa.com/t/does-the-duckling-url-become-a-hard-coded-part-of-the-trained-model/31001), so please consider this as an enhancement request rather than a bug.

Not being able to change the port/uri after training is bad because if a customer has already used the Duckling-port which was provided during training there is no way to change this port except to train a new model (which takes some time).

@sara-tagger
Copy link
Collaborator

sara-tagger commented Jul 20, 2020

Exalate commented:

sara-tagger commented:

Thanks for raising this issue, @Ghostvv will get back to you about it soon


Please also check out the docs and the forum in case your issue was raised there too
🤗

@wochinge
Copy link
Contributor

wochinge commented Jul 21, 2020

Exalate commented:

wochinge commented:

You could use an environment variable instead of a hardcoded URL in your configuration, e.g.

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: $ {DUCKLING_URL} 

     #This is the only change
     dimensions: ["time"]
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3

I see that this isn't ideal in terms of usability, but otherwise we'd need some way to pass in the duckling url during loading the model. I think using an env variable still seems the best way to do this. Wdyt?

@wochinge wochinge added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Jul 21, 2020
@N-Olbert
Copy link
Author

N-Olbert commented Jul 22, 2020

Exalate commented:

N-Olbert commented:

@wochinge Thanks for that suggestion. This is a clever trick, but doesn't seem to work: The metadata.json within the nlu -folder of the resulting model contains already the resolved value of the environment variable.

Anyways I found a solution: There is a hard coded env var within the DucklingHTTPExtractor which always wins:

def _url(self) -> Optional[Text]:
"""Return url of the duckling service. Environment var will override."""
if os.environ.get("RASA_DUCKLING_HTTP_URL"):
return os.environ["RASA_DUCKLING_HTTP_URL"]
return self.component_config.get("url")

(This issue can be closed form my side)

@no-response no-response bot removed the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Jul 22, 2020
@wochinge
Copy link
Contributor

wochinge commented Jul 22, 2020

Exalate commented:

wochinge commented:

Ah, good catch. Completely forgot about RASA_DUCKLING_HTTP_URL

🙈

(This issue can be closed form my side)

I'll convert this to a documentation issue as RASA_DUCKLING_HTTP_URL should be documented in https://rasa.com/docs/rasa/nlu/components/#ducklinghttpextractor

@wochinge wochinge changed the title Duckling-URL becomes hard-coded part of model document RASA_DUCKLING_HTTP_URL env variable usage Jul 22, 2020
@wochinge wochinge added type:docs 📖 Improvements to the documenation. Adding missing pieces or improving existing ones. and removed type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Jul 22, 2020
@rasabot-exalate rasabot-exalate added area:rasa-oss :ferris wheel: area:rasa-oss 🎡 Anything related to the open source Rasa framework type:docs 📖 Improvements to the documenation. Adding missing pieces or improving existing ones. and removed type:docs 📖 Improvements to the documenation. Adding missing pieces or improving existing ones. area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss :ferris wheel: labels Mar 17, 2022 — with Exalate Issue Sync
@sync-by-unito
Copy link

sync-by-unito bot commented Dec 19, 2022

➤ Maxime Verger commented:

💡 Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

➡️ More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

@m-vdb m-vdb closed this as completed Jan 9, 2023
@RheagalFire
Copy link

This still hasn't been documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:docs 📖 Improvements to the documenation. Adding missing pieces or improving existing ones.
Projects
None yet
Development

No branches or pull requests

6 participants