Tasty Search is a search engine built on Python (and Django) to search gourmet food reviews data and return the top K (configurable) reviews that have the highest overlap with input query.
Required dataset is downloaded from Web data: Amazon Fine Foods reviews
- Clone the repo.
- Create a virtualenv.
- Install the requirements.
- Perform downsampling the data as per requirement. (Eg: to 100,000 entries.)
Use the below management command:
python manage.py perform_downsize --input_file=assets/foods.txt --count=100000
-
input_file (Mandatory) : File path for gourmet food reviews. (Default value : assets/foods.txt)
-
output_file : Output path for downsized file (If path changes required, to be configured in settings as well. Refer Configurable variables section below) (Default value : assets/food_reviews.json)
-
count : Total reviews expected after downsizing. (Default value : 100000)
- Build index of downsized data.
Use the below management command:
python manage.py build_index --input_file=assets/food_reviews.json
-
input_file (Mandatory) : Path to downsized food reviews file. (Default value : assets/food_reviews.json)
-
output_file : Output path for index file. (If path changes required, to be configured in settings as well. Refer Configurable variables section below). (Default value : assets/index.json)
- Run the server the usual way (python manage.py runserver) and you are good to go.
- ASSETS_DIR : The directory where data and index is stored.
- FILES : The location of various assets available.
- MAX_REVIEWS_COUNT_PER_HIT : Maximum number of reviews returned per search. (Defaulted to 20).
Performed using coverage.
coverage run manage.py test -v 2
Live demo is deployed on heroku. Click here
Sample input : cat coffee cinnamon
Sample Response : Click here