Apply Sentiment Analysis through a Slot

Hi , i need to apply sentiment analysis to a slot called feedback from getting user provided text through the form and the bot will need to utter different type of message based on the sentiment values (pos, neu , neg) through custom action e.g through the dispatcher.utter_message(template=“utter_based_on_sentiment”)

can anyone provide me with reference or guide me how can i do it ? I found a reference from post but i not sure how to implment which post by : JulianGerhard


Can anyone help me on this ? I had already apply Sentiment component to my chatbot , currently my implementation was

    type: categorical
      - positive
      - neutral
      - negative
    - condition:
        - type: slot
          name: sentiment
          value: positive
      text: "Hey, {name}. Nice to see you again! How are you?"

    - condition:
        - type: slot
          name: sentiment
          value: neutral
      text: "Hey, {name}. How are you?"

Above using conditional response variations .

Class ActionSubmitFeedback(Action):

    def name(self) -> Text:

        return "action_submit_feedback"


    def run(


        dispatcher: CollectingDispatcher,

        tracker: Tracker,

        domain: Dict[Text, Any],

    ) -> List[Dict]:

        sentiment = tracker.get_slot("sentiment")


i have a form in rules.yml which flow to ActionSubmitFeedback Action Class when form is filled with a feedback slot to save as slot from user text . How can i change my code in action to let my chatbot utterance different messge based on the feedback slot .

Have you seen our new blogpost on conditional response variation?

Hi koaning yes , i did and also implemented but didn’t show here , i think i have i solved my problem which i asked. Current now i faced another challenge is to obtain the slot value the sentiment that was predicted by my custom component and i not sure is this the right way to do it and i tested by running the action to pass to utterance but it cache my old response >.< i does not know why
sentiment = tracker.get_slot("sentiment")

dispatcher.utter_message(template="utter_display_sentiment", customer_sentiment = sentiment) 


  - text: Thanks {customer_sentiment}

but it cache my old response

Could you clarify what you mean with this statement? What is happening in the conversation and what did you expect instead?

can you please share your nlu file?