Swetha Subramanian     About     Research     Archive     CV     Portfolio

Restaurant recommender app

I recently moved to Madison to start my postdoc at the University of Wisconsin – Madison. I moved in the summer, when the city was at its happiest (read warmest!). I naturally wanted to eat nice yummy food as a way of exploring this new environment. As a newbie, I relied on yelp.com a lot. But I hated having to read through pages and pages of text before I made a passable decision. I usually ended up winging it and some times it was a great hit. Mostly I could have made a better decision. Naturally, I thought a way of boiling down restaurants to a reasonable number of recommendations would be a great idea. Something I would actually use. Hence, this implementation!

As a starting point, I wanted to create a pretty basic web interface that given the user’s address, and food preference pulled top 5 restaurant recommendations within 6 miles from yelp’s API. Seems simple enough, right?

Challenges:

  • People don’t usually enter their address precisely. So I needed a way to parse that address into a usable format such as longitude and latitude values. Google’s geocoding API does just that. So I used that to generate longitude and latitude info, given the address.

  • I like maps. I like getting a sense of location from a map. So I wanted to show top restaurant recommendations in a map. I used google maps API and some javascript to make it all possible.

  • Pipe everything to a nice web framework using Flask. This was definitely a challenge, due to my absymal knowledge of everything HTML, websites. But once I figured it out, it was all easy. I guess the best way for me to get an idea was to look at a minimalist example code such as this. Tutorials were a great help to understand it all later.

  • I hosted the app with heroku, which was relatively easy after I got flask to work the way I wanted it to. Although, the app seems to sleep after a couple of days. So I need to modify something in the app now and then to keep it alive.

So here is the result! Code in my github repo here.

Next Steps:

While this was a great start, I want to refine this further. I want to implement a way of ranking restaurants based on user preferences such as ambience, distance, parking, average user rating etc. I also want to make recommendations by parsing user reviews for must menu recommendations. This might be a bit more complicated, as this will involve a lot data torturing. Fun!