CoolFace
Apppublic

cj-dev-code/semantic_search

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

๐Ÿง  Mental Health Semantic Searcher

A project to make mental health advice from dense books more accessible through semantic search and quote-level retrieval.

โœจ Motivation

When you're dysregulated, skimming a whole book or even a chapter can feel overwhelming. This tool helps you search for therapeutically helpful language based on what you're feeling or trying to express โ€” so you can find quotes, not just concepts.


โš™๏ธ Tech Stack

  • โ€”Python โ€“ backend logic + semantic chunking
  • โ€”Azure AI Search โ€“ vector search. rejected: Pinecone, FAISS, Vilvus
  • โ€”Vector Embeddings - voyage 3.5. chosen for: intent, emotional, concept rich embedding. rejected: openai (too literal), cohere (unemotional), MPnet MiniLM (poor purpose handling), Google USE (too generic for quote level lookup)
  • โ€”Gradio โ€“ frontend interface. Options rejected: streamlit, dash, next.js, react.
  • โ€”GitHub Actions โ€“ CI pipeline
  • โ€”pytest โ€“ test framework

๐Ÿ“‚ Project Structure

frontend/    # User interface (Streamlit or React)
backend/     # API + semantic search logic
data/        # Sample books and chunked quote data
notebooks/   # R&D, experiments, visualizations
scripts/     # Setup scripts, evaluators

๐Ÿšง Status

  • โ€”[x] Repo initialized with CI
  • โ€”[x] Project scaffolded
  • โ€”[ ] Semantic chunker implemented
  • โ€”[ ] Retrieval working end-to-end
  • โ€”[ ] Frontend MVP

๐Ÿงช Running Tests

bash
pip install -r requirements.txt
pytest

---

## ๐Ÿ” Environment Variables

Before running the app, create a `.env` file in the project root and define the following:

| Variable           | Description                          |
|--------------------|--------------------------------------|
| `VOYAGE_API_KEY`   | API key from [Voyage AI](https://voyageai.com) |
| `AAIS_ENDPOINT`    | Azure AI Search endpoint URL         |
| `AAIS_KEY`         | Azure AI Search admin key            |
| `OPENAI API KEY`   | Openai API key                       |
| `RUN_DOCKER_TEST`  | make this true to run docker tests   |

You can use the provided `.env.example` file as a template: