Pārlūkot izejas kodu

first commit

master
unknown pirms 2 gadiem
vecāks
revīzija
5fb93fca36
57 mainītis faili ar 255 papildinājumiem un 294 dzēšanām
  1. Binārs
      .rasa/cache/cache.db
  2. +0
    -1
      .rasa/cache/tmp06_xll1g/featurizer.json
  3. +0
    -33
      .rasa/cache/tmp06_xll1g/memorized_turns.json
  4. +0
    -1
      .rasa/cache/tmp9hpa6u09/featurizer.json
  5. +0
    -4
      .rasa/cache/tmp9hpa6u09/rule_only_data.json
  6. +0
    -30
      .rasa/cache/tmp9hpa6u09/rule_policy.json
  7. Binārs
      .rasa/cache/tmp_6e361yd/DIETClassifier.data_example.pkl
  8. +0
    -1
      .rasa/cache/tmp_6e361yd/DIETClassifier.entity_tag_specs.json
  9. +0
    -1
      .rasa/cache/tmp_6e361yd/DIETClassifier.index_label_id_mapping.json
  10. Binārs
      .rasa/cache/tmp_6e361yd/DIETClassifier.label_data.pkl
  11. Binārs
      .rasa/cache/tmp_6e361yd/DIETClassifier.sparse_feature_sizes.pkl
  12. Binārs
      .rasa/cache/tmp_6e361yd/DIETClassifier.tf_model.index
  13. +0
    -2
      .rasa/cache/tmp_6e361yd/checkpoint
  14. +0
    -1
      .rasa/cache/tmphq83y3bm/feature_to_idx_dict.pkl
  15. +0
    -1
      .rasa/cache/tmpmyma98ym/patterns.pkl
  16. +0
    -2
      .rasa/cache/tmpnohn1gsb/checkpoint
  17. +0
    -1
      .rasa/cache/tmpnohn1gsb/featurizer.json
  18. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.data_example.pkl
  19. +0
    -1
      .rasa/cache/tmpnohn1gsb/ted_policy.entity_tag_specs.json
  20. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.fake_features.pkl
  21. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.label_data.pkl
  22. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.meta.pkl
  23. +0
    -1
      .rasa/cache/tmpnohn1gsb/ted_policy.priority.pkl
  24. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.tf_model.data-00000-of-00001
  25. Binārs
      .rasa/cache/tmpnohn1gsb/ted_policy.tf_model.index
  26. +0
    -1
      .rasa/cache/tmpsjt1zils/oov_words.json
  27. +0
    -1
      .rasa/cache/tmpsjt1zils/vocabularies.pkl
  28. +0
    -2
      .rasa/cache/tmpskbk_jcw/checkpoint
  29. +0
    -1
      .rasa/cache/tmpskbk_jcw/featurizer.json
  30. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.data_example.pkl
  31. +0
    -1
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.entity_tag_specs.json
  32. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.fake_features.pkl
  33. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.label_data.pkl
  34. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.label_quantiles.pkl
  35. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.meta.pkl
  36. +0
    -1
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.priority.pkl
  37. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.tf_model.data-00000-of-00001
  38. Binārs
      .rasa/cache/tmpskbk_jcw/unexpected_intent_policy.tf_model.index
  39. +0
    -1
      .rasa/cache/tmpuxe36s89/oov_words.json
  40. +0
    -1
      .rasa/cache/tmpuxe36s89/vocabularies.pkl
  41. Binārs
      __pycache__/connect_to_database.cpython-38.pyc
  42. Binārs
      actions/__pycache__/actions.cpython-38.pyc
  43. +37
    -7
      actions/actions.py
  44. Binārs
      dget.jpg
  45. Binārs
      assets/bot_widget-removebg-preview.png
  46. +0
    -0
      assets/demo.html
  47. Binārs
      assets/robo_small.gif
  48. +3
    -6
      connect_to_database.py
  49. +5
    -0
      credentials.yml
  50. +1
    -0
      data/rules.yml
  51. +12
    -2
      domain.yml
  52. +0
    -180
      index.html
  53. Binārs
      models/20220914-135739-narrow-chili.tar.gz
  54. Binārs
      models/20220916-112756-perpendicular-vector.tar.gz
  55. Binārs
      models/20221003-133952-tractable-controller.tar.gz
  56. +197
    -0
      socketChannel.py
  57. +0
    -10
      testing.py

Binārs
.rasa/cache/cache.db Parādīt failu


+ 0
- 1
.rasa/cache/tmp06_xll1g/featurizer.json Parādīt failu

@@ -1 +0,0 @@
{"py/object": "rasa.core.featurizers.tracker_featurizers.MaxHistoryTrackerFeaturizer", "state_featurizer": null, "max_history": null, "remove_duplicates": true}

+ 0
- 33
.rasa/cache/tmp06_xll1g/memorized_turns.json Parādīt failu

