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

Loading and predicting with graph based model. #9747

Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5885e5b
Loading and predicting with graph based model.
joejuzl Sep 29, 2021
309c1f2
remove unneeded nlu_merge_needs
joejuzl Sep 30, 2021
70faeab
Include training type in metadata (#9799)
joejuzl Oct 6, 2021
cbe45dd
include class implementation in fingerprint
wochinge Oct 4, 2021
ffe6657
copy existing module
wochinge Oct 6, 2021
76edcc5
Merge branch '3.0-architecture-revamp/9277/recipe' into 3.0-architect…
wochinge Oct 6, 2021
f328571
fix cache usage in tests
wochinge Oct 4, 2021
de063b2
fix some code quality issues
wochinge Oct 4, 2021
1724bb1
fix some model training errors
wochinge Oct 4, 2021
9409b02
omit reverting back sesion wide fixture
wochinge Oct 6, 2021
2ab1bb4
fix MitieIntentClassifier return type
wochinge Oct 6, 2021
d05f2fe
retrieve latest model first
wochinge Oct 6, 2021
4039d5f
Merge pull request #9787 from RasaHQ/origin/3.0-architecture-revamp/9…
wochinge Oct 6, 2021
fc406df
refactor agent and processor loading
joejuzl Oct 6, 2021
de51774
PR comments
joejuzl Oct 6, 2021
f93de25
more PR comments
joejuzl Oct 6, 2021
8d5df31
fix config validation with trainable tokenizer
wochinge Oct 6, 2021
d08856c
Merge pull request #9788 from RasaHQ/origin/3.0-architecture-revamp/9…
wochinge Oct 6, 2021
0ed988c
add simple Agent.load()
joejuzl Oct 7, 2021
895a8f9
Merge branch '3.0-architecture-revamp/9604/prediction' of github.com:…
joejuzl Oct 7, 2021
214c398
add project fingerprint to model metadata
wochinge Oct 6, 2021
8c4a070
drop no longer necessary `initialize_processor`
wochinge Oct 7, 2021
e945ff0
Merge pull request #9808 from RasaHQ/origin/3.0-architecture-revamp/9…
wochinge Oct 7, 2021
689979f
return from constructor
joejuzl Oct 7, 2021
5efe8d4
Merge branch '3.0-architecture-revamp/9604/prediction' of github.com:…
joejuzl Oct 7, 2021
4483a09
fix tests
joejuzl Oct 7, 2021
804c224
fix test_fingerprint_changes_if_module_changes
wochinge Oct 7, 2021
7140520
fix tests
joejuzl Oct 7, 2021
f78b260
add clarifying comment
joejuzl Oct 7, 2021
6f95c60
small changes
joejuzl Oct 7, 2021
44674fd
return empty agent from any exception in load_agent
joejuzl Oct 7, 2021
ae9fa99
remove unnecessary try catch
joejuzl Oct 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,28 @@ run_RegexMessageHandlerGraphComponent:
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,28 @@ run_RegexMessageHandlerGraphComponent:
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,28 @@ run_RegexMessageHandlerGraphComponent:
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
60 changes: 55 additions & 5 deletions data/graph_schemas/default_config_core_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run_MemoizationPolicy0:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.memoization.MemoizationPolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand All @@ -27,7 +27,7 @@ run_RulePolicy1:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.rule_policy.RulePolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand All @@ -41,7 +41,7 @@ run_UnexpecTEDIntentPolicy2:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.unexpected_intent_policy.UnexpecTEDIntentPolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand All @@ -57,7 +57,7 @@ run_TEDPolicy3:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.ted_policy.TEDPolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand Down Expand Up @@ -88,7 +88,7 @@ select_prediction:
policy2: run_UnexpecTEDIntentPolicy2
policy3: run_TEDPolicy3
domain: domain_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.ensemble.DefaultPolicyPredictionEnsemble
constructor_name: load
fn: combine_predictions_from_kwargs
Expand All @@ -97,3 +97,53 @@ select_prediction:
is_target: false
is_input: false
resource: null
nlu_message_converter:
needs:
messages: __message__
uses: rasa.graph_components.converters.nlu_message_converter.NLUMessageConverter
constructor_name: load
fn: convert_user_message
config: {}
eager: true
is_target: false
is_input: false
resource: null
run_RegexMessageHandlerGraphComponent:
needs:
messages: nlu_message_converter
domain: domain_provider
uses: rasa.nlu.classifiers.regex_message_handler.RegexMessageHandlerGraphComponent
constructor_name: load
fn: process
config: {}
eager: True
is_target: False
is_input: False
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
domain: domain_provider
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
ensemble_output: select_prediction
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
13 changes: 13 additions & 0 deletions data/graph_schemas/default_config_e2e_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,16 @@ select_prediction:
is_target: false
is_input: false
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
ensemble_output: select_prediction
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
25 changes: 25 additions & 0 deletions data/graph_schemas/default_config_nlu_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,28 @@ run_RegexMessageHandlerGraphComponent:
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
13 changes: 13 additions & 0 deletions data/graph_schemas/default_config_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,16 @@ select_prediction:
is_target: false
is_input: false
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
ensemble_output: select_prediction
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
28 changes: 27 additions & 1 deletion data/graph_schemas/keyword_classifier_config_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ run_KeywordIntentClassifier0:
eager: true
is_target: false
is_input: false
resource: null
resource:
name: train_KeywordIntentClassifier0
run_RegexMessageHandlerGraphComponent:
needs:
messages: run_KeywordIntentClassifier0
Expand All @@ -31,3 +32,28 @@ run_RegexMessageHandlerGraphComponent:
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
12 changes: 12 additions & 0 deletions data/graph_schemas/keyword_classifier_config_train_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ nlu_training_data_provider:
is_target: false
is_input: true
resource: null
train_KeywordIntentClassifier0:
needs:
training_data: nlu_training_data_provider
uses: rasa.nlu.classifiers.keyword_intent_classifier.KeywordIntentClassifierGraphComponent
constructor_name: create
fn: train
config: {}
eager: False
is_target: True
is_input: False
resource: null

58 changes: 54 additions & 4 deletions data/graph_schemas/max_hist_config_predict_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run_MemoizationPolicy0:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.memoization.MemoizationPolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand All @@ -28,7 +28,7 @@ run_RulePolicy1:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.rule_policy.RulePolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand All @@ -42,7 +42,7 @@ run_TEDPolicy2:
needs:
domain: domain_provider
rule_only_data: rule_only_data_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.ted_policy.TEDPolicyGraphComponent
constructor_name: load
fn: predict_action_probabilities
Expand Down Expand Up @@ -70,7 +70,7 @@ select_prediction:
policy1: run_RulePolicy1
policy2: run_TEDPolicy2
domain: domain_provider
tracker: __tracker__
tracker: nlu_prediction_to_history_adder
uses: rasa.core.policies.ensemble.DefaultPolicyPredictionEnsemble
constructor_name: load
fn: combine_predictions_from_kwargs
Expand All @@ -79,3 +79,53 @@ select_prediction:
is_target: false
is_input: false
resource: null
nlu_message_converter:
needs:
messages: __message__
uses: rasa.graph_components.converters.nlu_message_converter.NLUMessageConverter
constructor_name: load
fn: convert_user_message
config: {}
eager: true
is_target: false
is_input: false
resource: null
run_RegexMessageHandlerGraphComponent:
needs:
messages: nlu_message_converter
domain: domain_provider
uses: rasa.nlu.classifiers.regex_message_handler.RegexMessageHandlerGraphComponent
constructor_name: load
fn: process
config: {}
eager: true
is_target: false
is_input: false
resource: null
nlu_prediction_to_history_adder:
needs:
domain: domain_provider
predictions: run_RegexMessageHandlerGraphComponent
original_messages: __message__
tracker: __tracker__
uses: rasa.graph_components.adders.nlu_prediction_to_history_adder.NLUPredictionToHistoryAdder
constructor_name: load
fn: add
config: {}
eager: True
is_target: False
is_input: False
resource: null
output_provider:
needs:
parsed_messages: run_RegexMessageHandlerGraphComponent
tracker_with_added_message: nlu_prediction_to_history_adder
ensemble_output: select_prediction
uses: rasa.graph_components.providers.prediction_output_provider.PredictionOutputProvider
constructor_name: create
fn: provide
config: {}
eager: True
is_target: False
is_input: False
resource: null
Loading