# Database for NLU

**URL:** <https://forum.rasa.com/t/database-for-nlu/26729>\
**Category:** Rasa Open Source\
**Created:** [March 29, 2020, 2:05pm UTC](https://forum.rasa.com/t/database-for-nlu/26729 "2020-03-29T14:05:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haneef](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/haneef/32/6613_2.png) [@haneef](https://forum.rasa.com/u/haneef)\
**Post date:** [March 29, 2020, 2:05pm UTC](https://forum.rasa.com/t/database-for-nlu/26729/1 "2020-03-29T14:05:33Z")

</div>

HI all, What i want is lets say i have two intents 1 is welcome and 1 is jokes. So And in each of intent i put 3-3 traing phrases like welcome(1st one) have hi,hello,hey and jokes(second one) have jokes,tell me joke, i am sad. Now i created a database for it. **Intent\_table** id, intent\_name

**samples\_data\_table** id samples intent\_id

So, When user will say “heya” then how we can retrieve “welcome” intent name. using rasa-nlu? Any suggestions please. Thanks

---

<div class="post-metadata">

**Author:** ![chkoss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chkoss/32/7186_2.png) [@chkoss](https://forum.rasa.com/u/chkoss)\
**Post date:** [April 8, 2020, 8:05am UTC](https://forum.rasa.com/t/database-for-nlu/26729/2 "2020-04-08T08:05:09Z")

</div>

Hi @haneef, The easiest way to provide Rasa NLU with training data is to have the intent names and examples in a Markdown file instead of a database. By default, you would store this in your project folder as `data/nlu.md`.

For the example you described, the file would have the following content:

```auto
## intent:welcome
- hi
- hello
- hey

## intent: jokes
- jokes
- tell me joke
- I am sad

```

If you want / have to use a database instead of the markdown file, things get a lot more complicated. You will have to implement your own custom importer. Some guidelines on this can be found [here](https://rasa.com/docs/rasa/api/training-data-importers/#writing-a-custom-importer), but I would recommend to simply put your intents in a markdown file as it is a lot easier.

For learning how to create a simple bot, you can also check out our [Tutorial](https://rasa.com/docs/rasa/user-guide/rasa-tutorial/).

---

<div class="post-metadata">

**Author:** ![haneef](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/haneef/32/6613_2.png) [@haneef](https://forum.rasa.com/u/haneef)\
**Post date:** [April 8, 2020, 8:28am UTC](https://forum.rasa.com/t/database-for-nlu/26729/3 "2020-04-08T08:28:40Z")

</div>

I am trying to create my own chatbot framework just like wit.ai not exact like wit. but with some basic features. i already worked with rasa. So i thought i can use rasa-nlu as luis for intent classification. so the challenge is training data and intent like where user will save their intents respect to application id.

---

<div class="post-metadata">

**Author:** ![chkoss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chkoss/32/7186_2.png) [@chkoss](https://forum.rasa.com/u/chkoss)\
**Post date:** [April 8, 2020, 10:01am UTC](https://forum.rasa.com/t/database-for-nlu/26729/4 "2020-04-08T10:01:49Z")

</div>

Ah, sorry for misunderstanding. I’m still not sure what exactly your problem is: is it getting the training data into Rasa NLU or is it using Rasa NLU to retrieve the intent names from an incoming user message?

I would suggest the following: Convert your training data into a format that Rasa NLU understands easily (markdown or json as described [here](https://rasa.com/docs/rasa/nlu/training-data-format)). Then follow [these steps](https://rasa.com/docs/rasa/nlu/using-nlu-only/) to get a running server with a trained NLU model. You can then send requests with user messages from your framework to this server and get back the intents. The retrieved intents will be in the usual Rasa format, but it is also possible to get them back in the format that is used by wit.ai (see [here](https://rasa.com/docs/rasa/migrate-from/facebook-wit-ai-to-rasa/#step-5-start-a-server-with-your-nlu-model)) or LUIS (see [here](https://rasa.com/docs/rasa/migrate-from/microsoft-luis-to-rasa/#step-5-start-a-server-with-your-nlu-model)) instead.