@@ -1,33 +0,0 @@
{
"lookup": {
"eJyLrq6NBQAEOAGx": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohJzWxOLW2NhYA6ZsbeA==": "utter_lease",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohJzWxOLWWgBmlJSWpRfEQpbhMiAUAPa80cA==": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohv7QkPj8tvjg5vyC1tjYWALYRHnM=": "utter_default",
"eJyFjMEJwCAMAFfJAJ3AVUoJohEEm4gm/Yi7V2j//u7guHPMA0Zt9KAPmoUdjA+Q/U0Ofim5K/FqrVNbTeal6kBMURL2IJXmZmWq1DBS8lZ0t7pe19c7QQ==": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3qq2NBQCW6h3i": "utter_component_B",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3qiVgUmlJSWpRPLIG/KbFAgBBpzuu": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhuDSpODOlMt6xtjYWAFvNHRE=": "utter_subsidy_A",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhuDSpODOlMt6xloA5pSUlqUXxCOX4TIoFANwHOTs=": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXeubY2FgB3lR1N": "utter_eligible_C",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXeuZaAQaUlJalF8Ujq8ZoVCwB2Njnv": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3rK2NBQCW5h3h": "utter_component_A",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3rCVgUmlJSWpRPLIG/KbFAgBBMDur": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXeqbY2FgB3kR1M": "utter_eligible_B",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXeqZaAQaUlJalF8Ujq8ZoVCwB1wjns": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohLTMvMS85MzGntjYWAFr6HRM=": "utter_financial",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohLTMvMS85MzGnloA5pSUlqUXxCOX4TIoFANpYOUE=": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhODkjNTe1tjYWAAWTG+M=": "utter_scheme",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhODkjNTe1loAhpSUlqUXxULU4zYgFAOF7NbE=": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSc1uaQoMzmzpLK2NhYAlxweDw==": "utter_electricity",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSc1uaQoMzmzpLKWgEmlJSWpRfHIGvCbFgsAVQw8NQ==": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhuDSpODOlMt6ptjYWAFvRHRI=": "utter_subsidy_B",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEqhuDSpODOlMt6ploA5pSUlqUXxCOX4TIoFANx4OT4=": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3rq2NBQCW7h3j": "utter_component_C",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohOT+3ID8PyIx3riVgUmlJSWpRPLIG/KbFAgBCHjux": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXesbY2FgB3jR1L": "utter_eligible_A",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohNSczPTMpJzXesZaAQaUlJalF8Ujq8ZoVCwB1Tjnp": "action_listen",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohMy8tvyg3EaSmtjYWAJevHhQ=": "utter_information",
"eJyLrq7VUaguKEoti09MLsnMz7NSqIYw4vMSc1OtFKCcnMziktQ8oNrS4tQioJrMPCC3xEohMy8tvyg3EaSmloBJpSUlqUXxyBrwmxYLAFjcPEQ=": "action_listen"
}
}

+ 0
- 1
.rasa/cache/tmp9hpa6u09/featurizer.json Parādīt failu

@@ -1 +0,0 @@
{"py/object": "rasa.core.featurizers.tracker_featurizers.MaxHistoryTrackerFeaturizer", "state_featurizer": null, "max_history": null, "remove_duplicates": true}

+ 0
- 4
.rasa/cache/tmp9hpa6u09/rule_only_data.json Parādīt failu

@@ -1,4 +0,0 @@
{
"rule_only_slots": [],
"rule_only_loops": []
}

+ 0
- 30
.rasa/cache/tmp9hpa6u09/rule_policy.json Parādīt failu

@@ -1,30 +0,0 @@
{
"lookup": {
"rules": {
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"greet\"}}]": "utter_greet",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"greet\"}}, {\"prev_action\": {\"action_name\": \"utter_greet\"}, \"user\": {\"intent\": \"greet\"}}]": "action_listen",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"bot_challenge\"}}]": "utter_iamabot",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"bot_challenge\"}}, {\"prev_action\": {\"action_name\": \"utter_iamabot\"}, \"user\": {\"intent\": \"bot_challenge\"}}]": "action_listen",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"goodbye\"}}]": "utter_goodbye",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"goodbye\"}}, {\"prev_action\": {\"action_name\": \"utter_goodbye\"}, \"user\": {\"intent\": \"goodbye\"}}]": "action_listen",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"thanking\"}}]": "utter_your_welcome",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"thanking\"}}, {\"prev_action\": {\"action_name\": \"utter_your_welcome\"}, \"user\": {\"intent\": \"thanking\"}}]": "action_listen"
},
"rule_only_slots": [],
"rule_only_loops": [],
"rules_for_loop_unhappy_path": {},
"rules_not_in_stories": [
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"goodbye\"}}]",
"predicting default action with intent session_start",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"thanking\"}}]",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"thanking\"}}, {\"prev_action\": {\"action_name\": \"utter_your_welcome\"}, \"user\": {\"intent\": \"thanking\"}}]",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"bot_challenge\"}}]",
"predicting default action with intent back",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"greet\"}}]",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"bot_challenge\"}}, {\"prev_action\": {\"action_name\": \"utter_iamabot\"}, \"user\": {\"intent\": \"bot_challenge\"}}]",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"goodbye\"}}, {\"prev_action\": {\"action_name\": \"utter_goodbye\"}, \"user\": {\"intent\": \"goodbye\"}}]",
"[{\"prev_action\": {\"action_name\": \"action_listen\"}, \"user\": {\"intent\": \"greet\"}}, {\"prev_action\": {\"action_name\": \"utter_greet\"}, \"user\": {\"intent\": \"greet\"}}]",
"predicting default action with intent restart"
]
}
}

