Response Selectors: How to reply multiline texts?

Hi all, cc @ dakshvar22,

I would like to use Response Selector for a FAQ system where answers are multiline texts, not just a single lines.

Take this Q/A example, where question is:

How to follow people on Twitter?

and the corresponding answer (real example from twitter FAQ:

1. Find a Tweet from the account you’d like to follow. 
2. Hover your mouse over their name.
3. Click the  **Follow**  button.

OR 

1. Navigate to a Tweet from the account you’d like to follow. 
2. Tap the  icon located at the top of the Tweet.
3. Tap  **Follow**  from the selection menu.

How can I manage this textual answer with data/responses.md Response Selector markdown format?

As far as I undersatnd (please tell me I’m wrong) I can just have 1 line for the answer. If true, the only solution I found is to insert \n char explicitly. So the mentioned case could be:

(venv) $ cat data/responses.md

## ask languages
* faq/ask_how_to_follow_people_on_twitter
  - 1. Find a Tweet from the account you’d like to follow.\n     2. Hover your mouse over their name.\n     3. Click the  **Follow**  button.\n \n     OR \n\n     1. Navigate to a Tweet from the account you’d like to follow.\n      2. Tap the  icon located at the top of the Tweet. \n     3. Tap  **Follow**  from the selection menu.

## ask blablabla
* faq/ask_blablabla
  - blablabla\nblablabla\nblablabla

Pretty unreadable, isn’t it? It “works” but I don’t like that for many reason:

  • the answers on data/responses.md file become unreadable!
  • I need to write a script that convert FAQs in markdawn substituting newline with \ns.
  • using rasa cli commands (rasa shell) conversation tests, I got the unreadable single line compacted texts :confused:

My 2 questions:

  1. Can I have FAQ answers in responses.md that are composed by a multi-line text (reported “as” wrote in the markdown file, possibly avoiding to insert '\n')?

  2. What’s the best way to manage Response Selectors answers in case of long texts answers (say many lines of text ~ a page/paragraph)?

    Change Request, It could be great if I could just mention external texts path/filenames in responses file; like this:

    <!-- responses.md -->
     ## answers in external text (.txt/.markdown format) file
     * faq/ask_topic_1
       - path/to/topic_1.txt
    

What do you think? Thanks for your help

giorgio

2 Likes

Hi @solyarisoftware, good points!

Can I have FAQ answers in responses.md that are composed by a multi-line text (reported “as” wrote in the markdown file, possibly avoiding to insert '\n' )

Currently no, and that is a known limitation. That should be address once response selector comes out of the experimental mode. The training data format is one of the central pieces that needs revamp.

What’s the best way to manage Response Selectors answers in case of long texts answers (say many lines of text ~ a page/paragraph)? Change Request, It could be great if I could just mention external texts path/filenames in responses file ; like this:

I think that’s linked to your first question. Your change suggestion is a valid one and we’ll take that into consideration.

Thanks

2 Likes

thanks @dakshvar22 for your feedback. I’ll propose that change requests on github repo, jut to formalize/take trace.

1 Like