/llama3_rag_chatbot

A chatbot for hotel reviews powered by the LLM Lllama3 and the framework Llama-Index

Primary LanguageJupyter Notebook

Here is a README file for the above code:

Hotel Reviews Chatbot

This is a Gradio-based chatbot that allows users to query hotel reviews and displays a map of the hotel locations.

Requirements

  • Python 3.8+
  • Gradio 3.0+
  • Folium 0.12+
  • Geopy 2.2+
  • Hugging Face Transformers 4.12+
  • LLaMA Index 0.4+

Usage

  1. Run the code in a Python environment with the required libraries installed.
  2. Open a web browser and navigate to the URL provided by Gradio.
  3. Enter a query in the input box, such as "Which hotel had the best food?"
  4. The chatbot will respond with a text response and a map displaying the locations of the relevant hotels.

Code Overview

The code consists of several components:

  1. Data Loading: The hotel review data is loaded from the Hugging Face dataset ashraq/hotel-reviews.
  2. Indexing: The data is indexed using the LLaMA Index library, which allows for efficient querying of the data.
  3. Query Engine: The query engine is built using the LLaMA Index library and allows users to query the data.
  4. Map Generation: The map is generated using Folium, which displays the locations of the relevant hotels.
  5. Gradio Interface: The Gradio interface is used to create a web-based interface for the chatbot.

Note

This code is for demonstration purposes only and may require modifications to work with your specific use case.