Binārs
.rasa/cache/tmp_6e361yd/DIETClassifier.data_example.pkl Parādīt failu


+ 0
- 1
.rasa/cache/tmp_6e361yd/DIETClassifier.entity_tag_specs.json Parādīt failu

@@ -1 +0,0 @@
[]

+ 0
- 1
.rasa/cache/tmp_6e361yd/DIETClassifier.index_label_id_mapping.json Parādīt failu

@@ -1 +0,0 @@
{"0": "bot_challenge", "1": "component_A", "2": "component_B", "3": "component_C", "4": "electricity", "5": "eligible_A", "6": "eligible_B", "7": "eligible_C", "8": "financial", "9": "goodbye", "10": "greet", "11": "information", "12": "lease", "13": "out_of_scope", "14": "scheme", "15": "start", "16": "subsidy_A", "17": "subsidy_B", "18": "thanking"}

Binārs
.rasa/cache/tmp_6e361yd/DIETClassifier.label_data.pkl Parādīt failu


Binārs
.rasa/cache/tmp_6e361yd/DIETClassifier.sparse_feature_sizes.pkl Parādīt failu


Binārs
.rasa/cache/tmp_6e361yd/DIETClassifier.tf_model.index Parādīt failu


+ 0
- 2
.rasa/cache/tmp_6e361yd/checkpoint Parādīt failu

@@ -1,2 +0,0 @@
model_checkpoint_path: "DIETClassifier.tf_model"
all_model_checkpoint_paths: "DIETClassifier.tf_model"

+ 0
- 1
.rasa/cache/tmphq83y3bm/feature_to_idx_dict.pkl Parādīt failu

@@ -1 +0,0 @@
{"json://{\"py/tuple\": [0, \"low\"]}": {"False": 0, "True": 1}, "json://{\"py/tuple\": [0, \"title\"]}": {"False": 2, "True": 3}, "json://{\"py/tuple\": [0, \"upper\"]}": {"False": 4, "True": 5}, "json://{\"py/tuple\": [1, \"BOS\"]}": {"False": 6, "True": 7}, "json://{\"py/tuple\": [1, \"EOS\"]}": {"False": 8, "True": 9}, "json://{\"py/tuple\": [1, \"digit\"]}": {"False": 10, "True": 11}, "json://{\"py/tuple\": [1, \"low\"]}": {"False": 12, "True": 13}, "json://{\"py/tuple\": [1, \"title\"]}": {"False": 14, "True": 15}, "json://{\"py/tuple\": [1, \"upper\"]}": {"False": 16, "True": 17}, "json://{\"py/tuple\": [2, \"low\"]}": {"False": 18, "True": 19}, "json://{\"py/tuple\": [2, \"title\"]}": {"False": 20, "True": 21}, "json://{\"py/tuple\": [2, \"upper\"]}": {"False": 22, "True": 23}}

+ 0
- 1
.rasa/cache/tmpmyma98ym/patterns.pkl Parādīt failu

@@ -1 +0,0 @@
[]

+ 0
- 2
.rasa/cache/tmpnohn1gsb/checkpoint Parādīt failu

@@ -1,2 +0,0 @@
model_checkpoint_path: "ted_policy.tf_model"
all_model_checkpoint_paths: "ted_policy.tf_model"

+ 0
- 1
.rasa/cache/tmpnohn1gsb/featurizer.json Parādīt failu

@@ -1 +0,0 @@
{"py/object": "rasa.core.featurizers.tracker_featurizers.MaxHistoryTrackerFeaturizer", "state_featurizer": {"py/object": "rasa.core.featurizers.single_state_featurizer.SingleStateFeaturizer", "_default_feature_states": {"intent": {"back": 0, "bot_challenge": 1, "component_A": 2, "component_B": 3, "component_C": 4, "electricity": 5, "eligible_A": 6, "eligible_B": 7, "eligible_C": 8, "financial": 9, "goodbye": 10, "greet": 11, "information": 12, "lease": 13, "nlu_fallback": 14, "out_of_scope": 15, "restart": 16, "scheme": 17, "session_start": 18, "start": 19, "subsidy_A": 20, "subsidy_B": 21, "thanking": 22}, "action_name": {"action_listen": 0, "action_restart": 1, "action_session_start": 2, "action_default_fallback": 3, "action_deactivate_loop": 4, "action_revert_fallback_events": 5, "action_default_ask_affirmation": 6, "action_default_ask_rephrase": 7, "action_two_stage_fallback": 8, "action_unlikely_intent": 9, "action_back": 10, "...": 11, "action_extract_slots": 12, "utter_component_A": 13, "utter_component_B": 14, "utter_component_C": 15, "utter_default": 16, "utter_electricity": 17, "utter_eligible_A": 18, "utter_eligible_B": 19, "utter_eligible_C": 20, "utter_email": 21, "utter_financial": 22, "utter_goodbye": 23, "utter_greet": 24, "utter_iamabot": 25, "utter_information": 26, "utter_lease": 27, "utter_name": 28, "utter_scheme": 29, "utter_subsidy_A": 30, "utter_subsidy_B": 31, "utter_your_welcome": 32}, "entities": {}, "slots": {}, "active_loop": {}}, "action_texts": [], "entity_tag_specs": null}, "max_history": 5, "remove_duplicates": true}

Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.data_example.pkl Parādīt failu


+ 0
- 1
.rasa/cache/tmpnohn1gsb/ted_policy.entity_tag_specs.json Parādīt failu

@@ -1 +0,0 @@
[]

Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.fake_features.pkl Parādīt failu


Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.label_data.pkl Parādīt failu


Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.meta.pkl Parādīt failu


+ 0
- 1
.rasa/cache/tmpnohn1gsb/ted_policy.priority.pkl Parādīt failu

@@ -1 +0,0 @@
1

Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.tf_model.data-00000-of-00001 Parādīt failu


Binārs
.rasa/cache/tmpnohn1gsb/ted_policy.tf_model.index Parādīt failu


+ 0
- 1
.rasa/cache/tmpsjt1zils/oov_words.json Parādīt failu

@@ -1 +0,0 @@
[]

+ 0
- 1
.rasa/cache/tmpsjt1zils/vocabularies.pkl Parādīt failu

@@ -1 +0,0 @@
{"text": {"scheme": 78, "what": 103, "are": 7, "the": 95, "different": 27, "kind": 56, "of": 67, "systems": 90, "supported": 89, "under": 100, "pm": 71, "kusum": 57, "is": 55, "tell": 92, "me": 61, "about": 2, "give": 40, "some": 84, "information": 52, "highlights": 47, "component": 22, "a": 1, "can": 19, "i": 50, "get": 39, "informaton": 53, "comp": 21, "details": 25, "eligible": 30, "who": 105, "eligibility": 29, "apply": 6, "for": 36, "will": 107, "purchase": 75, "generated": 38, "electricity": 28, "buy": 15, "be": 11, "bought": 14, "by": 16, "whom": 106, "farmers": 33, "lease": 60, "their": 96, "land": 58, "development": 26, "renewable": 76, "energy": 31, "power": 72, "plant": 69, "financial": 34, "support": 88, "available": 9, "b": 10, "inform": 51, "there": 97, "any": 5, "subsidy": 87, "installation": 54, "solar": 82, "pump": 74, "c": 18, "criteria": 23, "solarisation": 83, "where": 104, "more": 62, "hey": 45, "hello": 44, "hi": 46, "good": 41, "morning": 63, "evening": 32, "afternoon": 3, "night": 66, "bye": 17, "goodbye": 42, "have": 43, "nice": 65, "day": 24, "see": 79, "you": 108, "around": 8, "later": 59, "bot": 13, "human": 48, "am": 4, "talking": 91, "to": 98, "want": 102, "order": 68, "food": 35, "__number__": 0, "s": 77, "us": 101, "president": 73, "book": 12, "car": 20, "play": 70, "something": 85, "show": 80, "games": 37, "hungry": 49, "thank": 93, "thanks": 94, "so": 81, "much": 64, "u": 99, "start": 86}, "intent": {"scheme": 14, "component_a": 1, "eligible_a": 5, "electricity": 4, "lease": 12, "financial": 8, "component_b": 2, "eligible_b": 6, "subsidy_a": 16, "component_c": 3, "eligible_c": 7, "subsidy_b": 17, "information": 11, "greet": 10, "goodbye": 9, "bot_challenge": 0, "out_of_scope": 13, "thanking": 18, "start": 15}, "response": null, "action_name": {"action_listen": 6, "action_restart": 7, "action_session_start": 9, "action_default_fallback": 4, "action_deactivate_loop": 1, "action_revert_fallback_events": 8, "action_default_ask_affirmation": 2, "action_default_ask_rephrase": 3, "action_two_stage_fallback": 10, "action_unlikely_intent": 11, "action_back": 0, "action_extract_slots": 5, "utter_component_a": 12, "utter_component_b": 13, "utter_component_c": 14, "utter_default": 15, "utter_electricity": 16, "utter_eligible_a": 17, "utter_eligible_b": 18, "utter_eligible_c": 19, "utter_financial": 20, "utter_goodbye": 21, "utter_greet": 22, "utter_iamabot": 23, "utter_information": 24, "utter_lease": 25, "utter_scheme": 26, "utter_subsidy_a": 27, "utter_subsidy_b": 28, "utter_your_welcome": 29}, "action_text": null, "intent_response_key": null}

+ 0
- 2
.rasa/cache/tmpskbk_jcw/checkpoint Parādīt failu

@@ -1,2 +0,0 @@
model_checkpoint_path: "unexpected_intent_policy.tf_model"
all_model_checkpoint_paths: "unexpected_intent_policy.tf_model"

+ 0
- 1
.rasa/cache/tmpskbk_jcw/featurizer.json Parādīt failu

