This is a simple chatbot application built using Streamlit. The application uses Elasticsearch for document retrieval and Hugging Face's transformers for generating responses.
- Multimodal RAG: Combines document retrieval and response generation.
- Elasticsearch: Retrieves relevant documents based on user queries.
- Hugging Face: Generates responses using the GPT-2 model or other Hugging Face models.
- Streamlit Interface: Provides a simple and interactive web interface.
- Python 3.7 or higher
- Elasticsearch server (local or hosted)
- Hugging Face API key
-
Clone the repository:
git clone https://github.com/yourusername/streamlit-chatbot.git cd streamlit-chatbot
-
Install the required packages:
pip install -r requirements.txt
-
Ensure your Elasticsearch server is running and has an index named
documents
.
Install the requirements
$ pip install -r requirements.txt
Run the app
$ streamlit run streamlit_app.py
-
Open your browser and go to
http://localhost:8501
. -
Enter your Elasticsearch server URL and Hugging Face API key when prompted.
-
Install Elasticsearch (if not already installed):
- For local installation, download from Elastic's website and follow the instructions.
- For a hosted service, consider using Elasticsearch Service.
-
Start your Elasticsearch server:
./bin/elasticsearch
-
Create an index and add documents:
# Create an index named 'documents' curl -X PUT "localhost:9200/documents" # Add a document to the index curl -X POST "localhost:9200/documents/_doc/1" -H 'Content-Type: application/json' -d' { "content": "This is the content of the document." } '
Ensure your documents in Elasticsearch have the following structure:
{
"content": "This is the content of the document."
}