File size: 2,143 Bytes
b731c78
 
d47e1e1
 
 
b731c78
d47e1e1
b731c78
 
 
d47e1e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: Feedback Analyzer
emoji: 📊
colorFrom: yellow
colorTo: red
sdk: docker
app_port: 7860
pinned: false
---

# Feedback Analyzer 📊

Paste or upload customer feedback in bulk (reviews, emails, survey replies) and get, for
each item: **sentiment · intent · confidence · a one-line reason · the evidence phrase** —
plus a **rollup** (sentiment/intent mix + top themes) and a **downloadable labeled CSV**.

> Project **#5** of my *"30 AI Projects in 15 Days"* build-in-public challenge.

**▶ Live demo: https://feedback.gritai.solutions**

![demo](demo.png)

## Why it's different
Most sentiment tools stop at a polarity score. This one answers the questions a business
actually has: **why** (reason + the exact quote), and **so what** (a rollup of the top
themes and the sentiment mix). It won't just rubber-stamp "positive" — on real reviews it
correctly flags the *mixed* ones (great pastry, but "dry" cake; tasty, but "pricey").

## How it works
- **One batched Claude call** with **forced tool-use** → the whole batch comes back as
  schema-valid JSON in a single request (fast + cheap + reliable). Ollama fallback uses
  constrained JSON decoding.
- **Counts are computed in code**, not by the model — the math is always right.
- **Custom labels:** use the defaults (praise / complaint / question / suggestion) or
  define your own intent categories.

## Input
- **Paste:** one item per line (great for short comments / survey one-liners).
- **CSV upload:** for full multi-paragraph reviews — the parser finds the text column and
  keeps each review whole. *(Validated against real Yelp reviews.)*

## Run locally
```bash
pip install -r requirements.txt
export ANTHROPIC_API_KEY=sk-ant-...      # or set OLLAMA_URL / OLLAMA_MODEL
python app.py                            # http://127.0.0.1:8500
```

## Deploy (always-on)
Ships with a `Dockerfile` — works on **Hugging Face Spaces**, Render, Railway, or Fly.io.
Set `ANTHROPIC_API_KEY` (+ optional `ANTHROPIC_MODEL=claude-haiku-4-5`) as a secret.

---
Built by **Robert Lucyk** · [GritAI Solutions](https://gritai.solutions) · part of the 30-in-15 challenge.