@@ -1 +0,0 @@
{"py/object": "rasa.core.featurizers.tracker_featurizers.IntentMaxHistoryTrackerFeaturizer", "state_featurizer": {"py/object": "rasa.core.featurizers.single_state_featurizer.IntentTokenizerSingleStateFeaturizer", "_default_feature_states": {"intent": {"back": 0, "bot_challenge": 1, "component_A": 2, "component_B": 3, "component_C": 4, "electricity": 5, "eligible_A": 6, "eligible_B": 7, "eligible_C": 8, "financial": 9, "goodbye": 10, "greet": 11, "information": 12, "lease": 13, "nlu_fallback": 14, "out_of_scope": 15, "restart": 16, "scheme": 17, "session_start": 18, "start": 19, "subsidy_A": 20, "subsidy_B": 21, "thanking": 22}, "action_name": {"action_listen": 0, "action_restart": 1, "action_session_start": 2, "action_default_fallback": 3, "action_deactivate_loop": 4, "action_revert_fallback_events": 5, "action_default_ask_affirmation": 6, "action_default_ask_rephrase": 7, "action_two_stage_fallback": 8, "action_unlikely_intent": 9, "action_back": 10, "...": 11, "action_extract_slots": 12, "utter_component_A": 13, "utter_component_B": 14, "utter_component_C": 15, "utter_default": 16, "utter_electricity": 17, "utter_eligible_A": 18, "utter_eligible_B": 19, "utter_eligible_C": 20, "utter_email": 21, "utter_financial": 22, "utter_goodbye": 23, "utter_greet": 24, "utter_iamabot": 25, "utter_information": 26, "utter_lease": 27, "utter_name": 28, "utter_scheme": 29, "utter_subsidy_A": 30, "utter_subsidy_B": 31, "utter_your_welcome": 32}, "entities": {}, "slots": {}, "active_loop": {}}, "action_texts": [], "entity_tag_specs": null}, "max_history": 5, "remove_duplicates": true}

Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.data_example.pkl Parādīt failu


+ 0
- 1
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.entity_tag_specs.json Parādīt failu

@@ -1 +0,0 @@
[]

Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.fake_features.pkl Parādīt failu


Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.label_data.pkl Parādīt failu


Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.label_quantiles.pkl Parādīt failu


Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.meta.pkl Parādīt failu


+ 0
- 1
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.priority.pkl Parādīt failu

@@ -1 +0,0 @@
2

Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.tf_model.data-00000-of-00001 Parādīt failu


Binārs
.rasa/cache/tmpskbk_jcw/unexpected_intent_policy.tf_model.index Parādīt failu


+ 0
- 1
.rasa/cache/tmpuxe36s89/oov_words.json Parādīt failu

@@ -1 +0,0 @@
[]

+ 0
- 1
.rasa/cache/tmpuxe36s89/vocabularies.pkl
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Binārs
__pycache__/connect_to_database.cpython-38.pyc Parādīt failu


Binārs
actions/__pycache__/actions.cpython-38.pyc Parādīt failu


+ 37
- 7
actions/actions.py Parādīt failu

@@ -11,7 +11,7 @@ from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from database_connectivity import DataUpdate
from connect_to_database import UpdateData
import datetime
#
#
@@ -28,22 +28,30 @@ import datetime
#
# return []

# class ActionHelloWorld(Action):
#FOR GETTING THE USER'S BROWSER AND DEVICE INFORMATION THROUGH CUSTOM DATA.
# class ActionGetData(Action):

# def name(self) -> Text:
# return "action_hello_world"
# return "action_get_data"

# def run(self, dispatcher: CollectingDispatcher,
# tracker: Tracker,
# domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

# dispatcher.utter_message(text="Hello World!")
# events = tracker.current_state()['events']
# user_events = []
# for e in events:
# if e['event'] == 'user':
# user_events.append(e)

# return []
# custom_data = user_events[-1]['metadata']
# print(custom_data)

# return []



#FOR DATABASE CONNECTIVITY AND UPDATION.
#FOR DATABASE CONNECTIVITY AND UPDATION (NAME, EMAIL, DATE, SESSION ID).
# class ActionSubmit(Action):
# def name(self) -> Text:
# return "action_submit"
@@ -55,4 +63,26 @@ import datetime
# current_time = str(datetime.datetime.now())
# current_time = current_time.split(":")
# current_time = current_time[0] + ":" + current_time[1]
# DataUpdate(tracker.get_slot("name"),tracker.get_slot("email"), current_time, tracker.sender_id)
# DataUpdate(tracker.get_slot("name"),tracker.get_slot("email"), current_time, tracker.sender_id)


#GET THE USER'S BROWSER AND DEVICE INFORMATION THROUGH INIT PAYLOAD AND UPDATE THE TABLE USER_DEVICE_IMFORMATION.
class ActionUpdateData(Action):
def name(self) -> Text:
return "action_update_data"

def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

device = tracker.get_slot("device_and_browser").split(",")[0].capitalize()
browser = tracker.get_slot("device_and_browser").split(",")[1].capitalize()

