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
Rasa API #3066
Comments
Since you want to implement |
Considering the scripts in NLU:
There are a couple more concepts that we should support:
|
So you suggest to leave the module names as they are? |
well, not sure whatever you think makes it most consistent |
Updated the issue according to Tom's suggestion:
|
Nice Job! Few comments about it: Maybe we can add features to Rasa Python API to make it more easily integrated with (independent from) service container (HTTP server, RPC (grpc / thrift / protobf) server) or directly used in python interpreter (such as python interaction session and jupyter notebook). ideally, it look like this: import rasa
# nlu_model can be local data object, agent to remote service or dummy object for debug
nlu_model = rasa.model.nlu.load(path='...') # load NLU model from local
core_model = rasa.model.core.load(path='...', nlu_entry=nlu_model)
# in python, user can use rasa by
result = core_model.eval('I want book a hotel in LA tomorrow')
print(result) # output: OK. I booked xxx hotel for you
print(core_model.current_states) # view current internal states, very useful for real time debug
print(nlu_model.current_states) # view current internal states, very useful for real time debug
# in jupyter notebook, user can use rasa by
jupyter_wrapper = rasa.jupyter.wrap_core(core_entry=core_model)
result = jupyter_wrapper.eval('I want book a hotel in LA tomorrow')
print(result) # output jupyter friendly message: OK. I booked xxx hotel for you
print(jupyter_wrapper.current_states) # view current internal states, display friendly for jupyter
# wrap it for start a http service
http_server = rasa.service.http(core_entry=core_model)
http_server.serve_forever(port='80', host='0.0.0.0')
# wrap it for start a grpc service
grpc_server = rasa.service.grpc(core_entry=core_model)
grpc_server.serve_forever(port='9090', host='0.0.0.0') |
great! I am using gRPC now , realy need this RPC features! Looking forward to it!@howl-anderson @tmbo |
Suggested API commands:
a python API to use the Rasa tools within e.g. ipython notebooks
Goal
Changes to Rasa Stack
Changes to Core and NLU
Modules
renamerasa_nlu.run
torasa_nlu.shell
renamerasa_nlu.server
torasa_nlu.run
evaluate
scripts totest
✅rasa.remote
which covers all the remote stuffrasa.local
which covers the interaction with the local serverTraining
rasa_nlu.train.do_train()
torasa_nlu.train.train()
✅rasa_nlu.train.do_train()
instead of file ✅rasa_core.train.train_dialogue_model()
torasa_core.train.train()
✅Testing
rasa_nlu.test.cross_validate()
which can be called with file paths etc andcreates the agent inside✅rasa_core.test.test()
which can be called with file paths etc and creates the agent inside ✅rasa_core.test.compare()
(compare multiple policies) ✅Resulting Jupyter notebooks
Both should be possible: Demonstrating Rasa Core, NLU separately and showing them as one
The text was updated successfully, but these errors were encountered: