# How to make use of entity sentiment value with different response

**URL:** <https://forum.rasa.com/t/how-to-make-use-of-entity-sentiment-value-with-different-response/45246>\
**Category:** Rasa Open Source\
**Created:** [June 30, 2021, 6:45pm UTC](https://forum.rasa.com/t/how-to-make-use-of-entity-sentiment-value-with-different-response/45246 "2021-06-30T18:45:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BELIEVEIT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/believeit/32/15170_2.png) [@BELIEVEIT](https://forum.rasa.com/u/BELIEVEIT)\
**Post date:** [June 30, 2021, 6:45pm UTC](https://forum.rasa.com/t/how-to-make-use-of-entity-sentiment-value-with-different-response/45246/1 "2021-06-30T18:45:11Z")

</div>

Tutorial [How to Enhance Rasa NLU Models with Custom Components | Rasa Blog](https://blog.rasa.com/enhancing-rasa-nlu-with-custom-components/)

Hi everyone , i had just use the pre-trained model for sentiment analysis into my chatbot with custom component , may i know how can i make use of the sentiment value e.g neg/pos under entities shown below to utter different response ?

Example of use case of asking user for feedback on service experience , chatbot will apologies to user if sentiment is negative and thank user if it is postive.

```auto
'entities':[  
      {  
         'value':'neg',
         'confidence':0.9933702940854111,
         'entity':'sentiment',
         'extractor':'sentiment_extractor'
      }

```

---

<div class="post-metadata">

**Author:** ![kedz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kedz/32/12831_2.png) [@kedz](https://forum.rasa.com/u/kedz)\
**Post date:** [July 2, 2021, 8:56pm UTC](https://forum.rasa.com/t/how-to-make-use-of-entity-sentiment-value-with-different-response/45246/2 "2021-07-02T20:56:25Z")

</div>

Hi! While you could achieve this with slot mappings, I would caution against using a sentiment classifier to drive the conversation. Sentiment classifiers are imperfect and will often change their prediction substantially if you change the words of the text that have nothing to do with the sentiment. Compare

```
take your shirt and give me back my $$$

```

to

```
take your shirt and give me back my money

```

in [this sentiment classifier](https://monkeylearn.com/sentiment-analysis-online/). They both have the same sentiment but the classifier gives different predictions.

Instead, why not ask the user directly give feedback with [buttons](https://rasa.com/docs/rasa/responses#buttons). For example,

```
responses:
    utter_ask_feedback:
      - text: "How would you rate your overall experience with our product?"
        buttons:
          - title: "Love it!"
            payload: "/positive_rating"
          - title: "It's ok."              
            payload: "/neutral_rating"
          - title: "Hate it!"
            payload: "/negative_rating"

```

This way the user can tell you directly how they are feeling about the product and you can give them the appropriate response with confidence.

---

<div class="post-metadata">

**Author:** ![BELIEVEIT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/believeit/32/15170_2.png) [@BELIEVEIT](https://forum.rasa.com/u/BELIEVEIT)\
**Post date:** [July 6, 2021, 2:43pm UTC](https://forum.rasa.com/t/how-to-make-use-of-entity-sentiment-value-with-different-response/45246/3 "2021-07-06T14:43:52Z")

</div>

Thanks @kedz , i using rasa as voice assistance for a embedded robot , it think it won’t be much a problem of user typing symbols