current_time = str(datetime.datetime.now())
current_time = current_time.split(":")
current_time = current_time[0] + ":" + current_time[1]
current_time = datetime.datetime.strptime(current_time, "%Y-%m-%d %H:%M")

UpdateData(device, browser, current_time, tracker.sender_id)


Binārs
assets/bot → dget.jpg Parādīt failu


Binārs
assets/bot_widget-removebg-preview.png Parādīt failu

Pirms Pēc
Platums: 455  |  Augstums: 468  |  Izmērs: 77 KiB

+ 0
- 0
assets/demo.html Parādīt failu


Binārs
assets/robo_small.gif Parādīt failu

Pirms Pēc
Platums: 455  |  Augstums: 468  |  Izmērs: 1.9 MiB

database_connectivity.py → connect_to_database.py Parādīt failu

@@ -1,6 +1,6 @@
import mysql.connector

def DataUpdate(name, email, date, session_id):
def UpdateData(device, browser, date, session_id):
mydb = mysql.connector.connect(
host = "localhost",
user = "root",
@@ -11,13 +11,10 @@ def DataUpdate(name, email, date, session_id):
mycursor = mydb.cursor()

#sql = "CREATE TABLE user_information (Name VARCHAR(255), Email VARCHAR(255), Date VARCHAR(255), Session ID VARCHAR(255));"
sql = 'INSERT INTO user_data (Name, Email, Date, Session_ID) VALUES ("{}", "{}", "{}", "{}");'.format(name, email, date, session_id)
sql = 'INSERT INTO user_device_information VALUES ("{}", "{}", "{}", "{}");'.format(device, browser, date, session_id)

mycursor.execute(sql)

mydb.commit()

print("Successful!")

#if __name__ == "__main__":
#DataUpdate("siddharth", "siddharth@gmail.com")
print("Successful!")

+ 5
- 0
credentials.yml Parādīt failu

@@ -22,6 +22,11 @@ socketio:
bot_message_evt: bot_uttered
session_persistence: true

# socketChannel.SocketIOInput:
# user_message_evt: user_uttered
# bot_message_evt: bot_uttered
# session_persistence: true

#mattermost:
# url: "https://<mattermost instance>/api/v4"
# token: "<bot token>"


+ 1
- 0
data/rules.yml Parādīt failu

@@ -6,6 +6,7 @@ rules:
steps:
- intent: greet
- action: utter_greet
- action: action_update_data

- rule: Say goodbye anytime the user says goodbye
steps:


+ 12
- 2
domain.yml Parādīt failu

@@ -35,6 +35,16 @@ intents:
# - type: from_text
# intent: email

entities:
- device_and_browser

slots:
device_and_browser:
type: text
mappings:
- type: from_entity
entity: device_and_browser

responses:
utter_eligible_A:
- text: "Individual farmers/group of farmers/cooperatives/panchayats/Farmer Producer Organisations (FPO)/Water User associations (WUA). Land on which the project is proposed to be installed should be within 5 km from the nearest electricity sub-station."
@@ -194,8 +204,8 @@ responses:
utter_email:
- text: "Enter your email ID: "

# actions:
# - action_submit
actions:
- action_update_data

session_config:
session_expiration_time: 60

+ 0
- 180
index.html Parādīt failu

@@ -1,180 +0,0 @@
<html>
<head>
<style>
/* Some miscellenous widget manipulation */
.rw-launcher {
-webkit-animation-delay: 0;
-webkit-animation-duration: 0.5s;
-webkit-animation-name: slide-in;
-webkit-animation-fill-mode: forwards;
-moz-animation-delay: 0;
-moz-animation-duration: 0.5s;
-moz-animation-name: slide-in;
-moz-animation-fill-mode: forwards;
animation-delay: 0;
animation-duration: 0.5s;
animation-name: slide-in;
animation-fill-mode: forwards;
display: flex;
align-items: center !important;
justify-content: center;
background-color: white !important;
border: 0 !important;
box-shadow: 0 2px 10px 1px white!important;
height: 125px !important;
margin: 0;
width: 125px !important;
box-sizing:border-box
}
/* Resizing the widget */
.rw-launcher img {
width: 125 !important;
max-height: 125 !important;
object-fit: contain !important;
}
/* Getting rid of the rotation animation of the widget while closing */
.rw-close-launcher {
-webkit-animation-delay: 0;
-webkit-animation-duration: 0s !important;
-webkit-animation-name: rotation-lr !important;
-webkit-animation-fill-mode: forwards;
-moz-animation-delay: 0;
-moz-animation-duration: 0s !important;
-moz-animation-name: rotation-lr !important;
-moz-animation-fill-mode: forwards;
animation-delay: 0;
animation-duration: 0s !important;
animation-name: rotation-lr !important;
animation-fill-mode: forwards;
}

/* Getting rid of the rotation animation of the widget while opening */
.rw-open-launcher {
-webkit-animation-delay: 0;
-webkit-animation-duration: 0.5s;
-webkit-animation-name: rotation-rl;
-webkit-animation-fill-mode: forwards;
-moz-animation-delay: 0;
-moz-animation-duration: .5s;
-moz-animation-name: rotation-rl;
-moz-animation-fill-mode: forwards;
animation-delay: 0;
animation-duration: 0s !important;
animation-name: rotation-rl;
animation-fill-mode: forwards;
}
</style>
</head>
<body>
<style>
/* Background color for the header */
.rw-conversation-container .rw-header{background-color: #233e80;}
/* Correction of the shadow for the chat window */
.rw-conversation-container {
-webkit-animation-delay: 0;
-webkit-animation-duration: .5s;
-webkit-animation-name: slide-in;
-webkit-animation-fill-mode: forwards;
-moz-animation-delay: 0;
-moz-animation-duration: .5s;
-moz-animation-name: slide-in;
-moz-animation-fill-mode: forwards;
animation-delay: 0;
animation-duration: .5s;
animation-name: slide-in;
animation-fill-mode: forwards;
border-radius: 10px;
box-shadow: 0px -20px 12px 0px hsl(0deg 14% 89% / 0%), inset 4px -7px 3.7px -1px rgb(0 0 0 / 7%), 0 5px 7px -1px hsl(0deg 0% 0% / 9%), 2px -8px 12.5px -1px rgb(84 25 25 / 10%), 2px -6px 23.4px 0px rgb(255 0 0 / 12%), inset -3px -5px 56px 0px rgb(237 0 0 / 17%);
overflow: hidden;
width: 370px;
}
/* Resizing avatar (to the left of replies) */
.rw-conversation-container .rw-avatar {
width: 55px;
height: 55px;
border-radius: 100%;
margin-right: -3px;
/* position: relative; */
bottom: 0px;
}
/* Positioning the avatar to the left of replies rather than at the top*/
.rw-conversation-container .rw-message {
margin: 10px;
font-size: 16px;
line-height: 20px;
display: flex;
font-family: Inter,sans-serif;
flex-wrap: unset !important;
position: relative;
}
/* Header avatar resizing */
.rw-conversation-container .rw-header .rw-avatar {
all: initial;
height: 57px;
width: 57px;
position: absolute;
top: 4px;
left: 0px;
}
/* Color box for buttons (payload) */
.rw-conversation-container .rw-reply {
-webkit-transition: box-shadow .3s ease,top .3s ease;
-moz-transition: box-shadow .3s ease,top .3s ease;
-o-transition: box-shadow .3s ease,top .3s ease;
transition: box-shadow .3s ease,top .3s ease;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-flex-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
background-color: #fafafa;
border: 1px solid #135afe;
border-radius: 15px;
color: #233e80;
padding: 4px 8px;
max-width: 215px;
min-height: 1.7em;
font-weight: 500;
text-align: center;
font-family: Inter,sans-serif;
cursor: pointer;
margin: 0.25em;
text-decoration: unset;
box-shadow: unset !important/*0 .2px .7px -7pxrgba(0,0,0,.277),0 .5px 1.8px -7pxrgba(0,0,0,.369),0 1.2px 3.8px -7pxrgba(0,0,0,.442),0 4px 13px -7pxrgba(0,0,0,.64);*/
}
</style>
<script>!(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/rasa-webchat@1.x.x/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
window.localStorage.clear()
window.WebChat.default(
{
initPayload: '/greet',
customData: { language: "en" },
socketUrl: "http://localhost:5005",
profileAvatar: "./assets/bot_widget-removebg-preview.png",
openLauncherImage: "./assets/robo_small.gif",
closeImage: "./assets/robo_small.gif",
title: "PM-KUSUM",
inputTextFieldHint: "Start a conversation",
connectingText: 'Waiting for server...',
showCloseButton: true
// add other props here
},
null
);
}),
t.insertBefore(e, t.firstChild);
})();
</script>
</body>
</html>

