CoolFace
Apppublic

PengoSword123/emotionSteps

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes
App README

This is a FastAPI service that detects emotion in text and answers with a Retrieval-Augmented Generation (RAG) pipeline.

Setup (Windows PowerShell)

  1. 1.Create and activate a virtual environment:
powershell
python -m venv .venv
. .venv\Scripts\Activate.ps1
  1. 1.Install dependencies:
powershell
pip install -r requirements.txt
  1. 1.(Optional) Set your Hugging Face token to use hosted models:
powershell
$env:HUGGINGFACEHUB_API_TOKEN = "hf_...your_token..."
  1. 1.Run the API:
powershell
python app.py
  1. 1.Test endpoints:
  2. 2.Health: GET http://localhost:8000/health
  3. 3.Process: POST http://localhost:8000/process with JSON body:
json
{ "message_text": "I am frustrated with my laptop." }

The service will return the detected emotion, an answer, and proof links or snippets from the knowledge base.