jeevan0704/HR_Policy_Document_Chatbot
0
HR Policy Document Chatbot
This is a RAG-based Chatbot that answers questions about HR policies. The policies are synthetically generated from an employee attrition dataset (WA_Fn-UseC_-HR-Employee-Attrition.csv).
Features
- Synthetic Policy Generation: Creates a policy manual based on real data distributions (e.g., Working Hours, Job Roles).
- RAG Pipeline: Retrieves relevant policy sections to answer user queries using FAISS and HuggingFace Embeddings.
- LLM Integration: Uses
Mistral-7B-Instruct-v0.2via Hugging Face Inference API.
Setup
Prerequisites
- Python 3.10+
- Hugging Face API Token (Read access)
Installation
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt- Generate the policy document:
python generate_policy.pyRunning Locally
You need to set your HF_TOKEN environment variable for the LLM to work.
# Windows (PowerShell)
$env:HF_TOKEN="your_hugging_face_token"
python app.py
# Linux/Mac
export HF_TOKEN="your_hugging_face_token"
python app.pyDeployment to Hugging Face Spaces
- Create a new Space on Hugging Face.
- Select Gradio as the SDK.
- Upload the files in this repository (including
Dockerfileandrequirements.txt). - Crucial: Go to Settings -> Variables and secrets and add a secret named
HF_TOKENwith your Hugging Face API key. - The Space will build and run automatically.