Binārs
models/20220914-135739-narrow-chili.tar.gz Parādīt failu


Binārs
.rasa/cache/tmp_6e361yd/DIETClassifier.tf_model.data-00000-of-00001 → models/20220916-112756-perpendicular-vector.tar.gz Parādīt failu


Binārs
models/20221003-133952-tractable-controller.tar.gz Parādīt failu


+ 197
- 0
socketChannel.py Parādīt failu

@@ -0,0 +1,197 @@
from importlib.metadata import metadata
import logging
import warnings
import uuid
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse
from socketio import AsyncServer
from typing import Optional, Text, Any, List, Dict, Iterable, Callable, Awaitable

from rasa.core.channels.channel import InputChannel
from rasa.core.channels.channel import UserMessage, OutputChannel

logger = logging.getLogger(__name__)


class SocketBlueprint(Blueprint):
def __init__(self, sio: AsyncServer, socketio_path, *args, **kwargs):
self.sio = sio
self.socketio_path = socketio_path
super().__init__(*args, **kwargs)

def register(self, app, options):
self.sio.attach(app, self.socketio_path)
super().register(app, options)


class SocketIOOutput(OutputChannel):
@classmethod
def name(cls):
return "socketio"

def __init__(self, sio, sid, bot_message_evt):
self.sio = sio
self.sid = sid
self.bot_message_evt = bot_message_evt

