# Wondering if I'm doing something wrong

**URL:** <https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529>\
**Category:** Rasa Open Source\
**Created:** [March 11, 2023, 11:28pm UTC](https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529 "2023-03-11T23:28:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![larrywongkahei](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/larrywongkahei/32/22581_2.png) [@larrywongkahei](https://forum.rasa.com/u/larrywongkahei)\
**Post date:** [March 11, 2023, 11:28pm UTC](https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529/1 "2023-03-11T23:28:43Z")

</div>

Hi! I’m new to Rasa! and I have a few questions. 😀

This is one of my intent, I would like to train my bot to understand the entity location, but everytime I type something other than these location mentions below, rasa is not getting any entity.Am I not giving it enough data?Do I need to include entities below the examples?thanks! This is my intent.

- intent: weather examples: |
  - what is the weather [today]{“entity”: “date”}?
  - what is the weather like in [New York]{“entity”: “location”} [today]{“entity”: “date”}?
  - what will be the temperature in [London]{“entity”: “location”} [tomorrow]{“entity”: “date”}?
  - is it going to rain in [San Francisco]{“entity”: “location”} [this weekend]{“entity”: “date”}?
  - is the weather good [tomorrow]{“entity”: “date”}?
  - how is the weather [tomorrow]{“entity”: “date”}?

This is my stories

- story: ask\_weather steps:
  - intent: weather entities:
    - location: “New York”
    - date: “today”

  - action: “check\_weather”

This is my domain

version: ‘3.1’

intents:

- affirm

- bot\_challenge

- deny

- goodbye

- greet

- mood\_great

- mood\_unhappy

- question\_name

- question\_name\_from

- question\_about\_me

- joke

- weather

entities:

- date

- location

responses:

utter\_greet:

- text: Good day, sir. How can I assist you today?

utter\_cheer\_up:

- text: ‘Here is something to cheer you up:’ image: [https://i.imgur.com/nGF1K8f.jpg](https://i.imgur.com/nGF1K8f.jpg) utter\_did\_that\_help:
- text: Did that help you? utter\_joke:
  - text: Of course, sir. Why did the tomato turn red? Because it saw the salad dressing! session\_config: session\_expiration\_time: 60 carry\_over\_slots\_to\_new\_session: true actions:
  - check\_weather

This is my actions

# This files contains your custom actions which can be used to run

# custom Python code.

# 

# See this guide on how to implement these action:

# [Writing Custom Actions | Rasa Documentation](https://rasa.com/docs/rasa/custom-actions)

# This is a simple example for a custom action which utters “Hello World!”

from typing import Any, Text, Dict, List from rasa\_sdk import Action, Tracker from rasa\_sdk.executor import CollectingDispatcher

class GetWeather(Action): def name(self) → Text: return “check\_weather”

```
def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    entities = tracker.latest_message['entities']
    date = None
    location = None
    for entity in entities:
        if entity['entity'] == 'location':
            location = entity['value']
        elif entity['entity'] == 'date':
            date = entity['value']
    dispatcher.utter_message(text=f"The location is {location} and the date is {date}.")
    return []

```

everytime I input location that not in the intent, I got location is none.Thank you in advance!

---

<div class="post-metadata">

**Author:** ![utsuk.prani](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/utsuk.prani/32/8192_2.png) [@utsuk.prani](https://forum.rasa.com/u/utsuk.prani)\
**Post date:** [March 13, 2023, 12:28pm UTC](https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529/2 "2023-03-13T12:28:24Z")

</div>

> [@larrywongkahei](#):
>
> her like in [New York]{“entity”: “location”} [to

it won’t automatically pick new locations unless you give training data to your bot. One way would be use lookup tables for the locations. see this blog [Lookup Tables](https://rasa.com/blog/improving-entity-extraction/)

---

<div class="post-metadata">

**Author:** ![larrywongkahei](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/larrywongkahei/32/22581_2.png) [@larrywongkahei](https://forum.rasa.com/u/larrywongkahei)\
**Post date:** [March 13, 2023, 1:35pm UTC](https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529/3 "2023-03-13T13:35:21Z")

</div>

Does that mean is not about giving not enough data to train the bot, its about the bot cant pick new location because I didnt mention them in the intent?thanks

---

<div class="post-metadata">

**Author:** ![utsuk.prani](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/utsuk.prani/32/8192_2.png) [@utsuk.prani](https://forum.rasa.com/u/utsuk.prani)\
**Post date:** [March 13, 2023, 4:38pm UTC](https://forum.rasa.com/t/wondering-if-im-doing-something-wrong/57529/4 "2023-03-13T16:38:09Z")

</div>

you need to provide all the values for your entity location in lookup table as part of the training data. see an example here [NLU Training Data](https://rasa.com/docs/rasa/nlu-training-data#lookup-tables)
