How to train intent for location input?

I m trying to get location input from the user. Let’s say the input will be a city name.

I’ve used a lookup file and added the below code to

## lookup:location

the loc.txt files contain a list of 10000 cities in India.

Also, I’ve added an intent enterloc to enter the location as below :

## enterloc
- mumbai
- bengaluru
- new delhi
- kolkata

Currently, the bot is able to identify these 4 cities and fill the slot for location entity. But it fails to recognise intent as enterloc when any other city present in the lookup file is entered by the user.

Now, obviously all the cities cannot be trained for getting the location input from user. Please suggest a right approach for this.


@souvikg10 suggestions please?

Hello @vivekanon,

I’d recommend looking at the GitHub - RasaHQ/rasa-demo: Sara - the Rasa Demo Bot: An example of a contextual AI assistant built with the open source Rasa Stack we have this exact location slot setup in there.

You should be able to see the NLU data and how the locations are setup. Let me know if you have follow up questions on it after looking over the repo.