async def _send_message(self, socket_id: Text, response: Any) -> None:
"""Sends a message to the recipient using the bot event."""

await self.sio.emit(self.bot_message_evt, response, room=socket_id)

async def send_text_message(
self, recipient_id: Text, text: Text, **kwargs: Any
) -> None:
"""Send a message through this channel."""

await self._send_message(self.sid, {"text": text})

async def send_image_url(
self, recipient_id: Text, image: Text, **kwargs: Any
) -> None:
"""Sends an image to the output"""

message = {"attachment": {"type": "image", "payload": {"src": image}}}
await self._send_message(self.sid, message)

async def send_text_with_buttons(
self,
recipient_id: Text,
text: Text,
buttons: List[Dict[Text, Any]],
**kwargs: Any,
) -> None:
"""Sends buttons to the output."""

message = {"text": text, "quick_replies": []}

for button in buttons:
message["quick_replies"].append(
{
"content_type": "text",
"title": button["title"],
"payload": button["payload"],
}
)

await self._send_message(self.sid, message)

async def send_elements(
self, recipient_id: Text, elements: Iterable[Dict[Text, Any]], **kwargs: Any
) -> None:
"""Sends elements to the output."""

for element in elements:
message = {
"attachment": {
"type": "template",
"payload": {"template_type": "generic", "elements": element},
}
}

await self._send_message(self.sid, message)

async def send_custom_json(
self, recipient_id: Text, json_message: Dict[Text, Any], **kwargs: Any
) -> None:
"""Sends custom json to the output"""

json_message.setdefault("room", self.sid)

await self.sio.emit(self.bot_message_evt, **json_message)

async def send_attachment(
self, recipient_id: Text, attachment: Dict[Text, Any], **kwargs: Any
) -> None:
"""Sends an attachment to the user."""
await self._send_message(self.sid, {"attachment": attachment})


class SocketIOInput(InputChannel):
"""A socket.io input channel."""

@classmethod
def name(cls) -> Text:
return "socketio"

@classmethod
def from_credentials(cls, credentials: Optional[Dict[Text, Any]]) -> InputChannel:
credentials = credentials or {}
return cls(
credentials.get("user_message_evt", "user_uttered"),
credentials.get("bot_message_evt", "bot_uttered"),
credentials.get("namespace"),
credentials.get("session_persistence", False),
credentials.get("socketio_path", "/socket.io"),
)

def __init__(
self,
user_message_evt: Text = "user_uttered",
bot_message_evt: Text = "bot_uttered",
namespace: Optional[Text] = None,
session_persistence: bool = False,
socketio_path: Optional[Text] = "/socket.io",
):
self.bot_message_evt = bot_message_evt
self.session_persistence = session_persistence
self.user_message_evt = user_message_evt
self.namespace = namespace
self.socketio_path = socketio_path

def blueprint(
self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
) -> Blueprint:
# Workaround so that socketio works with requests from other origins.
sio = AsyncServer(async_mode="sanic", cors_allowed_origins=[])
socketio_webhook = SocketBlueprint(
sio, self.socketio_path, "socketio_webhook", __name__
)

@socketio_webhook.route("/", methods=["GET"])
async def health(_: Request) -> HTTPResponse:
return response.json({"status": "ok"})

@sio.on("connect", namespace=self.namespace)
async def connect(sid: Text, _) -> None:
logger.debug(f"User {sid} connected to socketIO endpoint.")

@sio.on("disconnect", namespace=self.namespace)
async def disconnect(sid: Text) -> None:
logger.debug(f"User {sid} disconnected from socketIO endpoint.")

@sio.on("session_request", namespace=self.namespace)
async def session_request(sid: Text, data: Optional[Dict]):
if data is None:
data = {}
if "session_id" not in data or data["session_id"] is None:
data["session_id"] = uuid.uuid4().hex
await sio.emit("session_confirm", data["session_id"], room=sid)
logger.debug(f"User {sid} connected to socketIO endpoint.")

@sio.on(self.user_message_evt, namespace=self.namespace)
async def handle_message(sid: Text, data: Dict) -> Any:
output_channel = SocketIOOutput(sio, sid, self.bot_message_evt)

if self.session_persistence:
if not data.get("session_id"):
warnings.warn(
"A message without a valid sender_id "
"was received. This message will be "
"ignored. Make sure to set a proper "
"session id using the "
"`session_request` socketIO event."
)
return
sender_id = data["session_id"]
else:
sender_id = sid

message = UserMessage(
data["message"], output_channel, sender_id, input_channel=self.name(),
metadata = data['customData']
)
await on_new_message(message)

return socketio_webhook

+ 0
- 10
testing.py Parādīt failu

@@ -1,10 +0,0 @@
# name = 'Siddharth'
# email = 'siddharthsrivastava77@gmail.com'

# print('INSERT INTO users (name, email) VALUES ("{}", "{}");'.format(name, email))
import datetime
# using now() to get current time
current_time = str(datetime.datetime.now())
current_time = current_time.split(":")
print(current_time[0] + ":" + current_time[1])

Notiek ielāde…
Atcelt
Saglabāt