ThemeLens is a qualitative insights workspace for turning raw feedback exports into structured themes, evidence-backed findings, and ready-to-share reports.
The product flow is:
- Upload a
CSVor Excel dataset. - Inspect the inferred text column and supporting metadata fields.
- Generate a dashboard of high-level insights and theme clusters.
- Refine themes by renaming, merging, or hiding them.
- Review the report page and export a lightweight HTML report.
ThemeLens now ships as a route-based multi-page app:
/for the product landing page/app/uploadfor dataset intake/app/inspectfor column confirmation and sample-row review/app/insightsfor the main dashboard and theme workspace/app/reportfor the share-ready summary view
- Next.js 16 App Router
- React 19
- Tailwind CSS v4
xlsxfor spreadsheet parsing- Python FastAPI backend for semantic analysis
openaifor embeddings and theme labelingscikit-learn+hdbscanfor PCA, clustering, and diagnostics
The analysis approach is inspired by the reference topic-modelling project in /Users/taro/Projects/amplifon-topic-modelling:
- vectorize text
- reduce dimensions
- cluster similar responses
- generate readable theme labels
In this repository:
- Next.js handles the product UI, route-based workflow, session-backed workspace state, spreadsheet parsing, and report export
- Python handles preprocessing, OpenAI embeddings, PCA, HDBSCAN topic discovery, and stable label generation
- The app separates high-level insights from cluster-level detail so users can scan the summary before inspecting evidence
- Technical diagnostics remain available, but they are secondary to upload, inspect, and actionable findings
- The app uses a server-side workspace session abstraction so preview and analysis state can persist across the multi-page flow.
- The current adapter in this repo is memory-backed and designed to be replaced by a durable store when deploying beyond local or single-instance use.
- Theme edits such as rename, merge, hide, and selected-theme state are synchronized back into the workspace session.
npm run setup:local
cp .env.example .env
npm run dev:python
npm run devOpen http://localhost:3000.
Create .env for local development:
OPENAI_API_KEY=your_key_here
PYTHON_ANALYZE_URL=http://127.0.0.1:8000/api/python_analyzePYTHON_ANALYZE_URL is optional on Vercel because the app can call the colocated Python function at /api/python_analyze.
- Empty rows are dropped before analysis.
- Clusterable comments stay as individual rows so repeated wording can strengthen theme detection.
- Short comments are retained for semantic clustering; only obvious code-like tag entries are excluded and reported separately.
- HDBSCAN is the primary clustering method, using a small parameter search and nearest-theme reassignment for noise points; deterministic k-means is used only when none of the HDBSCAN candidates produce a reasonable topic split.
- Rows that do not fit a dense theme stay visible in an
Unclustered feedbackbucket instead of being silently forced into a topic. - Sentiment is heuristic and directional only.