# Chatbot Reply Suggestions

**URL:** <https://forum.rasa.com/t/chatbot-reply-suggestions/46389>\
**Category:** Rasa Open Source\
**Created:** [August 1, 2021, 9:05am UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389 "2021-08-01T09:05:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanagar25](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yanagar25](https://forum.rasa.com/u/yanagar25)\
**Post date:** [August 1, 2021, 9:05am UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/1 "2021-08-01T09:05:34Z")

</div>

Hi, I have a dataset that consists of questions and answers pairs. Each question can have multiple answers. I want to create a chatbot that receives a question from the user as an input and returns the top K frequent replies to that matches the question the user asked. Is it possible to do so in Rasa?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 1, 2021, 12:07pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/2 "2021-08-01T12:07:32Z")

</div>

@yanagar25 Hi! Is your K frequent replies will be fixed or will varies as per user question.

---

<div class="post-metadata">

**Author:** ![yanagar25](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yanagar25](https://forum.rasa.com/u/yanagar25)\
**Post date:** [August 1, 2021, 12:34pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/3 "2021-08-01T12:34:41Z")

</div>

@nik202 They will vary per user question (from the most similar questions to the user’s input)

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 1, 2021, 12:38pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/4 "2021-08-01T12:38:22Z")

</div>

@yanagar25 means, if related questions have 10 response, then you planning to show all to the user screen? Or did you decided to fixed the value of K=3 or 4 based on per question? Or are you planning to use APIs for your use case?

---

<div class="post-metadata">

**Author:** ![yanagar25](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yanagar25](https://forum.rasa.com/u/yanagar25)\
**Post date:** [August 1, 2021, 12:55pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/5 "2021-08-01T12:55:00Z")

</div>

It will be k=3

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 1, 2021, 1:06pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/6 "2021-08-01T13:06:48Z")

</div>

@yanagar25 Your database are in SQL or Excel or other? please mention @ and then my alias

---

<div class="post-metadata">

**Author:** ![yanagar25](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yanagar25](https://forum.rasa.com/u/yanagar25)\
**Post date:** [August 1, 2021, 2:31pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/7 "2021-08-01T14:31:10Z")

</div>

@nik202 it is a json file that contains an array of objects:

> {“question”: “how are you?”, “answer”: “i’m good thank you”}

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [August 1, 2021, 2:35pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/8 "2021-08-01T14:35:12Z")

</div>

@yanagar25 Perfect, as APIs also work in JSON, you can write the code and fixed the key-value pair for the same.

@yanagar25 Can you share me JSON example, 1 questions and 3 answers?

@yanagar25 When you say top K frequent replies, how you manage to select k=3 from 10 response in your dataset or it will be top 3 or any random replies?

---

<div class="post-metadata">

**Author:** ![yanagar25](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yanagar25](https://forum.rasa.com/u/yanagar25)\
**Post date:** [August 1, 2021, 2:49pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/9 "2021-08-01T14:49:20Z")

</div>

@nik202 here is an example for my JSON of 1 question and answers:

```
{
    "question": "how are you?",
    "answers": ["i'm good and you?", "i'm good and you?", "i'm fine and you?", "everything great"]
}

```

In this example: “i’m good and you?” appears twice but i will only take it as one but this suggestion of an answer will appear as the first suggestion since it is most frequent then it will follow by “i’m fine and you?” and “everything great” so basically the most frequent ones will be at the top then the rest of the answers will come.

---

<div class="post-metadata">

**Author:** ![yyyggg](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@yyyggg](https://forum.rasa.com/u/yyyggg)\
**Post date:** [September 8, 2022, 2:57pm UTC](https://forum.rasa.com/t/chatbot-reply-suggestions/46389/10 "2022-09-08T14:57:51Z")

</div>

@yanagar25 did you get the solution for this?
