Regex to entity

Thanks a lot! This was missing… I followed it and voila! :slight_smile:

I have another question if you can kindly help: I want to make the city name as case insensitive. As of now, my bot only recognizes city names that starts with Capital letter but cannot understand if user gives a city name in small letter, e.g., berlin but not Berlin. I am building a restaurant bot, so using Zomato .api to extract the relevant data. I am restricting the bot with a list of cities, created a dictionary of it where I mentioned the city names starting with capital letter and then the following code. Something is going wrong:

Error: Traceback (most recent call last): File “c:\users\sourav.kumar.nag\anaconda3\envs\rasademo\lib\site-packages\sanic\app.py”, line 976, in handle_request response = await response File “c:\users\sourav.kumar.nag\anaconda3\envs\rasademo\lib\site-packages\rasa_sdk\endpoint.py”, line 102, in webhook result = await executor.run(action_call) File “c:\users\sourav.kumar.nag\anaconda3\envs\rasademo\lib\site-packages\rasa_sdk\executor.py”, line 387, in run events = action(dispatcher, tracker, domain) File “C:\Users\sourav.kumar.nag\Desktop\Chatbots\RestaurantChatbot\actions.py”, line 65, in run check = check_location(loc) File “C:\Users\sourav.kumar.nag\Desktop\Chatbots\RestaurantChatbot\city_check.py”, line 26, in check_location elif loc.lower() not in city_dict: AttributeError: ‘NoneType’ object has no attribute ‘lower’

Code: city_dict = [x.lower() for x in city_dict] => As per the log it fails at this point def check_location(loc,city_dict =city_dict):

Looks like loc is None.

Don’t forget to start and end a block of code with a line containing three ` characters so that it appears as code instead of markdown.

I want to implement rule that till correct number will enter from action it should keep ask for number

Fix for that is to use whole word, this way you would not care about specific formatting

regex: something
- \b\w\b

then create examples like

intent: whatever
examples: |
   - plate number is [example1](something)
   - plate number is [example2](something)
   - plate number is [example3](something)

and so forth…

You do not need stories to extract the entities. Even if you do not specify a pipeline, RASA default will pick something good for you.