# Newline in training data YAML

**URL:** <https://forum.rasa.com/t/newline-in-training-data-yaml/51788>\
**Category:** Rasa Open Source\
**Created:** [March 8, 2022, 11:22am UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788 "2022-03-08T11:22:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eitant](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@eitant](https://forum.rasa.com/u/eitant)\
**Post date:** [March 8, 2022, 11:22am UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/1 "2022-03-08T11:22:47Z")

</div>

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?

---

<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:** [March 8, 2022, 1:34pm UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/2 "2022-03-08T13:34:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eitant](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@eitant](https://forum.rasa.com/u/eitant)\
**Post date:** [March 8, 2022, 3:40pm UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/3 "2022-03-08T15:40:27Z")

</div>

Sure, here is an example:

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

```

should this be changed to this?

```auto
- intent: greet
  examples: |
    - Hello
    - Hey\nhow are 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:** [March 8, 2022, 4:34pm UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/4 "2022-03-08T16:34:00Z")

</div>

> [@eitant](#):
>
> ```auto
> - intent: greet
> examples: |
> - Hello
> - Hey
> how are you?
> 
> ```

Change to:

```auto
- 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.

> [@eitant](#):
>
> ```auto
> - intent: greet
> examples: |
> - Hello
> - Hey\nhow are you?
> 
> ```

It should be

```auto
- 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](http://www.yamllint.com)

Ref: [https://github.com/RasaHQ/rasa-demo/blob/main/data/nlu/nlu.yml](https://github.com/RasaHQ/rasa-demo/blob/main/data/nlu/nlu.yml)

Ref Example for Bots: [GitHub - cedextech/rasa-chatbot-templates: RASA chatbot use case boilerplate](https://github.com/cedextech/rasa-chatbot-templates)

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

---

<div class="post-metadata">

**Author:** ![eitant](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@eitant](https://forum.rasa.com/u/eitant)\
**Post date:** [March 9, 2022, 9:26am UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/5 "2022-03-09T09:26:04Z")

</div>

So how does rasa treat new line in incoming messages?

---

<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:** [March 9, 2022, 1:01pm UTC](https://forum.rasa.com/t/newline-in-training-data-yaml/51788/6 "2022-03-09T13:01:43Z")

</div>

@eitant can you elaborate more please with some example?
