CoolFace
Apppublic

jeevan0704/HR_Policy_Document_Chatbot

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
App README

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.2 via Hugging Face Inference API.

Setup

Prerequisites

  • —Python 3.10+
  • —Hugging Face API Token (Read access)

Installation

  1. 1.Clone the repository.
  2. 2.Install dependencies:
bash
   pip install -r requirements.txt
  1. 1.Generate the policy document:
bash
   python generate_policy.py

Running Locally

You need to set your HF_TOKEN environment variable for the LLM to work.

bash
# Windows (PowerShell)
$env:HF_TOKEN="your_hugging_face_token"
python app.py

# Linux/Mac
export HF_TOKEN="your_hugging_face_token"
python app.py

Deployment to Hugging Face Spaces

  1. 1.Create a new Space on Hugging Face.
  2. 2.Select Gradio as the SDK.
  3. 3.Upload the files in this repository (including Dockerfile and requirements.txt).
  4. 4.Crucial: Go to Settings -> Variables and secrets and add a secret named HF_TOKEN with your Hugging Face API key.
  5. 5.The Space will build and run automatically.