RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.89k stars 4.63k forks source link

Add model name to the logs in CLI #6571

Closed Akhil-YS closed 3 years ago

Akhil-YS commented 4 years ago

Description of Problem: It would be more informative if the name of the model which is currently being loaded is displayed in the logs for CLI commands like rasa shell rasa shell nlu rasa run

Overview of the Solution:

(tensorflow) PS O:\Office\Chatbot\HealthCareChatbot\Chatbot\latest_vtest> rasa shell nlu --debug
2020-09-04 10:31:54 DEBUG    rasa.model  - Extracted the model {- MODEL_NAME } to 'C:\Users\Akhilesh\AppData\Local\Temp\tmpkpg3apm3'.
2020-09-04 10:32:25 INFO     rasa.nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2020-09-04 10:32:25 DEBUG    rasa.utils.tensorflow.models  - Loading the model {- MODEL_NAME }...
2020-09-04 10:32:42 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2020-09-04 10:32:42 DEBUG    rasa.utils.tensorflow.models  - Building tensorflow prediction graph...
2020-09-04 10:32:49 DEBUG    rasa.utils.tensorflow.models  - Finished building tensorflow prediction graph.
2020-09-04 10:33:05 INFO     rasa.nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en_core_web_md'.
NLU model loaded. Type a message and press enter to parse it.
Next message:
sara-tagger commented 4 years ago

Thanks for submitting this feature request 🚀 @tabergma will get back to you about it soon! ✨

tabergma commented 4 years ago

@Akhil-YS Thanks for creating this issue. Should the model name only be visible during debug mode or in general? Do you think we need the full path or does the relative path is sufficient?

If you like you can also take this over and try to solve it. Would you be interested?

Akhil-YS commented 4 years ago

Hi, @tabergma I think the general mode would be good unless someone feels too many logs. As we would be running those commands from inside of the project path, I feel that the relative path would suffice.

Thank you for the invite. I would like to but currently, I'm occupied with other works too. I'll let u know if I could find some time.

tabergma commented 4 years ago

Ok. Thanks for the input.

I think we can solve this by modifying this method: https://github.com/RasaHQ/rasa/blob/master/rasa/model.py#L121 I will add this issue to the contributor board. Feel free to pick it up if you have time. Thanks!

Akhil-YS commented 4 years ago

@tabergma. I will surely work on it as soon as I find the time. Thank you for the pointer.

Could you help me out with another issue regarding oov token in CountVectorsFeaturizer? I think the CountVectorsFeaturizer is not working with oov token. I posted it on the community forum and tagged u. I'm thinking to raise an issue here.

lucasdutraf commented 4 years ago

Hey there, @tabergma ! Is someone working on this issue? I'm new to Rasa community and code contribution, so I think this issue could be a nice start for me! Can I work on this?

tabergma commented 4 years ago

@lucasdutraf Sure, feel free to pick it up :rocket:

lucasdutraf commented 4 years ago

@lucasdutraf Sure, feel free to pick it up

Amazing! I'm already working on it

lucasdutraf commented 4 years ago

Hey @tabergma ! @mbslet and I are working together and we've got some progress, but also some questions about this issue.

First, we wanted to know if the expected output is something like that, to assure that we are on the right path for solving this issue:

(venv)  ~/Documentos/unb/gces/fork/teste  rasa shell nlu --debug                 
2020-09-23 21:21:04 DEBUG    rasa.model  - Extracted model models/name_test.tar.gz to '/tmp/tmpmyfor8ie'.
2020-09-23 21:21:04 DEBUG    rasa.telemetry  - Skipping request to external service: telemetry key not set.

Second, we didn't understand if all the mentioned commands like rasa shell , rasa shell nlu and rasa run should have the model relative path. And if it is, the message should be equal to the debug mode log like the example above?

tabergma commented 4 years ago

As far as I understood the request of @Akhil-YS the model path should appear in all kind of commands and not only in debug mode but in also if you run, for example, rasa shell without the --debug flag. Regarding the expected output, I would log something like Loading model <relative model path>.... As mentioned above I think you should be able to add a log statement in this line to solve the issue, but needs to be checked.

lucasdutraf commented 4 years ago

Hey @tabergma ! We've opened a pull request for this issue at #6840 . Please let us know if you see anything that we can improve! :smile:

wochinge commented 3 years ago

closed by https://github.com/RasaHQ/rasa/pull/6840