Newline in training data YAML

My training data has several examples with a newline inside When training I get the UserWarning: “…contains an example that doesn’t start with a ‘-’ symbol…” So it’s treating it as a new training example. Should I change the newline to \n?

hi and welcome to the forum @eitant can you share the nlu file?

Sure, here is an example:

- intent: greet
  examples: |
    - Hello
    - Hey
      how are you?

should this be changed to this?

- intent: greet
  examples: |
    - Hello
    - Hey\nhow are you?

Change to:

- intent: greet
  examples: |
    - Hello
    - Hey
    - how are you?

In YAML syntax for each training example you need to mention - hyphen and Its highly recommend to take an 10+ training example.

It should be

- intent: greet
  examples: |
    - Hello
    - Hey how are you?

That’s it

You can even check the YAML syntax using this online tool http://www.yamllint.com

Ref: rasa-demo/nlu.yml at main · RasaHQ/rasa-demo · GitHub

Ref Example for Bots: GitHub - cedextech/rasa-chatbot-templates: RASA chatbot use case boilerplate

@eitant I hope this will solve your issue and goodluck!

1 Like

So how does rasa treat new line in incoming messages?

@eitant can you elaborate more please with some example?