Skip to content

narangtanmay/hotel-recommender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clooless: Hybrid Hotel Search

Built this for a makeathon. Basically, it's a hotel search engine that lets you just type what you want in plain English (e.g., "I need a quiet, cheap hotel near the beach") instead of clicking through a dozen UI filters.

The backend uses a hybrid approach:

  1. LLM Extraction: We pass the query to an LLM (Azure OpenAI) to extract "hard" constraints (max price, required amenities) into JSON.
  2. Filtering: We strictly filter the dataset based on those numbers.
  3. Semantic Ranking: We take whatever hotels survive the filter and use a local SentenceTransformer to rank them by semantic similarity (matching the "vibes" like "romantic" or "quiet").

How to run it

You'll need two terminals running: one for the Flask API and one for the React frontend.

1. The Backend (Python)

Navigate to the code/ directory. You'll probably want to set up a virtual environment. Install the dependencies (Flask, pandas, sentence-transformers, openai, etc.).

Create a .env file in the code/ folder with your Azure keys:

AZURE_OPENAI_ENDPOINT="your_endpoint_here"
AZURE_OPENAI_API_KEY="your_api_key_here"

Important: Before you start the server, you have to pre-compute the embeddings. If you try to embed the whole parquet file on the fly, the API will time out. Ensure your .parquet dataset is in the right folder (data/hotels/) and run:

python build_vector_cache.py

{Sample ones are there from the Hackathon}

Once that finishes creating the .pkl cache file, start the Flask server:

python server.py

(Runs on localhost:5000)

2. The Frontend (React/Vite)

Open a second terminal and navigate to the frontend/ directory.

npm install
npm run dev

(Runs on localhost:5173)

Gotchas & Notes

  • Caching: We cache LLM responses in llm_cache.json locally so we don't burn through API credits while reloading the page, along with a few other cache and text files for testing.

About

A natural language hotel search engine. Uses an LLM to extract hard numerical constraints and local vector embeddings to match semantic "vibes". (React/Flask)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors