LLM_chatbot2 / readme.md
Anvit25's picture
Update readme.md
f15bf20 verified
# Samsung Manual Chatbot
A chatbot built with **LangChain**, **Gradio**, and **Hugging Face Transformers** that allows you to interact with the **Samsung Manual**.
It uses embeddings + ChromaDB for retrieval and a conversational chain for contextual Q&A.
---
## Project Structure
LLM_chatbot2/
│── chroma_db/ # Persistent Chroma vector database
│── temp_docs/ # Store documents (Samsung manual here)
│── app.py # Main Gradio app
│── requirements.txt # Dependencies
│── README.md # Project documentation
│── .gitattributes
---
## Features
- **Document Loading** – Loads and processes the Samsung manual (`temp_docs/samsung_manual.txt`).
- **Chunking** – Splits the document into manageable chunks for embeddings.
- **Embeddings** – Uses `sentence-transformers/all-MiniLM-L6-v2` for semantic search.
- **Vector Database** – Stores embeddings in **ChromaDB** for retrieval.
- **Conversational Memory** – Maintains chat context with `ConversationBufferMemory`.
- **LLM Response** – Powered by `google/flan-t5-base` via Hugging Face pipeline.
- **Gradio UI** – Simple chat interface for interacting with the chatbot.
---
## Installation
Clone the repository and install dependencies:
```bash
git clone https://github.com/Anvit25/LLM_chatbot2.git
cd LLM_chatbot2
pip install -r requirements.txt
Running the App
Make sure you have the Samsung manual text file at temp_docs/samsung_manual.txt.
Then run:
python app.py
Gradio will launch a local server. Open the link shown in the terminal (usually http://127.0.0.1:7860) to interact with the chatbot.
```
## Requirements
Dependencies are listed in requirements.txt:
pypdf
gradio
langchain
chromadb
sentence-transformers
transformers
torch
## Usage
Place your document inside temp_docs/ (default: samsung_manual.txt).
Run the app.
Ask natural language questions like:
"How do I reset my Samsung washing machine?"
"Explain the safety precautions in the manual."
The chatbot retrieves relevant chunks from the document and answers conversationally.
## Customization
Change the document: Replace temp_docs/samsung_manual.txt with any .txt file.
Switch embeddings: Modify MODEL_NAME_EMBEDDINGS in app.py.
Try different LLMs: Update MODEL_ID_LLM to another Hugging Face model.
## License
This project is open-source under the MIT License.
---