This application provides a searchable guide to Zurich's cultural history, landmarks, education, and more, utilizing Elasticsearch for efficient querying and OpenAI for dynamic answer generation. Designed with a Flask, Elasticsearch and simple HTML template, users can interact through a chat interface to find detailed information about Zurich.
- Elasticsearch Integration: Leverages Elasticsearch to index and search through Zurich's city data.
- Sentence Transformers: Utilizes
sentence-transformersfor generating document embeddings, enhancing search relevance. - OpenAI API: Employs OpenAI's API for generating contextual answers to user queries.
- Simple UI: Offers a straightforward user interface for querying and receiving information.
- Flask Application: Built on Flask, facilitating easy web server setup and interaction.
Please note that the data utilized in this application was sourced through web scraping from Zurich's official city site, focusing on cultural history, landmarks, education, and more. Therefore, simple searches related to broad categories like Landmarks, History, Politics, Travel, and Tourism are more likely to yield reliable results. Users seeking highly specific or nuanced information should verify the data through additional sources when necessary.
- Clone the repository:
git clone git@github.com:ZhuBit/elasticsearch_zurich.git- Creat .env file with:
OPENAI_API_KEY=<your_openai_api_key>- Install the required packages:
pip install -r requirements.txt- Creat docker container for elasticsearch:
docker run -p 9200:9200 -d --name elasticsearch_zurich \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
-e "xpack.security.http.ssl.enabled=false" \
-e "xpack.license.self_generated.type=trial" \
docker.elastic.co/elasticsearch/elasticsearch:8.11.0- Start Docker container:
docker start <container_id>- Create index and index data:
flask reindex- Run the application:
flask run- Python 3.8+
- Elasticsearch 7.x+
- An active OpenAI API key