0

I am making a chatbot in RASA which helps High school graduates find university according to their desired location. I have all my data stored in a CSV file. So is there any way we can extract some specific data from that CSV. Example: If a user asks to show universities available in a certain location, how to extract the specific data from CSV which is the name of the university according to the location given by the user.

Magnetron
  • 7,495
  • 1
  • 25
  • 41
  • 1
    have you looked at `pandas` for reading csv? – Kenan Mar 01 '21 at 16:00
  • @Kenan yes i have tried that but I'm having issue in extracting a specific data as requested by the user. so if a user asks a location of a university in a specific area how should i be doing that? – Aayush Dangol Mar 02 '21 at 10:20
  • Have you looked at custom actions in Rasa? https://www.youtube.com/watch?v=rvHg7N8ux2I&t=1s You can write a custom action to extract info from a database, which can be in a csv format read in using pandas. – Aciel Mar 02 '21 at 13:45
  • can you show some rows of the csv file. – Kenan Mar 02 '21 at 22:27
  • College location The British College, Kathmandu Trade Tower Kathmandu Engineering College Ganeshman Singh Rd So these are some of my data @Kenan – Aayush Dangol Mar 04 '21 at 06:19

1 Answers1

0

Seems like you will need to train the model with location entity. Create a story that will link an intent with location entity to a custom action.

Sample story could like something like this:

story 1

* ask_university{"location":New York}
 - action_get_universities

In the custom action action_get_universities, you will then need to handle the CSV query based on the location entity that the model detected. Pandas should work just fine.

Have fun exploring !